From: Junio C Hamano <gitster@pobox.com>
To: <git@vger.kernel.org>
Cc: "Philip Oakley" <philipoakley@iee.org>,
"Alain Kalker" <a.c.kalker@gmail.com>
Subject: Re: [BUG] Git clone of a bundle fails, but works (somewhat) when run with strace
Date: Sun, 24 Feb 2013 22:59:08 -0800 [thread overview]
Message-ID: <7vy5eczxoj.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 20C7ED1EA37C4EECA28070D1483C57B7@PhilipOakley
"Philip Oakley" <philipoakley@iee.org> writes:
>>> You probably wanted "git bundle create ../repo.bundle --all" which
>>> includes both "master" and "HEAD".
>>
>> That explains it, thanks! Maybe this could be added as an example to
>> the
>> documentation for `git bundle`? People looking at `man git-bundle`
>> hoping
>> to use it as one possible way to make a backup of a Git repository
>> might
>> not realize right away that --all is the way to specify all refs, like
>> with `git log`.
>
> I had posted a documentation patch back in Setemeber last year,
> http://thread.gmane.org/gmane.comp.version-control.git/205887/focus=205897,
> however Junio highlighted some additional concerns that I wasn't able
> to respond to at the time.
>
> It may be worth resurrecting once the concerns have been addressed.
A saner thing to do, instead of explaining away the lack of HEAD as
"the creator of the bundle did not bother to name it", might be to
automatically add an artificial HEAD to the resulting bundle when
the arguments given to specify the "range" do not have any negative
ones (because by definition such a bundle is unsuitable for use with
"git clone" [*1*]), and HEAD is not among the refs.
The heuristics to pick what to record as the artificial HEAD could
vary, though. Without thinking things through...
* When only one positive ref is given, use it (sort of obvious);
* When two or more positive refs are given, and the current branch
is one of them, use that;
* Otherwise, pick the "first" positive ref given from the command
line.
perhaps?
[Footnote]
*1* Strictly speaking, this condition could be loosened, as long as
cloning side uses an appropriate --depth, but I do not know such an
"advanced use case" needs a hand-holding change to add a HEAD that
was not asked by the user.
next prev parent reply other threads:[~2013-02-25 6:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 19:33 [BUG] Git clone of a bundle fails, but works (somewhat) when run with strace Alain Kalker
2013-02-15 22:25 ` Alain Kalker
2013-02-16 0:03 ` Alain Kalker
2013-02-16 0:09 ` Junio C Hamano
2013-02-16 4:01 ` Jeff King
2013-02-17 13:01 ` Alain Kalker
2013-02-17 18:04 ` Philip Oakley
2013-02-25 6:59 ` Junio C Hamano [this message]
2014-05-28 15:59 ` Bram Geron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vy5eczxoj.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=a.c.kalker@gmail.com \
--cc=git@vger.kernel.org \
--cc=philipoakley@iee.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).