Subject: Re: [PATCH] Make git-branch a builtin

From: Shawn Pearce <[email-masked]>
Date: Tue, 24 Oct 2006 01:44:08 -0400

Junio C Hamano <[email-masked]> wrote:
> Shawn Pearce <[email-masked]> writes:
> 
> > Lars Hjemli <[email-masked]> wrote:
> > [snip]
> >> ---
> >>  Makefile         |    3 +-
> >>  builtin-branch.c |  217 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >>  builtin.h        |    1 +
> >>  git-branch.sh    |  131 --------------------------------
> >>  git.c            |    1 +
> >>  5 files changed, 221 insertions(+), 132 deletions(-)
> > [snip]
> >> diff --git a/git-branch.sh b/git-branch.sh
> >> deleted file mode 100755
> >> index 4379a07..0000000
> >> --- a/git-branch.sh
> >> +++ /dev/null
> >> @@ -1,131 +0,0 @@
> > [snip 131 lines]
> >
> > Aside from compatability with non-Git tools...
> >
> > Wouldn't it make more sense to just include the full SHA1 of the
> > file we are deleting rather than the entire 131 line negative diff?
> 
> How would you do "git apply -R" on something like that?

Uh, you have the full SHA1 in the index line.  So you just have to
reattach that blob to the named path...  pretty simple actually.

Of course this is yet another code path in apply and as Petr pointed
out on this same thread its nice to know what you are deleting so
you can compare it to what else is changing in the same patch... so
this suggestion of mine is probably just a waste of bytes.

-- 
Shawn.