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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sat, 17 Jan 2009, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux