Subject: Re: [PATCH] Add git-bundle: move objects and references by archive.

From: "Shawn O. Pearce" <[email-masked]>
Date: Mon, 19 Feb 2007 02:56:54 -0500

Johannes Schindelin <[email-masked]> wrote:
> On Sun, 18 Feb 2007, Mark Levedahl wrote:
> > +    gitrevargs=$(git-rev-parse --symbolic --revs-only $args) || exit 1
> 
> Here, you rely again on the refs not containing spaces.

They cannot.  OK, they can if you avoid any of the Git code:

  git rev-parse HEAD >".git/refs/heads/ref with space"

but a lot of things downstream may get annoyed by doing this.
Spaces are not permitted in ref names.
 
> > +    # create refs and pack
> > +    tmp="$GIT_DIR/bundle_tmp$$"
> 
> Should we really rely on $GIT_DIR being writable? For unbundling, yes, but 
> for bundling? Given the great confusion with git-status trying to write 
> into $GIT_DIR, and people _demanding_ that it does not do so, I recommend 
> against that.

I agree.  For an application like bundle creation, $GIT_DIR should be
strictly read-only.  There is no reason for this application to need
to create temporary files, as the bundle can be streamed to stdout
(or optionally to a file supplied by the user on the command line).

> > +    git-rev-list --objects $fullrevargs | cut -b-40 |
> > +        git pack-objects --all-progress --stdout > "$pack" &&
> 
> pack-objects can take rev-list arguments itself these days, using "--revs" 
> and being piped the rev-list arguments.

Uh, actually it can't.  I thought it could too.  It doesn't.
It can only take a ref name or --not.  I'm actually not sure why
we limited it like that, but we did...  It may be a good idea to
change that restriction to not exist.
 
-- 
Shawn.