aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Fix memory corruption when .gitignore does not end by \nNguyễn Thái Ngọc Duy2010-01-20
| | | | | | | | | | | | | | | | | | | | | | Commit b5041c5 (Avoid writing to buffer in add_excludes_from_file_1()) tried not to append '\n' at the end because the next commit may return a buffer that does not have extra space for that. Unfortunately it left this assignment in the loop: buf[i - (i && buf[i-1] == '\r')] = 0; that can corrupt memory if "buf" is not '\n' terminated. But even if it does not corrupt memory, the last line would not be NULL-terminated, leading to errors later inside add_exclude(). This patch fixes it by reverting the faulty commit and make sure "buf" is always \n terminated. While at it, free unused memory properly. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'rr/core-tutorial'Junio C Hamano2010-01-20
|\ | | | | | | | | * rr/core-tutorial: Documentation: Update git core tutorial clarifying reference to scripts
| * Documentation: Update git core tutorial clarifying reference to scriptsRamkumar Ramachandra2010-01-16
| | | | | | | | | | | | | | | | Back when the git core tutorial was written, porcelain commands were shell scripts. This patch adds a paragraph explaining this. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jc/cache-unmerge'Junio C Hamano2010-01-20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/cache-unmerge: rerere forget path: forget recorded resolution rerere: refactor rerere logic to make it independent from I/O rerere: remove silly 1024-byte line limit resolve-undo: teach "update-index --unresolve" to use resolve-undo info resolve-undo: "checkout -m path" uses resolve-undo information resolve-undo: allow plumbing to clear the information resolve-undo: basic tests resolve-undo: record resolved conflicts in a new index extension section builtin-merge.c: use standard active_cache macros Conflicts: builtin-ls-files.c builtin-merge.c builtin-rerere.c
| * | rerere forget path: forget recorded resolutionJunio C Hamano2010-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | After you find out an earlier resolution you told rerere to use was a mismerge, there is no easy way to clear it. A new subcommand "forget" can be used to tell git to forget a recorded resolution, so that you can redo the merge from scratch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | rerere: refactor rerere logic to make it independent from I/OJunio C Hamano2010-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits the handle_file() function into in-core part and I/O parts of the logic to create the preimage, so that we can compute the conflict identifier without having to use temporary files. Earlier, I thought the output from handle_file() should also be refactored, but it is always about writing preimage (or thisimage) that is used for later three-way merge, so it is saner to keep it to always write to FILE *. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | rerere: remove silly 1024-byte line limitJunio C Hamano2009-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ever since 658f365 (Make git-rerere a builtin, 2006-12-20) rewrote it, it kept this line-length limit regression, even after we started using strbuf in the same function in 19b358e (Use strbuf API in buitin-rerere.c, 2007-09-06). Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | resolve-undo: teach "update-index --unresolve" to use resolve-undo infoJunio C Hamano2009-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The update-index plumbing command had a hacky --unresolve implementation that was written back in the days when merge was the only way for users to end up with higher stages in the index, and assumed that stage #2 must have come from HEAD, stage #3 from MERGE_HEAD and didn't bother to compute the stage #1 information. There were several issues with this approach: - These days, merge is not the only command, and conflicts coming from commands like cherry-pick, "am -3", etc. cannot be recreated by looking at MERGE_HEAD; - For a conflict that came from a merge that had renames, picking up the same path from MERGE_HEAD and HEAD wouldn't help recreating it, either; - It may have been Ok not to recreate stage #1 back when it was written, because "diff --ours/--theirs" were the only availble ways to review conflicts and they don't need stage #1 information. "diff --cc" that was invented much later is a lot more useful way but it needs stage #1. We can use resolve-undo information recorded in the index extension to solve all of these issues. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | resolve-undo: "checkout -m path" uses resolve-undo informationJunio C Hamano2009-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once you resolved conflicts by "git add path", you cannot recreate the conflicted state with "git checkout -m path", because you lost information from higher stages in the index when you resolved them. Since we record the necessary information in the resolve-undo index extension these days, we can reproduce the unmerged state in the index and check it out. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | resolve-undo: allow plumbing to clear the informationJunio C Hamano2009-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the Porcelain level, operations such as merge that populate an initially cleanly merged index with conflicted entries clear the resolve-undo information upfront. Give scripted Porcelains a way to do the same, by implementing "update-index --clear-resolve-info". With this, a scripted Porcelain may "update-index --clear-resolve-info" first and repeatedly run "update-index --cacheinfo" to stuff unmerged entries to the index, to be resolved by the user with "git add" and stuff. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | resolve-undo: basic testsJunio C Hamano2009-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that resolving a failed merge with git add records the conflicted state, committing the result keeps that state, and checking out another commit clears the state. "git ls-files" learns a new option --resolve-undo to show the recorded information. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | resolve-undo: record resolved conflicts in a new index extension sectionJunio C Hamano2009-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When resolving a conflict using "git add" to create a stage #0 entry, or "git rm" to remove entries at higher stages, remove_index_entry_at() function is eventually called to remove unmerged (i.e. higher stage) entries from the index. Introduce a "resolve_undo_info" structure and keep track of the removed cache entries, and save it in a new index extension section in the index_state. Operations like "read-tree -m", "merge", "checkout [-m] <branch>" and "reset" are signs that recorded information in the index is no longer necessary. The data is removed from the index extension when operations start; they may leave conflicted entries in the index, and later user actions like "git add" will record their conflicted states afresh. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-merge.c: use standard active_cache macrosJunio C Hamano2009-12-25
| |/ | | | | | | | | | | | | | | Instead of using the low-level index_state interface, use the bog standard active_cache and active_nr macros to access the cache entries when using the default one. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'js/exec-error-report'Junio C Hamano2010-01-20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * js/exec-error-report: Improve error message when a transport helper was not found start_command: detect execvp failures early run-command: move wait_or_whine earlier start_command: report child process setup errors to the parent's stderr Conflicts: Makefile
| * | Improve error message when a transport helper was not foundIlari Liusvaara2010-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Perviously, the error message was: git: 'remote-foo' is not a git-command. See 'git --help'. By not treating the transport helper as a git command, a more suitable error is reported: fatal: Unable to find remote helper for 'foo' Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | start_command: detect execvp failures earlyJohannes Sixt2010-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, failures during execvp could be detected only by finish_command. However, in some situations it is beneficial for the parent process to know earlier that the child process will not run. The idea to use a pipe to signal failures to the parent process and the test case were lifted from patches by Ilari Liusvaara. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | run-command: move wait_or_whine earlierJohannes Sixt2010-01-10
| | | | | | | | | | | | | | | | | | | | | We want to reuse it from start_command. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | start_command: report child process setup errors to the parent's stderrJohannes Sixt2010-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the child process's environment is set up in start_command(), error messages were written to wherever the parent redirected the child's stderr channel. However, even if the parent redirected the child's stderr, errors during this setup process, including the exec itself, are usually an indication of a problem in the parent's environment. Therefore, the error messages should go to the parent's stderr. Redirection of the child's error messages is usually only used to redirect hook error messages during client-server exchanges. In these cases, hook setup errors could be regarded as information leak. This patch makes a copy of stderr if necessary and uses a special die routine that is used for all die() calls in the child that sends the errors messages to the parent's stderr. The trace call that reported a failed execvp is removed (because it writes to stderr) and replaced by die_errno() with special treatment of ENOENT. The improvement in the error message can be seen with this sequence: mkdir .git/hooks/pre-commit git commit Previously, the error message was error: cannot run .git/hooks/pre-commit: No such file or directory and now it is fatal: cannot exec '.git/hooks/pre-commit': Permission denied Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/ls-files-ignored-pathspec'Junio C Hamano2010-01-20
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/ls-files-ignored-pathspec: ls-files: fix overeager pathspec optimization read_directory(): further split treat_path() read_directory_recursive(): refactor handling of a single path into a separate function t3001: test ls-files -o ignored/dir
| * | | ls-files: fix overeager pathspec optimizationJunio C Hamano2010-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given pathspecs that share a common prefix, ls-files optimized its call into recursive directory reader by starting at the common prefix directory. If you have a directory "t" with an untracked file "t/junk" in it, but the top-level .gitignore file told us to ignore "t/", this resulted in: $ git ls-files -o --exclude-standard $ git ls-files -o --exclude-standard t/ t/junk $ git ls-files -o --exclude-standard t/junk t/junk $ cd t && git ls-files -o --exclude-standard junk We could argue that you are overriding the ignore file by giving a patchspec that matches or being in that directory, but it is somewhat unexpected. Worse yet, these behave differently: $ git ls-files -o --exclude-standard t/ . $ git ls-files -o --exclude-standard t/ t/junk This patch changes the optimization so that it notices when the common prefix directory that it starts reading from is an ignored one. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | read_directory(): further split treat_path()Junio C Hamano2010-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The next caller I'll be adding won't have an access to struct dirent because it won't be reading from a directory stream. Split the main part of the function further into a separate function to make it usable by a caller without passing a dirent as long as it knows what type is feeding the function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | read_directory_recursive(): refactor handling of a single path into a ↵Junio C Hamano2010-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | separate function Primarily because I want to reuse it in a separate function later, but this de-dents a huge function by one tabstop which by itself is an improvement as well. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | t3001: test ls-files -o ignored/dirJunio C Hamano2010-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have "t" directory that is marked as ignored in the top-level .gitignore file (or $GIT_DIR/info/exclude), running $ git ls-files -o --exclude-standard from the top-level correctly excludes files in "t" directory, but any of the following: $ git ls-files -o --exclude-standard t/ $ cd t && git ls-files -o --exclude-standard would show untracked files in that directory. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jc/grep-lookahead'Junio C Hamano2010-01-20
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/grep-lookahead: grep --no-index: allow use of "git grep" outside a git repository grep: prepare to run outside of a work tree grep: rip out pessimization to use fixmatch() grep: rip out support for external grep grep: optimize built-in grep by skipping lines that do not hit Conflicts: builtin-grep.c t/t7002-grep.sh
| * | | | grep --no-index: allow use of "git grep" outside a git repositoryJunio C Hamano2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just like some people wanted diff features that are not found in other people's diff implementations outside of a git repository and added --no-index mode to the command, this adds --no-index mode to the "git grep" command. Also, inside a git repository, --no-index mode allows you to grep in untracked (but not ignored) files. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | grep: prepare to run outside of a work treeJunio C Hamano2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the call to setup_git_directory() for running "grep" from the "git" wrapper to the implementation of the "grep" subcommand. A new variable "use_index" is always true at this stage in the series, and when it is on, we require that we are in a directory that is under git control. To make sure we die the same way, we make a second call into setup_git_directory() when we detect this situation. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | grep: rip out pessimization to use fixmatch()Junio C Hamano2010-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even when running without the -F (--fixed-strings) option, we checked the pattern and used fixmatch() codepath when it does not contain any regex magic. Finding fixed strings with strstr() surely must be faster than running the regular expression crud. Not so. It turns out that on some libc implementations, using the regcomp()/regexec() pair is a lot faster than running strstr() and strcasestr() the fixmatch() codepath uses. Drop the optimization and use the fixmatch() codepath only when the user explicitly asked for it with the -F option. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | grep: rip out support for external grepJunio C Hamano2010-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We still allow people to pass --[no-]ext-grep on the command line, but the option is ignored. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | Merge branch 'jc/maint-1.6.4-grep-lookahead' into jc/maint-grep-lookaheadJunio C Hamano2010-01-12
| |\ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/maint-1.6.4-grep-lookahead: grep: optimize built-in grep by skipping lines that do not hit This needs to be an evil merge as fixmatch() changed signature since 5183bf6 (grep: Allow case insensitive search of fixed-strings, 2009-11-06). Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | * | | grep: optimize built-in grep by skipping lines that do not hitJunio C Hamano2010-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal "grep" engine we use checks for hits line-by-line, instead of letting the underlying regexec()/fixmatch() routines scan for the first match from the rest of the buffer. This was a major source of overhead compared to the external grep. Introduce a "look-ahead" mechanism to find the next line that would potentially match by using regexec()/fixmatch() in the remainder of the text to skip unmatching lines, and use it when the query criteria is simple enough (i.e. punt for an advanced grep boolean expression like "lines that have both X and Y but not Z" for now) and we are not running under "-v" (aka "--invert-match") option. Note that "-L" (aka "--files-without-match") is not a reason to disable this optimization. Under the option, we are interested if the file has any hit at all, and that is what we determine reliably with or without the optimization. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jc/maint-strbuf-add-fix-doubling'Junio C Hamano2010-01-20
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jc/maint-strbuf-add-fix-doubling: strbuf_addbuf(): allow passing the same buf to dst and src
| * | | | | strbuf_addbuf(): allow passing the same buf to dst and srcJunio C Hamano2010-01-13
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If sb and sb2 are the same (i.e. doubling the string), the underlying strbuf_add() can make sb2->buf invalid by calling strbuf_grow(sb) at the beginning; if realloc(3) done by strbuf_grow() needs to move the string, strbuf_add() will read from an already freed buffer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'mm/conflict-advice'Junio C Hamano2010-01-20
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mm/conflict-advice: Be more user-friendly when refusing to do something because of conflict. Conflicts: Documentation/config.txt advice.c advice.h
| * | | | | Be more user-friendly when refusing to do something because of conflict.Matthieu Moy2010-01-12
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various commands refuse to run in the presence of conflicts (commit, merge, pull, cherry-pick/revert). They all used to provide rough, and inconsistant error messages. A new variable advice.resolveconflict is introduced, and allows more verbose messages, pointing the user to the appropriate solution. For commit, the error message used to look like this: $ git commit foo.txt: needs merge foo.txt: unmerged (c34a92682e0394bc0d6f4d4a67a8e2d32395c169) foo.txt: unmerged (3afcd75de8de0bb5076942fcb17446be50451030) foo.txt: unmerged (c9785d77b76dfe4fb038bf927ee518f6ae45ede4) error: Error building trees The "need merge" line is given by refresh_cache. We add the IN_PORCELAIN option to make the output more consistant with the other porcelain commands, and catch the error in return, to stop with a clean error message. The next lines were displayed by a call to cache_tree_update(), which is not reached anymore if we noticed the conflict. The new output looks like: U foo.txt fatal: 'commit' is not possible because you have unmerged files. Please, fix them up in the work tree, and then use 'git add/rm <file>' as appropriate to mark resolution and make a commit, or use 'git commit -a'. Pull is slightly modified to abort immediately if $GIT_DIR/MERGE_HEAD exists instead of waiting for merge to complain. The behavior of merge and the test-case are slightly modified to reflect the usual flow: start with conflicts, fix them, and afterwards get rid of MERGE_HEAD, with different error messages at each stage. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'da/difftool'Junio C Hamano2010-01-20
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * da/difftool: difftool: Update copyright notices to list each year separately difftool: Use eval to expand '--extcmd' expressions difftool: Add '-x' and as an alias for '--extcmd' t7800-difftool.sh: Simplify the --extcmd test git-diff.txt: Link to git-difftool difftool: Allow specifying unconfigured commands with --extcmd difftool--helper: Remove use of the GIT_MERGE_TOOL variable difftool--helper: Update copyright and remove distracting comments git-difftool: Add '--gui' for selecting a GUI tool t7800-difftool: Set a bogus tool for use by tests
| * | | | | difftool: Update copyright notices to list each year separatelyDavid Aguilar2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is http://www.gnu.org/licenses/gpl-howto.html advises. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | difftool: Use eval to expand '--extcmd' expressionsDavid Aguilar2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was not possible to pass quoted commands to '--extcmd'. By using 'eval' we ensure that expressions with spaces and quotes are supported. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | difftool: Add '-x' and as an alias for '--extcmd'David Aguilar2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds '-x' as a shorthand for the '--extcmd' option. Arguments to '--extcmd' can be specified separately, which was not originally possible. This also fixes the brief help text so that it mentions both '-x' and '--extcmd'. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t7800-difftool.sh: Simplify the --extcmd testDavid Aguilar2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of running 'grep', 'echo', and 'wc' we simply compare git-difftool's output against a known good value. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | git-diff.txt: Link to git-difftoolDavid Aguilar2010-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | difftool: Allow specifying unconfigured commands with --extcmdDavid Aguilar2010-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-difftool requires difftool.<tool>.cmd configuration even when tools use the standard "$diffcmd $from $to" form. This teaches git-difftool to run these tools in lieu of configuration by allowing the command to be specified on the command line. Reference: http://article.gmane.org/gmane.comp.version-control.git/133377 Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | difftool--helper: Remove use of the GIT_MERGE_TOOL variableDavid Aguilar2010-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An undocumented mis-feature in git-difftool is that it allows you to specify a default difftool by setting GIT_MERGE_TOOL. This behavior was never documented and was included as an oversight back when git-difftool was maintained outside of git. git-mergetool never honored GIT_MERGE_TOOL so neither should git-difftool. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | difftool--helper: Update copyright and remove distracting commentsDavid Aguilar2010-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the comments in git-difftool--helper are not needed because the code is sufficiently readable without them. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | git-difftool: Add '--gui' for selecting a GUI toolDavid Aguilar2010-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users might prefer to have git-difftool use a different tool when run from a Git GUI. This teaches git-difftool to honor 'diff.guitool' when the '--gui' option is specified. This allows users to configure their preferred command-line diff tool in 'diff.tool' and a GUI diff tool in 'diff.guitool'. Reference: http://article.gmane.org/gmane.comp.version-control.git/133386 Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t7800-difftool: Set a bogus tool for use by testsDavid Aguilar2010-01-03
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a difftool test has an error then running the git test suite may end up invoking a GUI diff tool. We now guard against this by setting a difftool.bogus-tool.cmd variable. The tests already used --tool=bogus-tool in various places so this is simply ensuring that nothing ever falls back and finds a real diff tool. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'mh/rebase-fixup'Junio C Hamano2010-01-20
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mh/rebase-fixup: rebase -i: Retain user-edited commit messages after squash/fixup conflicts t3404: Set up more of the test repo in the "setup" step rebase -i: For fixup commands without squashes, do not start editor rebase -i: Change function make_squash_message into update_squash_message rebase -i: Extract function do_with_author rebase -i: Handle the author script all in one place in do_next rebase -i: Extract a function "commit_message" rebase -i: Simplify commit counting for generated commit messages rebase -i: Improve consistency of commit count in generated commit messages t3404: Test the commit count in commit messages generated by "rebase -i" rebase -i: Introduce a constant AMEND rebase -i: Introduce a constant AUTHOR_SCRIPT rebase -i: Document how temporary files are used rebase -i: Use symbolic constant $MSG consistently rebase -i: Use "test -n" instead of "test ! -z" rebase -i: Inline expression rebase -i: Remove dead code rebase -i: Make the condition for an "if" more transparent
| * | | | | rebase -i: Retain user-edited commit messages after squash/fixup conflictsMichael Haggerty2010-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a squash/fixup fails due to a conflict, the user is required to edit the commit message. Previously, if further squash/fixup commands followed the conflicting squash/fixup, this user-edited message was discarded and a new automatically-generated commit message was suggested. Change the handling of conflicts within squash/fixup command series: Whenever the user is required to intervene, consider the resulting commit to be a new basis for the following squash/fixups and use its commit message in later suggested combined commit messages. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t3404: Set up more of the test repo in the "setup" stepMichael Haggerty2010-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...and reuse these pre-created branches in tests rather than creating duplicates. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | rebase -i: For fixup commands without squashes, do not start editorMichael Haggerty2010-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the "rebase -i" commands include a series of fixup commands without any squash commands, then commit the combined commit using the commit message of the corresponding "pick" without starting up the commit-message editor. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | rebase -i: Change function make_squash_message into update_squash_messageMichael Haggerty2010-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alter the file $SQUASH_MSG in place rather than outputting the new message then juggling it around. Change the function name accordingly. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>