summaryrefslogtreecommitdiff
path: root/git-am.sh
AgeCommit message (Collapse)Author
2007-01-10-u is now default for 'git-mailinfo'.Junio C Hamano
Originally from David Woodhouse, but also adjusts the callers of mailinfo to the new default. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-10git-am: should work when "--no-utf8 --utf8" is givenJunio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-08--utf8 is now default for 'git-am'Junio C Hamano
Since we are talking about allowing potentially incompatible UI changes in v1.5.0 iff the change improves the general situation, I would say why not. There is --no-utf8 flag to avoid re-coding from botching the log message just in case, but we may not even need it. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-29Use merge-recursive in git-am -3.Shawn O. Pearce
By switching from merge-resolve to merge-recursive in the 3-way fallback behavior of git-am we gain a few benefits: * renames are automatically handled, like in rebase -m; * conflict hunks can reference the patch name; * its faster on Cygwin (less forks). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28Use GIT_REFLOG_ACTION environment variable instead.Shawn O. Pearce
Junio rightly pointed out that the --reflog-action parameter was starting to get out of control, as most porcelain code needed to hand it to other porcelain and plumbing alike to ensure the reflog contained the top-level user action and not the lower-level actions it invoked. At Junio's suggestion we are introducing the new set_reflog_action function to all shell scripts, allowing them to declare early on what their default reflog name should be, but this setting only takes effect if the caller has not already set the GIT_REFLOG_ACTION environment variable. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22Suggest 'add' in am/revert/cherry-pick.Shawn O. Pearce
Now that we have decided to make 'add' behave like 'update-index' (and therefore fully classify update-index as strictly plumbing) the am/revert/cherry-pick family of commands should not steer the user towards update-index. Instead send them to the command they probably already know, 'add'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-09rerere: record (or avoid misrecording) resolved, skipped or aborted rebase/amEric Wong
Data in rr-cache isn't valid after a patch application is skipped or and aborted, so our next commit could be misrecorded as a resolution of that skipped/failed commit, which is wrong. git-am --skip, git-rebase --skip/--abort will automatically invoke git-rerere clear to avoid this. Also, since git-am --resolved indicates a resolution was succesful, remember to run git-rerere to record the resolution (and not surprise the user when the next commit is made). Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-16Fix git-am safety checksJunio C Hamano
An earlier commit cbd64af added a check that prevents "git-am" to run without its standard input connected to a terminal while resuming operation. This was to catch a user error to try feeding a new patch from its standard input while recovery. The assumption of the check was that it is an indication that a new patch is being fed if the standard input is not connected to a terminal. It is however not quite correct (the standard input can be /dev/null if the user knows the operation does not need any input, for example). This broke t3403 when the test was run with its standard input connected to /dev/null. When git-am is given an explicit command such as --skip, there is no reason to insist that the standard input is a terminal; we are not going to read a new patch anyway. Credit goes to Gerrit Pape for noticing and reporting the problem with t3403-rebase-skip test. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-13git-am: give better diagnostics when the patch does not apply during --3wayJunio C Hamano
If the user tries to apply a patch that was hand-edited in such a way that it does not apply to the original file recorded on its "index" line anymore, we did detect the situation but did not issue an error message that is specific enough. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-24git-am: Don't accept an mbox on stdin of we already have a .dotest directoryLukas Sandström
It makes no sense to accept an mbox via stdin when we won't accept it on the commandline. The patch helps the following scenario: # git init-db "add file1 with content" # git checkout -b apply "edit file1 && commit" # git checkout -b conflict master "edit file1 && commit" # git checkout -b ok master "add file2" # git checkout apply # git format-patch -k -3 master..conflict | git am -k -3 => git-am fails with a conflict message # git reset --hard # git format-patch -k -3 master..ok | git am -k -3 => git am fails with the same conflict message as above, => since it's trying to apply the old .dotest directory With the patch it complains about an old .dotest directory instead. Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-14Record rebase changes as 'rebase' in the reflog.Shawn Pearce
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-10Fix more typos, primarily in the codePavel Roskin
The only visible change is that git-blame doesn't understand "--compability" anymore, but it does accept "--compatibility" instead, which is already documented. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-27Fix expr usage for FreeBSDDennis Stosberg
Some implementations of "expr" (e.g. FreeBSD's) fail, if an argument starts with a dash. Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23Merge branch 'sp/reflog' into nextJunio C Hamano
* sp/reflog: Enable ref log creation in git checkout -b. Create/delete branch ref logs. Include ref log detail in commit, reset, etc. Change order of -m option to update-ref. Correct force_write bug in refs.c Change 'master@noon' syntax to 'master@{noon}'. Log ref updates made by fetch. Force writing ref if it doesn't exist. Added logs/ directory to repository layout. General ref log reading improvements. Fix ref log parsing so it works properly. Support 'master@2 hours ago' syntax Log ref updates to logs/refs/<ref> Convert update-ref to use ref_lock API. Improve abstraction of ref lock/write.
2006-05-19Include ref log detail in commit, reset, etc.Shawn Pearce
When updating a ref at the direction of the user include a reason why head was changed as part of the ref log (assuming it was enabled). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-16Merge branch 'jc/apply' into nextJunio C Hamano
* jc/apply: git-am: use apply --cached apply --cached: apply a patch without using working tree.
2006-05-16git-am: use apply --cachedJunio C Hamano
Now 'git apply' can apply patch without working tree, preparation of pristine preimage and postimage trees that are done when falling back on 3-way merge by "git am" can do so without temporary files. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14Make git rebase interactive help match documentation.Sean
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-02Give the user a hint for how to continue in the case that git-am fails ↵Robert Shearman
because it requires user intervention Give the user a hint for how to continue in the case that git-am fails because it requires user intervention. Signed-off-by: Robert Shearman <rob@codeweaves.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-28git-am --resolved: more usable error message.Junio C Hamano
After doing the hard work of hand resolving the conflicts in the working tree, if the user forgets to run update-index to mark the paths that have been resolved, the command gave an unfriendly "fatal: git-write-tree: not able to write tree" error message. Catch the situation early and give more meaningful message and suggestion. Noticed and suggested by Len Brown. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02war on whitespaces: documentation.Junio C Hamano
We were missing the --whitespace option in the usage string for git-apply and git-am, so this commit adds them. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01git-am: --whitespace=x option.Junio C Hamano
This is passed down to git-apply to override the built-in default and per-repository configuration at runtime. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24git-am: do not allow empty commits by mistake.Junio C Hamano
Running "git-am --resolved" without doing anything can create an empty commit. Prevent it. Thanks for Eric W. Biederman for spotting this. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-22Keep Porcelainish from failing by broken ident after making changes.Junio C Hamano
"empty ident not allowed" error makes commit-tree fail, so we are already safer in that we would not end up with commit objects that have bogus names on the author or committer fields. However, before commit-tree is called there are already changes made to the index file and the working tree. The operation can be resumed after fixing the environment problem, but when this triggers to a newcomer with unusable gecos, the first question becomes "what did I lose and how would I recover". This patch modifies some Porcelainish commands to verify GIT_COMMITTER_IDENT as soon as we know we are going to make some commits before doing much damage to prevent confusion. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-12Only call git-rerere if $GIT_DIR/rr-cache exists.Junio C Hamano
Johannes noticed that git-rerere depends on Digest.pm, and if one does not use the command, one can live without it. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-07git-rerere: reuse recorded resolve.Junio C Hamano
In a workflow that employs relatively long lived topic branches, the developer sometimes needs to resolve the same conflict over and over again until the topic branches are done (either merged to the "release" branch, or sent out and accepted upstream). This commit introduces a new command, "git rerere", to help this process by recording the conflicted automerge results and corresponding hand-resolve results on the initial manual merge, and later by noticing the same conflicted automerge and applying the previously recorded hand resolution using three-way merge. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-17Fix git-am --skipJan Harkes
git-am --skip does not unpack the next patch and ends up reapplying the old patch, believing that it is the new patch in the sequence. If the old patch applied successfully it will commit it with the supposedly skipped log message and ends up dropping the following patch. If the patch did not apply the user is left with the conflict he tried to skip and has to unpack the next patch in the sequence by hand to get git-am back on track. By clearing the resume variable whenever skips bumps the sequence counter we correctly unpack the next patch. I also added another resume= in the case a patch file is missing from the sequence to avoid the same problem when a file in the sequence was removed. Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-15mailinfo and git-am: allow "John Doe <johndoe>"Junio C Hamano
An isolated developer could have a local-only e-mail, which will be stripped out by mailinfo because it lacks '@'. Define a fallback parser to accomodate that. At the same time, reject authorless patch in git-am. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14Merge branch 'hold/am'Junio C Hamano
2005-12-14git-am: Usage string clean-upfreku045@student.liu.se
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14git-am support for naked email messages (take 2)H. Peter Anvin
This allows git-am to accept single-message files as well as mboxes. Unlike the previous version, this one doesn't need to be explicitly told which one it is; rather, it looks to see if the first line is a From line and uses it to select mbox mode or not. I moved the logic to do all this into git-mailsplit, which got a new user interface as result, although the old interface is still available for backwards compatibility. [jc: applied with two obvious fixes.] Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-07Use printf rather than echo -n.Jason Riedy
On AIX, there is no -n option to the system's echo. Instead, it needs the '\c' control character. We could replace echo -n "foo" with echo -e "foo\c" but printf is recommended by most man pages. Tested on AIX 5.3, Solaris 8, and Debian. [jc: futureproofed two instances that uses variable with '%s' so later feeding different messages would not break things too easily; others are emitting literal so whoever changes the literal ought to notice more easily so they are safe.] Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-25git-sh-setup: die if outside git repository.Junio C Hamano
Now all the users of this script detect its exit status and die, complaining that it is outside git repository. So move the code that dies from all callers to git-sh-setup script. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-18git-am: --binary; document --resume and --binary.Junio C Hamano
Now git-apply can grok binary replacement patches, give --binary flag to git-am. As a safety measure, this is not by default enabled, so that you do not let malicious e-mailed patch to replace an arbitrary path with just a couple of lines (diff index lines, the filename and string "Binary files "...) by accident. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-17git-am: --resolved.Junio C Hamano
After failed patch application, you can manually apply the patch (this includes resolving the conflicted merge after git-am falls back to 3-way merge) and run git-update-index on necessary paths to prepare the index file in a shape a successful patch application should have produced. Then re-running git-am --resolved would record the resulting index file along with the commit log information taken from the patch e-mail. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08git-am: do not lose already edited final-commit when resuming.Junio C Hamano
The last round stopped munging the patch when resuming, but failed to preserve final-commit. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-26Add [v]iew patch in git-am interactive.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-26git-am: make it easier after fixing up an unapplicable patch.Junio C Hamano
Instead of having the user to edit the mail message, let the hand merge result stored in .dotest/patch and continue, which is easier to manage. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-21Fix missing exports in git-amJunio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-18Update git-apply to use C-style quoting for funny pathnames.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13git-am: do not fail if 3-way fallback succeeds.Junio C Hamano
The current one incorrectly stops there without committing. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13git-am: interactive should fail gracefully.Junio C Hamano
When feeding patches from standard input, and --interactive is specified, quit, so that the user can re-run the command, instead of infinitely looping. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-07Add git-am, applymbox replacement.Junio C Hamano
It reorganizes the code and also has saner command line options syntax. Unlike git-applymbox, it can take more than one mailbox file from the command line, as well as reading from the standard input when '-' is specified. Signed-off-by: Junio C Hamano <junkio@cox.net>