aboutsummaryrefslogtreecommitdiff
path: root/git-am.sh
Commit message (Collapse)AuthorAge
* Merge branch 'maint'Junio C Hamano2011-08-16
|\ | | | | | | | | | | | | | | | | | | * maint: Prepare for 1.7.6.1 am: refresh the index at start and --resolved Conflicts: GIT-VERSION-GEN RelNotes
| * am: refresh the index at start and --resolvedJeff King2011-08-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a file is unchanged but stat-dirty, we may erroneously fail to apply patches, thinking that they conflict with a dirty working tree. This patch adds a call to "update-index --refresh". It comes as late as possible, so that we don't bother with it for thinks like "git rebase --abort", or when mbox-splitting fails. However, it does come before we actually start applying patches, meaning we will only call it once when we start applying patches (or any time we return to "am" after having resolved conflicts), and not once per patch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am printf(1) message to eval_gettextÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | | | Convert a message that used printf(1) format to use eval_gettext. It's easier for translators to handle the latter, since the eval format automatically gives them context via variable names. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am core say messagesÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | | | | | | | Make the core git-am messages that use say() translatable. These are visible on almost every git am invocation. There are tests that depend on the "Applying" output that need to be changed to use the test_i18* functions along with this translation. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am "Falling back" say messageÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | Make the "Falling back to patching base and 3-way merge..." message used by fall_back_3way() translatable. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am "Apply?" messageÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | | | | | | | Make the "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all" message translatable, and leave a note in a TRANSLATORS comment explaining that translators have to preserve a mention of the y/n/e/v/a characters since the program will expect them, and not their localized equivalents. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am clean_abort messagesÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | | | Messages that used the clean_abort function needed both gettext(1) and eval_gettext(). These need to be interpolated in a string like the die and cannot_fallback messages. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am cannot_fallback messagesÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | Translate messages with gettext(1) before they're passed to the cannot_fallback function, just like we handle the die function. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am die messagesÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | The die messages in git-am need to use: die "$(gettext "string")" Since gettext(1) emits the message instead of returning it like the C equivalent, and our die() function in git-sh-setup needs to get a string as an argument. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am gettext + gettext to stderr messageÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am eval_gettext messagesÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | | | Messages that use variables to be interpolated need to use eval_gettext(), this wrapper will eval the message and expand the variable for us. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am multi-line getttext $msg; echoÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | | | When we have multi-line `gettext $msg; echo' messages we can't preserve the existing indenting because gettext(1) can't accept input on stdin. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am one-line gettext $msg; echoÆvar Arnfjörð Bjarmason2011-05-21
| | | | | | | | | | | | | | | | One-line `gettext $msg; echo' messages are the simplest use case for gettext(1). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | i18n: git-am add git-sh-i18nÆvar Arnfjörð Bjarmason2011-05-21
|/ | | | | | | | Source git-sh-i18n in git-am.sh, it's needed to import the Git gettext shell functions. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jc/maint-rebase-rewrite-last-skip'Junio C Hamano2010-12-28
|\ | | | | | | | | * jc/maint-rebase-rewrite-last-skip: rebase --skip: correctly wrap-up when skipping the last patch
| * rebase --skip: correctly wrap-up when skipping the last patchJunio C Hamano2010-12-22
| | | | | | | | | | | | | | | | When "rebase --skip" is used to skip the last patch in the series, the code to wrap up the rewrite by copying the notes from old to new commits and also by running the post-rewrite hook was bypassed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jc/maint-am-abort-safely'Junio C Hamano2010-12-22
|\ \ | | | | | | | | | | | | * jc/maint-am-abort-safely: am --abort: keep unrelated commits since the last failure and warn
| * | am --abort: keep unrelated commits since the last failure and warnJunio C Hamano2010-12-21
| |/ | | | | | | | | | | | | | | | | | | | | After making commits (either by pulling or doing their own work) after a failed "am", the user will be reminded by next "am" invocation that there was a failed "am" that the user needs to decide to resolve or to get rid of the old "am" attempt. The "am --abort" option was meant to help the latter. However, it rewinded the HEAD back to the beginning of the failed "am" attempt, discarding commits made (perhaps by mistake) since. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Sync with 1.7.3.2Junio C Hamano2010-10-21
|\ \ | |/ | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Merge branch 'sn/doc-opt-notation' into maintJunio C Hamano2010-10-21
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | * sn/doc-opt-notation: Fix {update,checkout}-index usage strings Put a space between `<' and argument in pack-objects usage string Remove stray quotes in --pretty and --format documentation Use parentheses and `...' where appropriate Fix odd markup in --diff-filter documentation Use angles for placeholders consistently
| | * Use parentheses and `...' where appropriateŠtěpán Němec2010-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove some stray usage of other bracket types and asterisks for the same purpose. Signed-off-by: Štěpán Němec <stepnem@gmail.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint'Junio C Hamano2010-10-13
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: Better advice on using topic branches for kernel development Documentation: update implicit "--no-index" behavior in "git diff" Documentation: expand 'git diff' SEE ALSO section Documentation: diff can compare blobs Documentation: gitrevisions is in section 7 shell portability: no "export VAR=VAL" CodingGuidelines: reword parameter expansion section Documentation: update-index: -z applies also to --index-info Documentation: No argument of ALLOC_GROW should have side-effects
| * | shell portability: no "export VAR=VAL"Junio C Hamano2010-10-13
| |/ | | | | | | | | | | | | | | It is more portable to say "VAR=VAL && export VAR" instead. Noticed by Ævar. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-am: fix detection of absolute paths for windowsPat Thoyts2010-10-03
|/ | | | | | | | | | | Add an is_absolute_path function to abstract out platform differences in checking for an absolute or relative path. Specifically fixes t4150-am on Windows. [PT: updated following suggestion from j6t to support \* and //*] Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
* Merge branch 'js/maint-am-rebase-invalid-author'Junio C Hamano2010-06-27
|\ | | | | | | | | * js/maint-am-rebase-invalid-author: am: use get_author_ident_from_commit instead of mailinfo when rebasing
| * am: use get_author_ident_from_commit instead of mailinfo when rebasingJay Soffian2010-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In certain situations, commit authorship can consist of an invalid e-mail address. For example, this is the case when working with git svn repos where the author email has had the svn repo UUID appended such as: author@example.com <author@example.com@deadbeef-dead-beef-dead-beefdeadbeef> Given such an address, mailinfo extracts the authorship incorrectly as it assumes a valid domain. However, when rebasing the original authorship should be preserved irrespective of its validity as an email address. Using get_author_ident_from_commit instead of mailinfo when rebasing preserves the original authorship. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rr/am-help'Junio C Hamano2010-06-18
|\ \ | | | | | | | | | | | | | | | | | | * rr/am-help: git am: Remove stray error message from sed git am: Display some help text when patch is empty git am: Set cmdline globally
| * | git am: Remove stray error message from sedRamkumar Ramachandra2010-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When --continue is invoked without any changes, the following stray error message appears- sed: can't read $dotest/final-commit: No such file or directory. Remove this by making sure that the file actually exists. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git am: Display some help text when patch is emptyRamkumar Ramachandra2010-06-02
| | | | | | | | | | | | | | | | | | | | | | | | When a patch is found to be empty, prompt the user to use either --skip or --abort. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git am: Set cmdline globallyRamkumar Ramachandra2010-06-02
| | | | | | | | | | | | | | | | | | | | | | | | Set the $cmdline variable globally, and not in stop_here_user_resolve so it can be used in other code fragments as well. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | git-am: suggest what to do with superfluous patchesJan Krüger2010-05-31
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Particularly in the context of rebase, conflicts frequently occur because the change in the patch to be applied was made obsolete by new upstream commits. In this case, solving the conflict effectively means skipping the patch. However, it's not always readily apparent that the patch needs to be skipped, and when people solve the conflict and try git rebase --continue, they get confronted with a message of No changes - did you forget to use 'git add'? That's not very helpful if you did actually stage your changes and they happen to turn the patch into a no-op. This extends the message to point out what's going on. Signed-off-by: Jan Krüger <jk@jk.gs> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jc/am-3-show-corrupted-patch'Junio C Hamano2010-05-21
|\ \ | |/ |/| | | | | * jc/am-3-show-corrupted-patch: am -3: recover the diagnostic messages for corrupt patches
| * am -3: recover the diagnostic messages for corrupt patchesJunio C Hamano2010-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git am -3" first tries to apply the patch without any extra trick, and applies it to a synthesized tree for 3-way merge after the first attempt fails. "git apply" exits with status 1 for a patch that is well-formed but is not applicable (and it dies on other errors with non-zereo, non-1 status) and has an optimization to fall back to the 3-way merge only in the case. An earlier patch 3ddd170 (am: suppress apply errors when using 3-way, 2009-06-16) squelched diagnostic messages from the first attempt, not to be shown to the end user. This worked reasonably well if the reason the first application failed was because the patch was made against a wrong version. When the patch is corrupt (e.g. line-wrapped or leading whitespaces got dropped), however, because the second patch application is not even attempted, the error message from the first application is never shown and is forever lost. This message is necessary to locate where the patch is corrupt and fix it up. We could fix this issue by reverting 3dd170, or keeping the error message to somewhere and showing it, but because this is an error codepath, the easiest is to disable the optimization. The second patch application is attempted even when the input is corrupt, and it will notice, diagnose, and stop with an error message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'tr/notes-display'Junio C Hamano2010-03-24
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tr/notes-display: git-notes(1): add a section about the meaning of history notes: track whether notes_trees were changed at all notes: add shorthand --ref to override GIT_NOTES_REF commit --amend: copy notes to the new commit rebase: support automatic notes copying notes: implement helpers needed for note copying during rewrite notes: implement 'git notes copy --stdin' rebase -i: invoke post-rewrite hook rebase: invoke post-rewrite hook commit --amend: invoke post-rewrite hook Documentation: document post-rewrite hook Support showing notes from more than one notes tree test-lib: unset GIT_NOTES_REF to stop it from influencing tests Conflicts: git-am.sh refs.c
| * | rebase: support automatic notes copyingThomas Rast2010-03-12
| | | | | | | | | | | | | | | | | | | | | Luckily, all the support already happens to be there. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | rebase: invoke post-rewrite hookThomas Rast2010-03-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to deal with two separate code paths: a normal rebase, which actually goes through git-am; and rebase {-m|-s}. The only small issue with both is that they need to remember the original sha1 across a possible conflict resolution. rebase -m already puts this information in $dotest/current, and we just introduce a similar file for git-am. Note that in git-am, the hook really only runs when coming from git-rebase: the code path that sets the $dotest/original-commit file is guarded by a test for $dotest/rebasing. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'sh/am-keep-cr'Junio C Hamano2010-03-10
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sh/am-keep-cr: git-am: Add tests for `--keep-cr`, `--no-keep-cr` and `am.keepcr` git-am: Add am.keepcr and --no-keep-cr to override it git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit documentation: 'git-mailsplit --keep-cr' is not hidden anymore
| * | | git-am: Add am.keepcr and --no-keep-cr to override itStefan-W. Hahn2010-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the configuration `am.keepcr` for git-am. It also adds `--no-keep-cr` parameter for git-am to give the possibility to override configuration from command line. Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | git-am: Add command line parameter `--keep-cr` passing it to git-mailsplitStefan-W. Hahn2010-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c2ca1d7 (Allow mailsplit (and hence git-am) to handle mails with CRLF line-endings, 2009-08-04) fixed "git mailsplit" to help people with MUA whose output from save-as command uses CRLF as line terminators by stripping CR at the end of lines. However, when you know you are feeding output from "git format-patch" directly to "git am", and especially when your contents have CR at the end of line, such stripping is undesirable. To help such a use case, teach --keep-cr option to "git am" and pass that to "git mailinfo". Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jn/maint-fix-pager'Junio C Hamano2010-03-02
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jn/maint-fix-pager: tests: Fix race condition in t7006-pager t7006-pager: if stdout is not a terminal, make a new one tests: Add tests for automatic use of pager am: Fix launching of pager git svn: Fix launching of pager git.1: Clarify the behavior of the --paginate option Make 'git var GIT_PAGER' always print the configured pager Fix 'git var' usage synopsis
| * | | am: Fix launching of pagerJonathan Nieder2010-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pagination functionality in git am has some problems: - It does not check if stdout is a tty, so it always paginates. - If $GIT_PAGER uses any environment variables, they are being ignored, since it does not run $GIT_PAGER through eval. - If $GIT_PAGER is set to the empty string, instead of passing output through to stdout, it tries to run $dotest/patch. Fix them. While at it, move the definition of git_pager() to git-sh-setup so authors of other commands are not tempted to reimplement it with the same mistakes. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | am: remove rebase-apply directory before gcJonathan Nieder2010-02-23
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When git am does an automatic gc it doesn't clean up the rebase-apply directory until after this has finished. This means that if the user aborts the gc then future am or rebase operations will report that an existing operation is in progress, which is undesirable and confusing. Reported by Mark Brown <broonie@debian.org> through http://bugs.debian.org/570966 Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | am: switch --resolved to --continueJeff King2010-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rebase calls this same function "--continue", which means users may be trained to type it. There is no reason to deprecate --resolved (or -r), so we will keep it as a synonym. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | am: fix patch format detection for Thunderbird "Save As" emailsStephen Boyd2010-01-25
|/ / | | | | | | | | | | | | | | | | | | | | | | The patch detection wants to inspect all the headers of a rfc2822 message and ensure that they look like header fields. The headers are always separated from the message body with a blank line. When Thunderbird saves the message the blank line separating the headers from the body includes a CR. The patch detection is failing because a CRLF doesn't match /^$/. Fix this by allowing a CR to exist on the separating line. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Teach --[no-]rerere-autoupdate option to merge, revert and friendsJunio C Hamano2009-12-04
| | | | | | | | | | | | | | Introduce a command line option to override rerere.autoupdate configuration variable to make it more useful. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jc/maint-am-keep'Junio C Hamano2009-11-30
|\ \
| * | Remove dead code from "git am"Junio C Hamano2009-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ever since the initial implementation, "git am" had kept a dead code that never triggered due to a typo in the variable name. Worse yet, the code, if it weren't for the typo, would have attempted to add "[PATCH] " at the beginning of the Subject: header when "git am" is run with its "-k" option. However, because "git am -k" tells mailinfo to keep such prefix when parsing the input, the "[PATCH] " added by this dead code would have really been unnecessary duplicate. Embarrassing is that we kept _maintaining_ the codepath without anybody noticing for four years. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'rs/work-around-grep-opt-insanity'Junio C Hamano2009-11-25
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rs/work-around-grep-opt-insanity: Protect scripted Porcelains from GREP_OPTIONS insanity mergetool--lib: simplify guess_merge_tool() Conflicts: git-instaweb.sh
| * | | Protect scripted Porcelains from GREP_OPTIONS insanityJunio C Hamano2009-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user has exported the GREP_OPTIONS environment variable, the output from "grep" and "egrep" in scripted Porcelains may be different from what they expect. For example, we may want to count number of matching lines, by "grep" piped to "wc -l", and GREP_OPTIONS=-C3 will break such use. The approach taken by this change to address this issue is to protect only our own use of grep/egrep. Because we do not unset it at the beginning of our scripts, hook scripts run from the scripted Porcelains are exposed to the same insanity this environment variable causes when grep/egrep is used to implement logic (e.g. "grep | wc -l"), and it is entirely up to the hook scripts to protect themselves. On the other hand, applypatch-msg hook may want to show offending words in the proposed commit log message using grep to the end user, and the user might want to set GREP_OPTIONS=--color to paint the match more visibly. The approach to protect only our own use without unsetting the environment variable globally will allow this use case. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'ls/maint-mailinfo-no-inbody'Junio C Hamano2009-11-22
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * ls/maint-mailinfo-no-inbody: git am/mailinfo: Don't look at in-body headers when rebasing