path: root/
AgeCommit message (Collapse)Author
2007-03-04Make git-revert & git-cherry-pick a builtinJohannes Schindelin
Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
2007-02-03honor GIT_REFLOG_ACTION in git-commitJunio C Hamano
This allows git-cherry-pick and git-revert to properly identify themselves in the resulting reflog entries. Earlier they were recorded as what git-commit has done. Signed-off-by: Junio C Hamano <>
2007-01-29[PATCH] Rename git-repo-config to git-config.Tom Prince
Signed-off-by: Tom Prince <> Signed-off-by: Junio C Hamano <>
2007-01-15Use nice names in conflict markers during cherry-pick/revert.Shawn O. Pearce
Always call the current HEAD 'HEAD', and name the patch being cherry-picked or reverted by its oneline subject rather than its SHA1. This matches git am's behavior and is done because users most commonly are cherry-picking by SHA1 rather than by ref name. Signed-off-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
2007-01-15Use merge-recursive in git-revert/git-cherry-pickJunio C Hamano
This makes revert and cherry-pick to use merge-recursive, to allow them to notice renames. A pair of test scripts demonstrate that an old change before a rename happened can be applied (reverted) after a rename with cherry-pick (with revert). Signed-off-by: Junio C Hamano <>
2007-01-14Merge branch 'jc/int'Junio C Hamano
* jc/int: More tests in t3901. Consistent message encoding while reusing log from an existing commit. t3901: test "format-patch | am" pipe with i18n Use log output encoding in --pretty=email headers.
2007-01-13Consistent message encoding while reusing log from an existing commit.Junio C Hamano
The following commands can reuse log message from an existing commit while creating a new commit: git-cherry-pick git-rebase (both with and without --merge) git-commit (-c and -C) When the original commit was made in a different encoding from the current i18n.commitencoding, "cat-file commit" would give a string that is inconsistent with what the resulting commit will claim to be in. Replace them with "git show -s --encoding". "git-rebase" without --merge is "git format-patch" piped to "git am" in essence, and has been taken care of before this commit. Signed-off-by: Junio C Hamano <>
2007-01-13Allow whole-tree operations to be started from a subdirectoryJunio C Hamano
This updates five commands (merge, pull, rebase, revert and cherry-pick) so that they can be started from a subdirectory. This may not actually be what we want to do. These commands are inherently whole-tree operations, and an inexperienced user may mistakenly expect a "git pull" from a subdirectory would merge only the subdirectory the command started from. Signed-off-by: Junio C Hamano <>
2007-01-12git-revert: Fix die before git-sh-setup defines it.Bob Proulx
The code previously checked it's own name and called 'die' upon an error. However 'die' was not yet defined because git-sh-setup had not been sourced yet. Instead simply write the error message to stderr and exit with an error as was originally desired. Signed-off-by: Bob Proulx <> Signed-off-by: Junio C Hamano <>
2007-01-10Disallow working directory commands in a bare repository.Shawn O. Pearce
If the user tries to run a porcelainish command which requires a working directory in a bare repository they may get unexpected results which are difficult to predict and may differ from command to command. Instead we should detect that the current repository is a bare repository and refuse to run the command there, as there is no working directory associated with it. [jc: updated Shawn's original somewhat -- bugs are mine.] Signed-off-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
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 <> Signed-off-by: Junio C Hamano <>
2006-11-01Merge branch 'lj/refs'Junio C Hamano
* lj/refs: (63 commits) Fix show-ref usagestring t3200: git-branch testsuite update sha1_name.c: avoid compilation warnings. Make git-branch a builtin ref-log: fix D/F conflict coming from deleted refs. git-revert with conflicts to behave as git-merge with conflicts core.logallrefupdates thinko-fix git-pack-refs --all core.logallrefupdates create new log file only for branch heads. Remove bashism from ref-log: allow ref@{count} syntax. pack-refs: call fflush before fsync. pack-refs: use lockfile as everybody else does. git-fetch: do not look into $GIT_DIR/refs to see if a tag exists. lock_ref_sha1_basic does not remove empty directories on BSD Do not create tag leading directories since git update-ref does it. Check that a tag exists using show-ref instead of looking for the ref file. Use git-update-ref to delete a tag instead of rm()ing the ref file. Fix refs.c;:repack_without_ref() clean-up path Clean up "" and add remove recursive dir test cases. ...
2006-10-16git-revert with conflicts to behave as git-merge with conflictsLuben Tuikov
In a busy project, reverting a commit almost always results in a conflict between one or more files (depending on the commit being reverted). It is useful to record this conflict in the commit-to-be message of the resulting commit (after the resolve). The process now becomes: git-revert <SHA-1> <git complains and prints failed automatic> <user manually resolves> git-update-index <resolved files> git-commit -s And the commit message is now a merge of the revert commit message and the conflict commit message, giving the user a chance to edit it or add more information: Signed-off-by: Luben Tuikov <> Signed-off-by: Junio C Hamano <>
2006-10-10Fix git-revertJunio C Hamano
Defaulting to $replay for the sake of fixing cherry-pick was not done conditionally, which broke git-revert. Noticed by Luben. Signed-off-by: Junio C Hamano <>
2006-10-06cherry-pick: make -r the defaultJunio C Hamano
And introduce -x to expose (possibly) private commit object name for people who cherry-pick between public branches. Signed-off-by: Junio C Hamano <>
2006-07-13Fix grammatical error in git-revertJunio C Hamano
We always talk about "commit xyz". We never talk about "xyz commit", except when we end up talking about a commit as a branch head (notably, I would say "the HEAD commit", or possibly "the top-of-master commit", but here $commit is a SHA1 name, not anything else). Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
2006-05-10revert/cherry-pick: use aggressive merge.Linus Torvalds
After doing an in-index 3-way merge, we always do the stock "merge-index merge-one-file" without doing anything fancy; use of --aggressive helps performance quite a bit. Signed-off-by: Junio C Hamano <>
2006-02-21cherry-pick/revert: error-help message rewording.Junio C Hamano
It said "after fixing up, commit the result using -F .msg", but it was not clear for new people how "fix up" should be done. Hint "git-update-index <path>". We could recommend "git commit -a -F .msg" instead, but I am hesitant to give that suggestion in the blind -- you could do a cherry-pick, revert or a merge in general in a dirty working tree as long as local modifications do not overlap with the merge, but using "commit -a" would include them in the result. Signed-off-by: Junio C Hamano <>
2006-01-08revert/cherry-pick: handle single quote in author name.Junio C Hamano
The same fix as aa66c7ec77d474b737da607d6cb2d07f56628def is needed here. Signed-off-by: Junio C Hamano <>
2005-12-14git-revert: Usage string
Signed-off-by: Fredrik Kuivinen <> Signed-off-by: Junio C Hamano <>
2005-12-08Add documentation for git-revert and git-cherry-pick.Nikolai Weibull
* Added the -e option to the documentation of git-cherry-pick. * Added the -e and --no-commit option to git-revert. * Removed redundant case expression for -n as --no-edit (already taken by --no-commit). Signed-off-by: Nikolai Weibull <> Signed-off-by: Junio C Hamano <>
2005-12-05Document the --(no-)edit switch of git-revert and git-cherry-pickPetr Baudis
This switch was not documented properly. I decided not to mention the --no-edit switch in the git-cherry-pick documentation since we always default to no editing. Signed-off-by: Petr Baudis <> Signed-off-by: Junio C Hamano <>
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 <>
2005-11-24git-revert: make --edit default.Junio C Hamano
Revert always should explain why, so make --edit the default, unless stdin is not a terminal. If you really don't want to say anything, you can say "git-revert --no-edit $commit", or if you are really sick, you could also say "git-revert $commit </dev/null". But please don't. You can also say "git-cherry-pick --edit $commit". Not editting the commit log message is the default for cherry-pick. Signed-off-by: Junio C Hamano <>
2005-11-24Allow editing of a revert-messageLinus Torvalds
I think all commit operations should allow editing of the message (ie we should do this for merges too), but that's _particularly_ true of doing a "git revert". We should always explain why we needed to revert something. This patch adds a "-e" or "--edit" flag to "git revert", although I actually suspect it should be on by default (and we should have a "--no-edit" flag to disable it, probably together with an automatic disable if stdin isn't a terminal). Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
2005-11-11Do not lose author name information to locale gotchas.Junio C Hamano
I noticed format-patch loses authorship information of Lukas' patch when I run git tools with LC_LANG set to ja_JP. It turns out that the sed script to set environment variables were not working on his name (encoded in UTF-8), which is unfortunate but technically correct. Force sed invocation under C locale because we always want literal byte semantics. Signed-off-by: Junio C Hamano <>
2005-09-27Do not require clean tree when reverting and cherry-picking.Junio C Hamano
My stupidity deserved to be yelled at by Linus ... there is no reason to require the working tree to be clean when merging -- the only requirements are index to match HEAD commit and the paths involved in merge are up to date in the working tree. Revert and cherry-pick are just specialized forms of merge, and the requirements should be the same. Remove the 'general purpose routine to make sure tree is clean' from git-sh-setup, to prevent me from getting tempted again. Signed-off-by: Junio C Hamano <>
2005-09-08Big tool rename.Junio C Hamano
As promised, this is the "big tool rename" patch. The primary differences since 0.99.6 are: (1) git-*-script are no more. The commands installed do not have any such suffix so users do not have to remember if something is implemented as a shell script or not. (2) Many command names with 'cache' in them are renamed with 'index' if that is what they mean. There are backward compatibility symblic links so that you and Porcelains can keep using the old names, but the backward compatibility support is expected to be removed in the near future. Signed-off-by: Junio C Hamano <>