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

Re: [PATCH] revision walker: include a detached HEAD in --all

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 18, 2009, 13:42 UTC
Message-ID
<alpine.DEB.1.00.0901181440550.3586@pacific.mpi-cbg.de>
In-Reply-To
<7v8wp917c3.fsf@gitster.siamese.dyndns.org>
Hi,
On Sat, 17 Jan 2009, Junio C Hamano wrote:
Show 37 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > When HEAD is detached, --all should list it, too, logically, as a
> > detached HEAD is by definition a temporary, unnamed branch.
> >
> > It is especially necessary to list it when garbage collecting, as
> > the detached HEAD would be trashed.
> >
> > Noticed by Thomas Rast.
> >
> > Note that this affects creating bundles with --all; I contend that it
> > is a good change to add the HEAD, so that cloning from such a bundle
> > will give you a current branch.  However, I had to fix t5701 as it
> > assumed that --all does not imply HEAD.
> 
> Sorry, but I do not understand.
> 
> > diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh
> > index 8dfaaa4..14413f8 100755
> > --- a/t/t5701-clone-local.sh
> > +++ b/t/t5701-clone-local.sh
> > @@ -11,8 +11,8 @@ test_expect_success 'preparing origin repository' '
> >  	git clone --bare . x &&
> >  	test "$(GIT_CONFIG=a.git/config git config --bool core.bare)" = true &&
> >  	test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true
> > -	git bundle create b1.bundle --all HEAD &&
> > -	git bundle create b2.bundle --all &&
> > +	git bundle create b1.bundle master HEAD &&
> > +	git bundle create b2.bundle master &&
> 
> Because --all did not imply HEAD, "--all HEAD" used to be the way to say
> "everything and HEAD".  Now --all does imply HEAD, but it should still be
> a valid way to say "everything, by the way, do not forget HEAD".
> 
> Does the first one need to be changed to "master HEAD"?  If "--all HEAD"
> makes the rest of the test unhappy because HEAD is listed twice, perhaps
> that is an independent bug that needs to be fixed?

I changed it away from --all because I am a fan of being explicit. We want a bundle here that has master and HEAD in it. This being a test case, being lazy is so wrong here. You should describe what you actually want, not use a set of parameters that just happens to work (by chance as we saw).

Ciao, Dscho

Previous: Johannes SchindelinNext: Johan Herland
Message 19 of 46 in “checkout: implement "-" shortcut name for last branch”
  1. checkout: implement "-" shortcut name for last branchThomas Rast, Jan 15, 2009
  2. checkout: implement "-" shortcut name for last branchThomas Rast, Jan 15, 2009
  3. Johannes SixtJan 15, 2009
  4. Johannes SchindelinJan 15, 2009
  5. Thomas RastJan 15, 2009
  6. Johannes SchindelinJan 15, 2009
  7. Johannes SchindelinJan 15, 2009
  8. Junio C HamanoJan 15, 2009
  9. Johannes SchindelinJan 15, 2009
  10. revision walker: include a detached HEAD in --allJohannes Schindelin, Jan 16, 2009
  11. Santi BéjarJan 16, 2009
  12. Johannes SchindelinJan 16, 2009
  13. David KastrupJan 16, 2009
  14. Santi BéjarJan 16, 2009
  15. Santi BéjarJan 16, 2009
  16. Junio C HamanoJan 18, 2009
  17. Junio C HamanoJan 18, 2009
  18. Johannes SchindelinJan 18, 2009
  19. Johannes SchindelinJan 18, 2009
  20. Johan HerlandJan 15, 2009
  21. Johannes SchindelinJan 15, 2009
  22. Junio C HamanoJan 15, 2009
  23. Junio C HamanoJan 15, 2009
  24. Johannes SchindelinJan 16, 2009
  25. Johannes SchindelinJan 15, 2009
  26. Thomas RastJan 15, 2009
  27. Johannes SchindelinJan 15, 2009
  28. Thomas RastJan 15, 2009
  29. Johannes SchindelinJan 15, 2009
  30. Thomas RastJan 16, 2009
  31. Johannes SchindelinJan 16, 2009
  32. git-resurrect: find traces of a branch name and resurrect itThomas Rast, Jan 18, 2009
  33. Johannes SchindelinJan 18, 2009
  34. Thomas RastJan 20, 2009
  35. Boyd Stephen Smith Jr.Jan 20, 2009
  36. Boyd Stephen Smith Jr.Jan 20, 2009
  37. contrib git-resurrect: find traces of a branch name and resurrect itThomas Rast, Jan 23, 2009
  38. Boyd Stephen Smith Jr.Jan 23, 2009
  39. Thomas RastJan 26, 2009
  40. contrib git-resurrect: find traces of a branch name and resurrect itThomas Rast, Jan 26, 2009
  41. Junio C HamanoJan 27, 2009
  42. Thomas RastJan 30, 2009
  43. contrib git-resurrect: find traces of a branch name and resurrect itThomas Rast, Feb 1, 2009
  44. Junio C HamanoFeb 2, 2009
  45. contrib git-resurrect: find traces of a branch name and resurrect itThomas Rast, Feb 4, 2009
  46. Junio C HamanoFeb 5, 2009

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.