Re: [PATCH] Add git-bundle: move objects and references by archive.
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Feb 19, 2007, 07:56 UTC
- Message-ID
- <20070219075654.GB30030@spearce.org>
- In-Reply-To
- <Pine.LNX.4.63.0702190126220.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> 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.
Show 7 quoted lines
> > + # 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).
Show 5 quoted lines
> > + 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.