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

Re: SCSI trees, merges and git status

From
JBJames Bottomley <james.bottomley@steeleye.com>
Date
Apr 19, 2005, 02:17 UTC
Message-ID
<1113877071.4998.111.camel@mulgrave>
In-Reply-To
<Pine.LNX.4.58.0504181724170.15725@ppc970.osdl.org>
On Mon, 2005-04-18 at 17:29 -0700, Linus Torvalds wrote:
> 2.6.12 is some time away, if for no other reason than the fact that this 
> SCM thing has obviously eaten two weeks of my time. So I'd be inclined to 
> chalk this up as a "learning experience" with git, and just go forward.
Fair enough.  If you pull from
rsync://www.parisc-linux.org/~jejb/scsi-misc-2.6.git

That will pull in the rest of my scsi-misc-2.6 tree (which includes all of the rc fixes). I've done a test pull and merge and checked the resulting against BK, so hopefully there should be no more screw ups.

Doing this exposed two bugs in your merge script:
1) It doesn't like a completely new directory (the misc tree contains a
new drivers/scsi/lpfc)
2) the merge testing logic is wrong.  You only want to exit 1 if the
merge fails.
James
git-merge-one-file-script: bec009e2c37bacc9e6f9cad1cfa5fd56752c7bf1
--- a/git-merge-one-file-script
+++ b/git-merge-one-file-script
@@ -13,6 +13,11 @@
 # do any merges that migth change the tree layout
 #
 
+# if the directory is newly added in a branch, it might not exist
+# in the current tree
+dir=$(dirname "$4")
+mkdir -p "$dir"
+
 case "${1:-.}${2:-.}${3:-.}" in
 #
 # deleted in both, or deleted in one and unchanged in the other
@@ -40,7 +45,11 @@ case "${1:-.}${2:-.}${3:-.}" in
 	orig=$(unpack-file $1)
 	src1=$(unpack-file $2)
 	src2=$(unpack-file $3)
-	merge "$src2" "$orig" "$src1" || echo Leaving conflict merge in $src2 && exit 1
+	merge "$src2" "$orig" "$src1"
+	if [ $? -ne 0 ]; then
+		echo Leaving conflict merge in $src2
+		exit 1
+	fi
 	cp "$src2" "$4" && update-cache --add -- "$4" && exit 0
 	;;
 
Previous: Linus TorvaldsNext: Linus Torvalds
Message 10 of 13 in “SCSI trees, merges and git status”
  1. James BottomleyApr 18, 2005
  2. Linus TorvaldsApr 18, 2005
  3. James BottomleyApr 18, 2005
  4. Linus TorvaldsApr 19, 2005
  5. David WoodhouseApr 19, 2005
  6. James BottomleyApr 19, 2005
  7. David WoodhouseApr 19, 2005
  8. James BottomleyApr 19, 2005
  9. Linus TorvaldsApr 19, 2005
  10. James BottomleyApr 19, 2005
  11. Linus TorvaldsApr 19, 2005
  12. Junio C HamanoApr 18, 2005
  13. Petr BaudisApr 18, 2005

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.