@matheusbsbs / matheus-bagliano / commits / 228e2eb67e
Fork 0

merge and reset: adjust for "reset --hard" messages

An earlier commit made "reset --hard" chattier but leaking its message from "git rebase" (which calls it when first rewinding the current branch to prepare replaying our own changes) without explanation was confusing, so add an extra message to mention it. Inside restorestate in merge (which is rarely exercised codepath, where more than one strategies are attempted), resetting to the original state uses "reset --hard" -- this can be squelched entirely. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 22, 2006 at 15:21 UTC 228e2eb67e9f15983519f472cc1566a3dd857f9c
2 files changed +2 -1
git-merge.sh
+1 -1
@@ -32,7 +32,7 @@ savestate() {
32 restorestate() {
33 if test -f "$GIT_DIR/MERGE_SAVE"
34 then
35 - git reset --hard $head
35 + git reset --hard $head >/dev/null
36 cpio -iuv <"$GIT_DIR/MERGE_SAVE"
37 git-update-index --refresh >/dev/null
38 fi
git-rebase.sh
+1
@@ -292,6 +292,7 @@ then
292 fi
293
294 # Rewind the head to "$onto"; this saves our current head in ORIG_HEAD.
295 +echo "First, rewinding head to replay your work on top of it..."
296 git-reset --hard "$onto"
297
298 # If the $onto is a proper descendant of the tip of the branch, then