Skip to content

Commit

Permalink
merge and reset: adjust for "reset --hard" messages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 22, 2006
1 parent 2295e8d commit 228e2eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ savestate() {
restorestate() {
if test -f "$GIT_DIR/MERGE_SAVE"
then
git reset --hard $head
git reset --hard $head >/dev/null
cpio -iuv <"$GIT_DIR/MERGE_SAVE"
git-update-index --refresh >/dev/null
fi
Expand Down
1 change: 1 addition & 0 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ then
fi

# Rewind the head to "$onto"; this saves our current head in ORIG_HEAD.
echo "First, rewinding head to replay your work on top of it..."
git-reset --hard "$onto"

# If the $onto is a proper descendant of the tip of the branch, then
Expand Down

0 comments on commit 228e2eb

Please sign in to comment.