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

[patch] fork optional branch point normazilation

From
BRBrad Roberts <braddr@puremagic.com>
Date
Apr 17, 2005, 12:04 UTC
Message-ID
<Pine.LNX.4.44.0504170451030.2625-100000@bellevue.puremagic.com>
(ok, author looks better, but committer doesn't obey the AUTHOR_ vars yet)

This might not be how you intended git fork to behave, but without doing _something_ to protect the head parameter a bit, this is just asking for a corrutped .git/HEAD file.

commit 76faec069dfeae59c3ce5faaad10bdcded0cc908 tree c291316b28eff4042c80850cd93445345a606835 parent 1cdbc0a19b8d9b68f1f42735e2f14f1289823a63 author Brad Roberts <braddr@puremagic.com> 1113738584 -0700 committer Brad Roberts,,, <braddr@gameboy2> 1113738584 -0700

gitfork needs to normalize the optional third parameter before using it.
Index: gitfork.sh
===================================================================
--- 51b1bddbbc05e50d5bbf1f9662e503c2e85d5e96/gitfork.sh  (mode:100755 sha1:e5692ea9bdbc39b028fe1e1205381da632541bab)
+++ c291316b28eff4042c80850cd93445345a606835/gitfork.sh  (mode:100755 sha1:386148ae9a99739d06a09742ff4157d0f7e4e223)
@@ -37,6 +37,7 @@
 [ -e "$destdir" ] && die "$destdir already exists"

 [ "$head" ] || head=$(commit-id)
+head=$(gitXnormid.sh -c $head)

 git lntree "$destdir"
 echo $head >.git/heads/$name
Next: Petr Baudis
Message 1 of 12 in “fork optional branch point normazilation”
  1. fork optional branch point normazilationBrad Roberts, Apr 17, 2005
  2. Petr BaudisApr 17, 2005
  3. Brad RobertsApr 17, 2005
  4. Linus TorvaldsApr 17, 2005
  5. Daniel BarkalowApr 17, 2005
  6. Brad RobertsApr 17, 2005
  7. Linus TorvaldsApr 17, 2005
  8. Petr BaudisApr 18, 2005
  9. Linus TorvaldsApr 18, 2005
  10. remove_special() tentative fix.Junio C Hamano, Apr 18, 2005
  11. Brad RobertsApr 18, 2005
  12. Martin SchlemmerApr 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.