diff options
author | Linus Torvalds <torvalds@osdl.org> | 2005-08-29 22:36:16 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-29 22:55:42 -0700 |
commit | cdcb0ed411021cf8a8db047667e5ae18c4378ec0 (patch) | |
tree | dd88d401026b1b29bebc010f34ccc89ec8a4a1c5 | |
parent | 8d0991d7d7d7e68ef39fe8d302f43110ef2c65d1 (diff) | |
download | git-cdcb0ed411021cf8a8db047667e5ae18c4378ec0.tar.gz git-cdcb0ed411021cf8a8db047667e5ae18c4378ec0.tar.xz |
[PATCH] Make "git resolve" less scary
When we resolve a merge between two branches, and it removes a file in the
current branch, we notify the person doing the resolve with a big nice
notice like
Removing xyzzy
which is all well and good.
HOWEVER, we also do this when the file was actually removed in the current
branch, and we're merging with another branch that didn't have it removed
(or, indeed, if the other branch _did_ have it removed, but the common
parent was far enough back that the file still existed in there).
And that just doesn't make sense. In that case we're not removing
anything: the file didn't exist in the branch we're merging into in the
first place. So the message just makes people nervous, and makes no sense.
This has been around forever, but I never bothered to do anything about
it.
Until now.
The trivial fix is to only talk about removing files if the file existed
in the branch we're merging into, but will not exist in the result.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-x | git-merge-one-file-script | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/git-merge-one-file-script b/git-merge-one-file-script index be64c0728..b791107fd 100755 --- a/git-merge-one-file-script +++ b/git-merge-one-file-script @@ -21,7 +21,9 @@ case "${1:-.}${2:-.}${3:-.}" in # Deleted in both or deleted in one and unchanged in the other # "$1.." | "$1.$1" | "$1$1.") - echo "Removing $4" + if [ "$2" ]; then + echo "Removing $4" + fi if test -f "$4"; then rm -f -- "$4" fi && |