summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-04-29merge-one-file: fix broken merges with alternate work treesLibravatar Jeff King2-3/+8
The merge-one-file tool predates the invention of GIT_WORK_TREE. By the time GIT_WORK_TREE was invented, most people were using the merge-recursive strategy, which handles resolving internally. Therefore these features have had very little testing together. For the most part, merge-one-file just works with GIT_WORK_TREE; most of its heavy lifting is done by plumbing commands which do respect GIT_WORK_TREE properly. The one exception is a shell redirection which touches the worktree directly, writing results to the wrong place in the presence of a GIT_WORK_TREE variable. This means that merges won't even fail; they will silently produce incorrect results, throwing out the entire "theirs" side of files which need content-level merging! This patch makes merge-one-file chdir to the toplevel of the working tree (and exit if we don't have one). This most closely matches the assumption made by the original script (before separate work trees were invented), and matches what happens when the script is called as part of a merge strategy. While we're at it, we'll also error-check the call to cat. Merging a file in a subdirectory could in fact fail, as the redirection relies on the "checkout-index" call just prior to create leading directories. But we never noticed, since we ignored the error return from running cat. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29add tests for merge-index / merge-one-fileLibravatar Jeff King1-0/+100
There were no tests for either, except a brief use in t1200-tutorial. These tools are not used much these days, as most people use the merge-recursive strategy, which handles everything internally. However, they are used by the "octopus" and "resolve" strategies, as well as any custom strategies or merge scripts people have built around them. For example, together with read-tree, they are the simplest way to do a basic content-level merge without checking out the entire repository contents beforehand. This script adds a basic test of the tools to perform one content-level merge. It also shows a failure of the tools to work properly in the face of GIT_WORK_TREE or core.worktree. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-09fast-import: introduce "feature notes" commandLibravatar Jonathan Nieder3-0/+9
Here is a 'feature' command for streams to use to require support for the notemodify (N) command. When the 'feature' facility was introduced (v1.7.0-rc0~95^2~4, 2009-12-04), the notes import feature was old news (v1.6.6-rc0~21^2~8, 2009-10-09) and it was not obvious it deserved to be a named feature. But now that is clear, since all major non-git fast-import backends lack support for it. Details: on git version with this patch applied, any "feature notes" command in the features/options section at the beginning of a stream will be treated as a no-op. On fast-import implementations without the feature (and older git versions), the command instead errors out with a message like This version of fast-import does not support feature notes. So by declaring use of notes at the beginning of a stream, frontends can avoid wasting time and other resources when the backend does not support notes. (This would be especially important for backends that do not support rewinding history after a botched import.) Improved-by: Thomas Rast <trast@student.ethz.ch> Improved-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-09fast-import: clarify documentation of "feature" commandLibravatar Jonathan Nieder1-20/+17
The "feature" command allows streams to specify options for the import that must not be ignored. Logically, they are part of the stream, even though technically most supported features are synonyms to command-line options. Make this more obvious by being more explicit about how the analogy between most "feature" commands and command-line options works. Treat the feature (import-marks) that does not fit this analogy separately. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10Documentation/git-archive: spell --worktree-attributes correctlyLibravatar Thomas Rast1-1/+1
The --worktree-attributes option was correctly documented in ba053ea (archive: do not read .gitattributes in working directory, 2009-04-18). However, later in 9b4c8b0 (archive documentation: attributes are taken from the tree by default, 2010-02-10) the misspelling "--work-tree-attributes" was used to refer to it. Fix this. Noticed-by: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.7.0.9Libravatar Junio C Hamano7-19/+96
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.6.6.3Libravatar Junio C Hamano6-19/+88
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.6.5.9Libravatar Junio C Hamano5-18/+64
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.6.4.5Libravatar Junio C Hamano3-2/+22
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15gitweb: Introduce esc_attr to escape attributes of HTML elementsLibravatar Jakub Narebski1-15/+22
It is needed only to escape attributes of handcrafted HTML elements, and not those generated using CGI.pm subroutines / methods for HTML generation. While at it, add esc_url and esc_html where needed, and prefer to use CGI.pm HTML generating methods than handcrafted HTML code. Most of those are probably unnecessary (could be exploited only by person with write access to gitweb config, or at least access to the repository). This fixes CVE-2010-3906 Reported-by: Emanuele Gentili <e.gentili@tigersecurity.it> Helped-by: John 'Warthog9' Hawley <warthog9@kernel.org> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-02Git 1.7.0.8Libravatar Junio C Hamano3-2/+12
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-01add: introduce add.ignoreerrors synonym for add.ignore-errorsLibravatar Jonathan Nieder2-2/+7
The "[add] ignore-errors" tweakable introduced by v1.5.6-rc0~30^2 (Add a config option to ignore errors for git-add, 2008-05-12) does not follow the usual convention for naming values in the git configuration file. What convention? Glad you asked. The section name indicates the affected subsystem. The subsection name, if any, indicates which of an unbound set of things to set the value for. The variable name describes the effect of tweaking this knob. The section and variable names can be broken into words using bumpyCaps in documentation as a hint to the reader. These word breaks are not significant at the level of code, since the section and variable names are not case sensitive. The name "add.ignore-errors" includes a dash, meaning a naive configuration file like [add] ignoreErrors does not have any effect. Avoid such confusion by renaming to the more consistent add.ignoreErrors, but keep the old version for backwards compatibility. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-27Git 1.7.0.7Libravatar Junio C Hamano4-3/+20
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-27config --get --path: check for unset $HOMELibravatar Jonathan Nieder2-1/+25
If $HOME is unset (as in some automated build situations), currently git config --path path.home "~" git config --path --get path.home segfaults. Error out with Failed to expand user dir in: '~/' instead. Reported-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-25Merge branch 'maint-1.6.6' into maint-1.7.0Libravatar Junio C Hamano4-3/+26
* maint-1.6.6: request-pull.txt: Document -p option Check size of path buffer before writing into it rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-25Merge branch 'maint-1.6.5' into maint-1.6.6Libravatar Junio C Hamano4-3/+26
* maint-1.6.5: request-pull.txt: Document -p option Check size of path buffer before writing into it rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-25request-pull.txt: Document -p optionLibravatar Stephen Boyd1-1/+4
Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-25Merge branch 'maint-1.6.4' into maint-1.6.5Libravatar Junio C Hamano3-2/+22
* maint-1.6.4: Check size of path buffer before writing into it rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-25Check size of path buffer before writing into itLibravatar Greg Brockman1-0/+2
This prevents a buffer overrun that could otherwise be triggered by creating a file called '.git' with contents gitdir: (something really long) Signed-off-by: Greg Brockman <gdb@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-optionLibravatar Uwe Kleine-König2-2/+20
The ?: operator has a lower priority than |, so the implicit associativity made the 6th argument of parse_options be PARSE_OPT_KEEP_DASHDASH if keep_dashdash was true discarding PARSE_OPT_STOP_AT_NON_OPTION and PARSE_OPT_SHELL_EVAL. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-28Documentation/config: describe status.submodulesummaryLibravatar Michael J Gruber1-0/+7
ac8d5af (builtin-status: submodule summary support, 2008-04-12) intoduced this variable and described it in git-status[1]. Include this description in git-config[1], as well. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-28Makefile: reenable install with NO_CURLLibravatar Michael J Gruber1-2/+3
Setting NO_CURL leaves some variables like REMOTE_CURL_ALIASES empty, which creates no fun when for-looping over $(REMOTE_CURL_ALIASES) unconditionally. Make it conditional. Reported-by: Paul Walker <PWalker752@aol.com> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-04remove ecb parameter from xdi_diff_outf()Libravatar René Scharfe4-19/+13
xdi_diff_outf() overrides the structure members of its last parameter, ignoring any value that callers pass in. It's no surprise then that all callers pass a pointer to an uninitialized structure. They also don't read it after the call, so the parameter is neither used for input nor for output. Turn it into a local variable of xdi_diff_outf(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-01index-pack: fix trivial typo in usage stringLibravatar Michael J Gruber1-1/+1
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-01git-submodule.sh: properly initialize shell variablesLibravatar Gerrit Pape1-0/+2
git-submodule inherits variables from the environment it is started in, expects the internal variables init= and recursive= to have an empty value, but doesn't initialize them appropriately. Thanks to the selftests, this can be reproduced through init=1 make test recursive=1 make test With this commit the variables are initialized, and the selftests succeed even if these variables have some values in the environment. The bug was discovered through the Debian autobuilders http://bugs.debian.org/569594 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-23Documentation improvements for the description of short format.Libravatar Eric Raymond1-9/+34
Incorporates the detailed explanation from Jeff King in <20100410040959.GA11977@coredump.intra.peff.net> and fixes the bug noted by Junio C Hamano in <7vmxxc1i8g.fsf@alter.siamese.dyndns.org>. Signed-off-by: Eric S. Raymond <esr@thyrsus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-22Git 1.7.0.6Libravatar Junio C Hamano4-3/+17
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-22Merge branch 'mg/use-default-abbrev-length-in-rev-list' into maintLibravatar Junio C Hamano1-1/+1
* mg/use-default-abbrev-length-in-rev-list: rev-list: use default abbrev length when abbrev-commit is in effect
2010-04-22Merge branch 'wp/doc-filter-direction' into maintLibravatar Junio C Hamano1-4/+4
* wp/doc-filter-direction: documentation: clarify direction of core.autocrlf
2010-04-22Merge branch 'jk/maint-diffstat-overflow' into maintLibravatar Junio C Hamano1-9/+12
* jk/maint-diffstat-overflow: diff: use large integers for diffstat calculations
2010-04-22Merge branch 'da/maint-python-startup' into maintLibravatar Junio C Hamano1-3/+2
* da/maint-python-startup: Makefile: Remove usage of deprecated Python "has_key" method
2010-04-21Documentation/Makefile: fix interrupted builds of user-manual.xmlLibravatar Jonathan Nieder1-2/+6
Unlike gcc, asciidoc does not atomically write its output file or delete it when interrupted. If it is interrupted in the middle of writing an XML file, the result will be truncated input for xsltproc. XSLTPROC user-manual.html user-manual.xml:998: parser error : Premature end of data in t Take care of this case by writing to a temporary and renaming it when finished. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-19t7012: Mark missing tests as TODOLibravatar Michael J Gruber1-6/+6
Currently, there are 6 tests which are not even written but are 'test_expect_failure message false'. Do not abuse test_expect_failure as a to do marker, but mark them as '#TODO' instead. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-19reflog: remove 'show' from 'expire's usage stringLibravatar SZEDER Gábor1-1/+1
Most of 'expire's options are not recognized by the 'show' subcommand, hence it errors out. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-19Merge branch 'maint-1.6.6' into maintLibravatar Junio C Hamano1-0/+1
* maint-1.6.6: MSVC: Fix build by adding missing termios.h dummy
2010-04-19MSVC: Fix build by adding missing termios.h dummyLibravatar Johannes Sixt1-0/+1
A use of this header file was introduced in eb80042 (Add missing #include to support TIOCGWINSZ on Solaris, 2010-01-11). Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-18Documentation: Describe other situations where -z affects git diffLibravatar Charles Bailey1-2/+2
-z also alters the behaviour of --name-only and --name-status. Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17documentation: clarify direction of core.autocrlfLibravatar Will Palmer1-4/+4
The description for core.autocrlf refers to reads from / writes to "the filesystem", the only use of this rather ambiguous term, which technically could be referring to the git object database. (All other mentions are part of phrases such as "..filesystems (like NFS).."). Other sections, including the section on core.safecrlf, use the term "work tree" for the same purpose as the term "the filesystem" is used in the core.autocrlf section, so that seems like a good alternative, which makes it clearer what direction the addition/removal of CR characters occurs in. Signed-off-by: Will Palmer <wmpalmer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17diff: use large integers for diffstat calculationsLibravatar Jeff King1-9/+12
The diffstat "added" and "changed" fields generally store line counts; however, for binary files, they store file sizes. Since we store and print these values as ints, a diffstat on a file larger than 2G can show a negative size. Instead, let's use uintmax_t, which should be at least 64 bits on modern platforms. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17t1010-mktree: Adjust expected result to code and documentationLibravatar Michael J Gruber1-6/+4
The last two tests here were always supposed to fail in the sense that, according to code and documentation, mktree should read non-recursive ls-tree output, but not recursive one, and therefore explicitely refuses to deal with slashes. Adjust the test (must_fail) so that it succeeds when mktree dies on slashes. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17combined diff: correctly handle truncated fileLibravatar Thomas Rast2-6/+16
Consider an evil merge of two commits A and B, both of which have a file 'foo', but the merge result does not have that file. The combined-diff code learned in 4462731 (combine-diff: do not punt on removed or added files., 2006-02-06) to concisely show only the removal, since that is the evil part and the previous contents are presumably uninteresting. However, to diagnose an empty merge result, it overloaded the variable that holds the file's length. This means that the check also triggers for truncated files. Consequently, such files were not shown in the diff at all despite the merge being clearly evil. Fix this by adding a new variable that distinguishes whether the file was deleted (which is the case 4462731 handled) or truncated. In the truncated case, we show the full combined diff again, which is rather spammy but at least does not hide the evilness. Reported-by: David Martínez Martí <desarrollo@gestiweb.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-15Document new "already-merged" rule for branch -dLibravatar Jonathan Nieder1-1/+3
v1.7.0-rc0~18^2 (branch -d: base the "already-merged" safety on the branch it merges with, 2009-12-29) taught ‘git branch’ a new heuristic for when it is safe to delete a branch without forcing the issue. It is safe to delete a branch "topic" without second thought if: - the branch "topic" is set up to pull from a (remote-tracking, usually) branch and is fully merged in that "upstream" branch, or - there is no branch.topic.merge configuration and branch "topic" is fully merged in the current HEAD. Update the man page to acknowledge the new rules. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-13Documentation/config.txt: default gc.aggressiveWindow is 250, not 10Libravatar Jay Soffian1-1/+1
The default for gc.aggressiveWindow has been 250 since 1c192f3 (gc --aggressive: make it really aggressive, 2007-12-06). Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-12Docs: Add -X option to git-merge's synopsis.Libravatar Marc Branchaud2-6/+7
Also move -X's description next to -s's in merge-options.txt. This makes it easier to learn how to specify merge strategy options. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-11Git 1.7.0.5Libravatar Junio C Hamano4-3/+30
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-11Merge branch 'rc/maint-reflog-msg-for-forced-branch' into maintLibravatar Junio C Hamano1-1/+1
* rc/maint-reflog-msg-for-forced-branch: branch: say "Reset to" in reflog entries for 'git branch -f' operations
2010-04-11blame documentation: -M/-C notice copied lines as well as moved onesLibravatar Junio C Hamano1-9/+10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09Let check_preimage() use memset() to initialize "struct checkout"Libravatar Jens Lehmann1-4/+1
Every code site except check_preimage() uses either memset() or declares a static instance of "struct checkout" to achieve proper initialization. Lets use memset() instead of explicit initialization of all members here too to be on the safe side in case this structure is expanded someday. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09Merge branch 'ef/maint-empty-commit-log' into maintLibravatar Junio C Hamano2-1/+13
* ef/maint-empty-commit-log: rev-list: fix --pretty=oneline with empty message
2010-04-09Merge branch 'jc/conflict-marker-size' into maintLibravatar Junio C Hamano2-14/+33
* jc/conflict-marker-size: diff --check: honor conflict-marker-size attribute