summaryrefslogtreecommitdiff
path: root/builtin
AgeCommit message (Collapse)Author
2010-08-16cherry-pick/revert: Use advise() for hintsJonathan Nieder
When cherry-pick fails after picking a large series of commits, it can be hard to pick out the error message and advice. Prefix the advice with “hint: ” to help. Before: error: could not apply 7ab78c9... foo After resolving the conflicts, mark the corrected paths with 'git add <paths>' or 'git rm <paths>' and commit the result with: git commit -c 7ab78c9a7898b87127365478431289cb98f8d98f After: error: could not apply 7ab78c9... foo hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' hint: and commit the result with 'git commit -c 7ab78c9' Noticed-by: Thomas Rast <trast@student.ethz.ch> Encouraged-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-16cherry-pick/revert: Use error() for failure messageJonathan Nieder
When cherry-pick fails after picking a large series of commits, it can be hard to pick out the error message and advice. Clarify the error and prefix it with “error: ” to help. Before: Automatic cherry-pick failed. [...advice...] After: error: could not apply 7ab78c9... Do something neat. [...advice...] Noticed-by: Thomas Rast <trast@student.ethz.ch> Encouraged-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-16Introduce advise() to print hintsJonathan Nieder
Like error(), warn(), and die(), advise() prints a short message with a formulaic prefix to stderr. It is local to revert.c for now because I am not sure this is the right API (we may want to take an array of advice lines or a boolean argument for easy suppression of unwanted advice). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-16Eliminate “Finished cherry-pick/revert” messageJonathan Nieder
When cherry-pick was written (v0.99.6~63, 2005-08-27), “git commit” was quiet, and the output from cherry-pick provided useful information about the progress of a rebase. Now next to the output from “git commit”, the cherry-pick notification is so much noise (except for the name of the picked commit). $ git cherry-pick ..topic Finished cherry-pick of 499088b. [detached HEAD 17e1ff2] Move glob module to libdpkg Author: Guillem Jover <guillem@debian.org> 8 files changed, 12 insertions(+), 9 deletions(-) rename {src => lib/dpkg}/glob.c (98%) rename {src => lib/dpkg}/glob.h (93%) Finished cherry-pick of ae947e1. [detached HEAD 058caa3] libdpkg: Add missing symbols to Versions script Author: Guillem Jover <guillem@debian.org> 1 files changed, 2 insertions(+), 0 deletions(-) $ The noise is especially troublesome when sifting through the output of a rebase or multiple cherry-pick that eventually failed. With the commit subject, it is already not hard to figure out where the commit came from. So drop the “Finished” message. Cc: Christian Couder <chriscool@tuxfamily.org> Cc: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-16revert: improve success message by adding abbreviated commit sha1Christian Couder
Instead of saying "Finished one cherry-pick." or "Finished one revert.", we now say "Finished cherry-pick of commit <abbreviated sha1>." or "Finished revert of commit <abbreviated sha1>." which is more informative, especially when cherry-picking or reverting many commits. In case of failure the message is now "Automatic cherry-pick of commit <abbreviated sha1> failed." instead of "Automatic cherry-pick failed." Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-16revert: don't print "Finished one cherry-pick." if commit failedChristian Couder
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-16revert: refactor commit code into a new run_git_commit() functionChristian Couder
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-16revert: report success when using option --strategyChristian Couder
"git cherry-pick foo" has always reported success with "Finished one cherry-pick" but "cherry-pick --strategy" does not print anything. So move the code to write that message from do_recursive_merge() to do_cherry_pick() so other strategies can share it. This patch also refactors the code that prints a message like "Automatic cherry-pick failed. <help message>". This code was duplicated in both do_recursive_merge() and do_pick_commit(). To do that, now do_recursive_merge() returns an int to signal success or failure. And in case of failure we just return 1 from do_pick_commit() instead of doing "exit(1)" from either do_recursive_merge() or do_pick_commit(). Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-15Merge branch 'wp/merge-tree-fix'Junio C Hamano
* wp/merge-tree-fix: merge-tree: fix where two branches share no changes add basic tests for merge-tree
2010-07-15Merge branch 'js/merge-rr-fix'Junio C Hamano
* js/merge-rr-fix: MERGE_RR is in .git, not .git/rr-cache
2010-07-15Merge branch 'jc/diff-merge-base-multi'Junio C Hamano
* jc/diff-merge-base-multi: diff A...B: give one possible diff when there are more than one merge-base
2010-07-15Merge branch 'jn/grep-open'Junio C Hamano
* jn/grep-open: grep -O: Do not pass color sequences as filenames to pager
2010-07-15Merge branch 'jk/maint-status-keep-index-timestamp'Junio C Hamano
* jk/maint-status-keep-index-timestamp: do not write out index when status does not have to
2010-07-14MERGE_RR is in .git, not .git/rr-cacheJay Soffian
0af0ac7 (Move MERGE_RR from .git/rr-cache/ into .git/) moved the location of MERGE_RR but I found a few references to the old location. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14merge-tree: fix where two branches share no changesWill Palmer
15b4f7a (merge-tree: use ll_merge() not xdl_merge(), 2010-01-16) introduced a regression to merge-tree to cause it to segfault when merging files which existed in one branch, but not in the other or in the merge-base. This was caused by referencing entry->path at a time when entry was known to be possibly-NULL. To correct the problem, we save the path of the entry we came in with, as the path should be the same among all the stages no matter which sides are involved in the merge. Signed-off-by: Will Palmer <wmpalmer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09Merge remote branch 'ko/master' into jc/read-tree-cache-tree-fixJunio C Hamano
* ko/master: (2325 commits) Git 1.7.2-rc2 backmerge a few more fixes to 1.7.1.X series fix git branch -m in presence of cross devices t/t0006: specify timezone as EST5 not EST to comply with POSIX add missing && to submodule-merge testcase t/README: document more test helpers test-date: fix sscanf type conversion xdiff: optimise for no whitespace difference when ignoring whitespace. gitweb: Move evaluate_gitweb_config out of run_request parse_date: fix signedness in timezone calculation t0006: test timezone parsing rerere.txt: Document forget subcommand t/README: proposed rewording... t/README: Document the do's and don'ts of tests t/README: Add a section about skipping tests t/README: Document test_expect_code t/README: Document test_external* t/README: Document the prereq functions, and 3-arg test_* t/README: Typo: paralell -> parallel t/README: The trash is in 't/trash directory.$name' ... Conflicts: builtin-read-tree.c
2010-07-07grep -O: Do not pass color sequences as filenames to pagerNazri Ramliy
With a .gitconfig like this: [color] ui = auto [color "grep"] filename = magenta if stdout is a terminal, the grep machinery will output the color sequence \e[36m before each filename in its output. In the case of "git grep -O foo", output is argv for the pager. Disable color when calling the grep machinery in this case. Signed-off-by: Nazri Ramliy <ayiehere@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07Merge branch 'maint'Junio C Hamano
* maint: backmerge a few more fixes to 1.7.1.X series rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option fix git branch -m in presence of cross devices Conflicts: RelNotes builtin/rev-parse.c
2010-07-07Merge branch 'maint-1.6.4' into maintJunio C Hamano
* maint-1.6.4: rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-07Merge branch 'tr/receive-pack-aliased-update-fix' into maintJunio C Hamano
* tr/receive-pack-aliased-update-fix: check_aliased_update: strcpy() instead of strcat() to copy receive-pack: detect aliased updates which can occur with symrefs receive-pack: switch global variable 'commands' to a parameter Conflicts: t/t5516-fetch-push.sh
2010-07-07do not write out index when status does not have toJunio C Hamano
Some codepaths, such as "git status" and "git commit --dry-run", tried to opportunisticly refresh the index and write the result out. But they did so without checking if there was actually any change that needs to be written out. Noticed by Jeff King and Daniel at Rutgers.edu Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-30Merge branch 'ar/decorate-color'Junio C Hamano
* ar/decorate-color: Add test for correct coloring of git log --decoration Allow customizable commit decorations colors log --decorate: Colorize commit decorations log-tree.c: Use struct name_decoration's type for classifying decoration commit.h: add 'type' to struct name_decoration
2010-06-30Merge branch 'cc/cherry-pick-stdin'Junio C Hamano
* cc/cherry-pick-stdin: revert: do not rebuild argv on heap revert: accept arbitrary rev-list options t3508 (cherry-pick): futureproof against unmerged files
2010-06-30Merge branch 'jl/status-ignore-submodules'Junio C Hamano
* jl/status-ignore-submodules: Add the option "--ignore-submodules" to "git status" git submodule: ignore dirty submodules for summary and status Conflicts: builtin/commit.c t/t7508-status.sh wt-status.c wt-status.h
2010-06-30Merge branch 'jn/grep-open'Junio C Hamano
* jn/grep-open: t/t7811-grep-open.sh: remove broken/redundant creation of fake "less" script t/t7811-grep-open.sh: ensure fake "less" is made executable t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression grep -O: allow optional argument specifying the pager (or editor) grep: Add the option '--open-files-in-pager' Unify code paths of threaded greps grep: refactor grep_objects loop into its own function Conflicts: t/t7006-pager.sh
2010-06-30Merge branch 'jp/string-list-api-cleanup'Junio C Hamano
* jp/string-list-api-cleanup: string_list: Fix argument order for string_list_append string_list: Fix argument order for string_list_lookup string_list: Fix argument order for string_list_insert_at_index string_list: Fix argument order for string_list_insert string_list: Fix argument order for for_each_string_list string_list: Fix argument order for print_string_list
2010-06-30Merge branch 'tr/rev-list-count'Junio C Hamano
* tr/rev-list-count: bash completion: Support "divergence from upstream" messages in __git_ps1 rev-list: introduce --count option Conflicts: contrib/completion/git-completion.bash
2010-06-29revert: do not rebuild argv on heapJonathan Nieder
Set options in struct rev_info directly so we can reuse the arguments collected from parse_options without modification. This is just a cleanup; no noticeable change is intended. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-29Merge branch 'maint'Junio C Hamano
* maint: Update draft release notes to 1.7.1.1 notes: Initialise variable to appease gcc notes: check number of parameters to "git notes copy"
2010-06-28notes: check number of parameters to "git notes copy"Jeff King
Otherwise we may segfault with too few parameters. Signed-off-by: Jeff King <peff@peff.net> Tested-by: Bert Wesarg <Bert.Wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27Merge branch 'cp/textconv-cat-file'Junio C Hamano
* cp/textconv-cat-file: git-cat-file.txt: Document --textconv t/t8007: test textconv support for cat-file textconv: support for cat_file sha1_name: add get_sha1_with_context()
2010-06-27Merge branch 'ab/blame-textconv'Junio C Hamano
* ab/blame-textconv: t/t8006: test textconv support for blame textconv: support for blame textconv: make the API public Conflicts: diff.h
2010-06-27Merge branch 'jp/string-list-api-cleanup' into jn/grep-openJulian Phillips
An evil merge to adjust the series to cleaned-up API. From: Julian Phillips <julian@quantumfyre.co.uk> Subject: [PATCH v2 7/7] grep: fix string_list_append calls Date: Sat, 26 Jun 2010 00:41:39 +0100 Message-ID: <20100625234140.18927.35025.julian@quantumfyre.co.uk> * jp/string-list-api-cleanup: string_list: Fix argument order for string_list_append string_list: Fix argument order for string_list_lookup string_list: Fix argument order for string_list_insert_at_index string_list: Fix argument order for string_list_insert string_list: Fix argument order for for_each_string_list string_list: Fix argument order for print_string_list Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27string_list: Fix argument order for string_list_appendJulian Phillips
Update the definition and callers of string_list_append to use the string_list as the first argument. This helps make the string_list API easier to use by being more consistent. Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27string_list: Fix argument order for string_list_lookupJulian Phillips
Update the definition and callers of string_list_lookup to use the string_list as the first argument. This helps make the string_list API easier to use by being more consistent. Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27string_list: Fix argument order for string_list_insertJulian Phillips
Update the definition and callers of string_list_insert to use the string_list as the first argument. This helps make the string_list API easier to use by being more consistent. Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27string_list: Fix argument order for for_each_string_listJulian Phillips
Update the definition and callers of for_each_string_list to use the string_list as the first argument. This helps make the string_list API easier to use by being more consistent. Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-25Merge branch 'maint'Junio C Hamano
* maint: msvc: Fix some compiler warnings Documentation: grep: fix asciidoc problem with -- msvc: Fix some "expr evaluates to function" compiler warnings
2010-06-25Add the option "--ignore-submodules" to "git status"Jens Lehmann
In some use cases it is not desirable that "git status" considers submodules that only contain untracked content as dirty. This may happen e.g. when the submodule is not under the developers control and not all build generated files have been added to .gitignore by the upstream developers. Using the "untracked" parameter for the "--ignore-submodules" option disables checking for untracked content and lets git diff report them as changed only when they have new commits or modified content. Sometimes it is not wanted to have submodules show up as changed when they just contain changes to their work tree (this was the behavior before 1.7.0). An example for that are scripts which just want to check for submodule commits while ignoring any changes to the work tree. Also users having large submodules known not to change might want to use this option, as the - sometimes substantial - time it takes to scan the submodule work tree(s) is saved when using the "dirty" parameter. And if you want to ignore any changes to submodules, you can now do that by using this option without parameters or with "all" (when the config option status.submodulesummary is set, using "all" will also suppress the output of the submodule summary). A new function handle_ignore_submodules_arg() is introduced to parse this option new to "git status" in a single location, as "git diff" already knew it. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-25revert: accept arbitrary rev-list optionsChristian Couder
This can be useful to do something like: git rev-list --reverse master -- README | git cherry-pick -n --stdin without using xargs. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-24Allow customizable commit decorations colorsNazri Ramliy
Signed-off-by: Nazri Ramliy <ayiehere@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-24msvc: Fix some "expr evaluates to function" compiler warningsRamsay Jones
In particular, the following warning is issued while compiling notes.c: notes.c(927) : warning C4550: expression evaluates to a \ function which is missing an argument list along with identical warnings on lines 928, 1016 and 1017. In order to suppress the warning, we change the definition of combine_notes_fn, so that the symbol type is an (explicit) "pointer to function ...". As a result, several other declarations need some minor fix-up to take account of the new typedef. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-22Merge branch 'sb/format-patch-signature'Junio C Hamano
* sb/format-patch-signature: completion: Add --signature and format.signature format-patch: Add a signature option (--signature)
2010-06-22Merge branch 'cc/cherry-pick-series'Junio C Hamano
* cc/cherry-pick-series: Documentation/revert: describe passing more than one commit Documentation/cherry-pick: describe passing more than one commit revert: add tests to check cherry-picking many commits revert: allow cherry-picking more than one commit revert: change help_msg() to take no argument revert: refactor code into a do_pick_commit() function revert: use run_command_v_opt() instead of execv_git_cmd() revert: cleanup code for -x option
2010-06-22Merge branch 'cc/maint-commit-reflog-msg' into maintJunio C Hamano
* cc/maint-commit-reflog-msg: commit: use value of GIT_REFLOG_ACTION env variable as reflog message
2010-06-22Merge branch 'jk/maint-advice-empty-amend' into maintJunio C Hamano
* jk/maint-advice-empty-amend: commit: give advice on empty amend
2010-06-22Merge branch 'tc/commit-abbrev-fix' into maintJunio C Hamano
* tc/commit-abbrev-fix: commit::print_summary(): don't use format_commit_message() t7502-commit: add summary output tests for empty and merge commits t7502-commit: add tests for summary output
2010-06-22Merge branch 'cb/ls-files-cdup' into maintJunio C Hamano
* cb/ls-files-cdup: ls-files: allow relative pathspec quote.c: separate quoting and relative path generation
2010-06-22Merge branch 'tc/merge-m-log' into maintJunio C Hamano
* tc/merge-m-log: merge: --log appends shortlog to message if specified fmt-merge-msg: add function to append shortlog only fmt-merge-msg: refactor merge title formatting fmt-merge-msg: minor refactor of fmt_merge_msg() merge: rename variable merge: update comment t7604-merge-custom-message: show that --log doesn't append to -m t7604-merge-custom-message: shift expected output creation
2010-06-22Merge branch 'ph/clone-message-reword' into maintJunio C Hamano
* ph/clone-message-reword: clone: reword messages to match the end-user perception