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

Re: fork optional branch point normazilation

From
BRBrad Roberts <braddr@puremagic.com>
Date
Apr 17, 2005, 12:40 UTC
Message-ID
<Pine.LNX.4.44.0504170530080.2625-100000@bellevue.puremagic.com>
In-Reply-To
<20050417122534.GD1487@pasky.ji.cz>
Show 21 quoted lines
> >
> > 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
>
> commit-id always returns the normalized commit ID.
>
> --
> 				Petr "Pasky" Baudis
> Stuff: http://pasky.or.cz/
> C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
>

This feels better to me. Diffed against my previus commit. The problem was that commit-id wasn't called if a branch point was specified nor was that value checked for validity.

Index: gitfork.sh
===================================================================
--- c9ccaa172ccab8e56f2fe621ee24896bfddacf26/gitfork.sh  (mode:100755 sha1:386148ae9a99739d06a09742ff4157d0f7e4e223)
+++ f9e06a309f63ac6858d019b51f2172283378d2ef/gitfork.sh  (mode:100755 sha1:dbb508b8431368fc95cc9516eada52f5bf0f8bc1)
@@ -16,7 +16,7 @@

 name=$1
 destdir=$2
-head=$3
+head=$(gitXnormid.sh -c $3)

 die () {
        echo gitfork.sh: $@ >&2
@@ -36,9 +36,6 @@

 [ -e "$destdir" ] && die "$destdir already exists"

-[ "$head" ] || head=$(commit-id)
-head=$(gitXnormid.sh -c $head)
-
 git lntree "$destdir"
 echo $head >.git/heads/$name
 ln -s heads/$name "$destdir/.git/HEAD"
Previous: Petr BaudisNext: Linus Torvalds
Message 3 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.