git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Merging on a dirty tree???

From
SBSanti Béjar <sbejar@gmail.com>
Date
Mar 16, 2007, 10:46 UTC
Message-ID
<87slc54gb2.fsf@gmail.com>
In-Reply-To
<200703152359.53543.dtor@insightbb.com>
Dmitry Torokhov <dtor@insightbb.com> writes:
> Hi,
>
> I just tried to pull from Linus' tree into my local tree and it seems
> that fast forward was committed even though the tree was dirty:
[...]
Show 5 quoted lines
>  19 files changed, 211 insertions(+), 80 deletions(-)
> [dtor@anvil work]$ git --version
> git version 1.5.0.3.438.gc49b2
>
> It used to refuse merge if there were conflicts...
Try with this patch.
Santi
-- >8 --
From: "Santi Béjar" <sbejar@gmail.com>
Subject: [PATCH] git-merge: finish when git-read-tree fails
The message formating (commit v1.5.0.3-28-gbe242d5) broke the && chain.
Noticed by Dmitry Torokhov.
Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 git-merge.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-merge.sh b/git-merge.sh
index 6ce62c8..8759c5a 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -292,13 +292,13 @@ f,*)
 	# Again the most common case of merging one remote.
 	echo "Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $1)"
 	git-update-index --refresh 2>/dev/null
-	new_head=$(git-rev-parse --verify "$1^0") &&
-	git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
 	msg="Fast forward"
 	if test -n "$have_message"
 	then
 		msg="$msg (no commit created; -m option ignored)"
 	fi
+	new_head=$(git-rev-parse --verify "$1^0") &&
+	git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
 	finish "$new_head" "$msg" || exit
 	dropsave
 	exit 0
-- 
1.5.0.4.1010.g688e
Previous: Dmitry TorokhovNext: Junio C Hamano
Message 2 of 3 in “Merging on a dirty tree???”
  1. Dmitry TorokhovMar 16, 2007
  2. Santi BéjarMar 16, 2007
  3. Junio C HamanoMar 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.