threads / discuss / 3581

What's in git.git

Subject: What's in git.git

## tl;dr

9 messages between Mar 6, 2006 and Mar 13, 2006.

replies: 8people: 5as markdown or json

Junio C Hamano· Mar 6, 2006, 07:13 UTC · lore

The "deathmatch" between Ryan's annotate and Fredrik's blame is officially on. Currently the last test in all three branches fail. Please do not get alarmed.

I'd like asciidoc tweaks in "next" by Francis Daly tested by people who have access to different vintages of docbook-xsl by trying to build manpages. Look for displayed examples, such as the one in git-branch documentation. I've tried it with v1.68 and getting far better results than before, and Francis says v1.69 works fine with or without the change. IOW this is a workaround for a problem in v1.68.

I've been tweaking on-and-off the similarity estimator in the "next" branch. It has become independent from the xdelta code used for pack generation. It may detect more renames that it missed before, and it may miss some other renames and copies. In general, it seems that the algorithm tends to detect slightly more breaks than before. I'd appreciate feedback from people interested in this area.

Another thing I have started in "pu" branch is to stop placing an object we decided to delta that is already max-depth deep back in the delta-base window, because such a thing only wastes the delta base slot. The changed pack-objects does pick up more delta, but the resulting pack seems bigger and I am puzzled why.

This may suggest that our criteria to delta should be tightened a bit (the value of max_size in try_delta should be decreased). We are better off storing a plain deflated representation instad of generating a bad, bigger delta. Insights?

-- -- --
* The 'master' branch has these since the last announcement.
- Documentation fixes (Dmitry V. Levin, Mark Wooding, Martin
  Langhoff, Jeff Muizelaar)
  git/Documentation: fix SYNOPSIS style bugs
  Documentation/Makefile: Some `git-*.txt' files aren't manpages.
  cvsserver: updated documentation
  cosmetics: change from 'See-Also' to 'See Also'
  documentation: add 'see also' sections to git-rm and git-add
- The deathmatch between annotate/blame (Ryan Anderson, Fredrik
  Kuivinen, me cheerleading)
  annotate: Support annotation of files on other revisions.
  git-blame: Make the output human readable
  git-blame: Use the same tests for git-blame as for git-annotate
  blame: avoid -lm by not using log().
  blame and annotate: show localtime with timezone.
  blame: avoid "diff -u0".
  annotate/blame tests updates.
  annotate-blame test: don't "source", but say "."
  annotate-blame test: add evil merge.
- Tweak rev-list (Linus Torvalds)
  get_revision(): do not dig deeper when we know we are at the end.
- Fix git-commit --amend (me)
  git-commit --amend: allow empty commit.
- Misc fixes and cleanups (Mark Wooding and me)
  gitignore: Ignore some more boring things.
  contrib/emacs/Makefile: Provide tool for byte-compiling files.
  Const tightening.
* The 'next' branch, in addition, has these.
- Fix manpage formatting (Francis Daly)
  Tweak asciidoc output to work with broken docbook-xsl
- Tweak break/rename/copy similarity estimator tweaks (me)
  diffcore-rename: similarity estimator fix.
  count-delta: no need for this anymore.
  diffcore-break: similarity estimator fix.
  diffcore-delta: make change counter to byte oriented again.
- Help pack generation tweaks (me)
  verify-pack -v: show delta-chain histogram.
- checkout-index --temp (Shawn Pearce)
  Add --temp and --stage=all options to checkout-index.
* The 'pu' branch, in addition, has these.
- WIP: pack generation tweak (me)
  [WIP] do not waste delta window with objects with already at max-depth.
Junio C Hamano· Mar 6, 2006, 08:45 UTC · re: Junio C Hamano · lore

[PATCH] blame: unbreak "diff -U 0".

Junio C Hamano <junkio@cox.net> writes:
> The "deathmatch" between Ryan's annotate and Fredrik's blame is
> officially on.  Currently the last test in all three branches
> fail.  Please do not get alarmed.

It turns out the breakage was caused after merging Fredrik's improvements. I'm double-checking the fix and will be pushing out corrected "master", "next" and "pu" shortly.

Sorry, Fredrik.
-- >8 --
Subject: [PATCH] blame: unbreak "diff -U 0".

The commit 604c86d15bb319a1e93ba218fca48ce1c500ae52 changed the original "diff -u0" to "diff -u -U 0" for portability.

A big mistake without proper testing.

The form "diff -u -U 0" shows the default 3-line contexts, because -u and -U 0 contradicts with each other; "diff -U 0" (or its longhand "diff --unified=0") is what we meant.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 blame.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
690e307f54b4aa84349b89e8552b25e7495f1cd6
diff --git a/blame.c b/blame.c
index fca22f9..90338af 100644
--- a/blame.c
+++ b/blame.c
@@ -92,7 +92,7 @@ static struct patch *get_patch(struct co
 		die("write failed: %s", strerror(errno));
 	close(fd);
 
-	sprintf(diff_cmd, "diff -u -U 0 %s %s", tmp_path1, tmp_path2);
+	sprintf(diff_cmd, "diff -U 0 %s %s", tmp_path1, tmp_path2);
 	fin = popen(diff_cmd, "r");
 	if (!fin)
 		die("popen failed: %s", strerror(errno));
@@ -234,7 +234,7 @@ static void print_patch(struct patch *p)
 	}
 }
 
-#if 0
+#if DEBUG
 /* For debugging only */
 static void print_map(struct commit *cmit, struct commit *other)
 {
-- 
1.2.4.g3bcd
Martin Langhoff· Mar 6, 2006, 09:05 UTC · re: Junio C Hamano · lore

Re: What's in git.git

On 3/6/06, Junio C Hamano <junkio@cox.net> wrote:
> - The deathmatch between annotate/blame (Ryan Anderson, Fredrik
>   Kuivinen, me cheerleading)

Add fuel to the fire ;-) Can git-blame take cached git-rev-list output like annotate does with -S?

m
Fredrik Kuivinen· Mar 10, 2006, 10:44 UTC · re: Martin Langhoff · lore

Re: What's in git.git

On Mon, Mar 06, 2006 at 10:05:41PM +1300, Martin Langhoff wrote:
Show 7 quoted lines
> On 3/6/06, Junio C Hamano <junkio@cox.net> wrote:
> > - The deathmatch between annotate/blame (Ryan Anderson, Fredrik
> >   Kuivinen, me cheerleading)
> 
> Add fuel to the fire  ;-) Can git-blame take cached git-rev-list
> output like annotate does with -S?
> 

Currently it cannot do that. How is that option used? If you want to make annotate/blame faster for certain files you might as well cache the output of annotate/blame instead of the git-rev-list output, no?

What am I missing?
- Fredrik
Johannes Schindelin· Mar 10, 2006, 11:17 UTC · re: Fredrik Kuivinen · lore

Re: What's in git.git

Hi,
On Fri, 10 Mar 2006, Fredrik Kuivinen wrote:
Show 10 quoted lines
> On Mon, Mar 06, 2006 at 10:05:41PM +1300, Martin Langhoff wrote:
> > On 3/6/06, Junio C Hamano <junkio@cox.net> wrote:
> > > - The deathmatch between annotate/blame (Ryan Anderson, Fredrik
> > >   Kuivinen, me cheerleading)
> > 
> > Add fuel to the fire  ;-) Can git-blame take cached git-rev-list
> > output like annotate does with -S?
> > 
> 
> Currently it cannot do that. How is that option used?

The history is linearized, and the commits are ordered accordingly, then to be passed to git-annotate/-blame.

Show 5 quoted lines
> If you want to make annotate/blame faster for certain files you might as 
> well cache the output of annotate/blame instead of the git-rev-list 
> output, no?
> 
> What am I missing?
Two things:
- the history is growing, and
- it would be inefficient/error-prone to save the annotates for files 
Hth,
Dscho
  
Martin Langhoff· Mar 10, 2006, 11:59 UTC · re: Johannes Schindelin · lore

Re: What's in git.git

On 3/11/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> The history is linearized, and the commits are ordered accordingly, then
> to be passed to git-annotate/-blame.
Exactly.

If a process has already done the costly git-rev-list for other purposes (say, grab logentries of the relevant commits), and wants to also run annotate/blame, it should be able to reuse it cheaply, by passing -S filename. Possibly an IDE (or gitk/qgit) would want to do this.

Now, what I use it for in git-cvsserver is to "flatten" merges. CVS clients don't really understand that we know about parallel history, so every time we have a merge the view that the CVS client gets is of a "merge commit" with a merge summary. And I sweep the merged commits under the carpet.

(there's some arbitrary nondeterministic magic in how I pick what side to track and what side to merge. let's not think about that too much. but I just want git-blame to see a somewhat simplified git-rev-list).

does that help?
cheers,
m
Junio C Hamano· Mar 13, 2006, 05:01 UTC · re: Fredrik Kuivinen · lore

Re: What's in git.git

Fredrik Kuivinen <freku045@student.liu.se> writes:
Show 8 quoted lines
> On Mon, Mar 06, 2006 at 10:05:41PM +1300, Martin Langhoff wrote:
>> 
>> Add fuel to the fire  ;-) Can git-blame take cached git-rev-list
>> output like annotate does with -S?
>
> Currently it cannot do that. How is that option used? If you want to
> make annotate/blame faster for certain files you might as well cache
> the output of annotate/blame instead of the git-rev-list output, no?

There are two reasons Martin's git-cvsserver uses -S to feed you the revision list. One is that he already has that ancestry chain information, and there is no point for him to have the git-annotate command to recompute it.

But there is another, more important reason. He is giving his clients a modified world view where the branch he is exposing to have _no_ merges -- just a single strand of pearls. So what is fed to git-annotate using -S from git-cvsserver has either one object name (single root commit) or two (the commit and its sole parent). IOW, he does not want you to look at other parents when dealing with a merge commit.

What this means is that in cases where your algorithm looked at second and subsequent parents to pass remaining blame on after looking at the first parent for a merge, the algorithm now needs to assign the blame to the merge commit itself. Your process_commit() currently reads the commit object and loops over its true parents, but the -S flag wants to supply its own notion of who are the parents of whom (and in the case of git-cvsserver, it always supplies at most one parent) so you would need to honor that instead of looking at the real ancestry.

Johannes Schindelin· Mar 6, 2006, 09:15 UTC · re: Junio C Hamano · lore

Re: What's in git.git

Hi,
On Sun, 5 Mar 2006, Junio C Hamano wrote:
Show 5 quoted lines
> Another thing I have started in "pu" branch is to stop placing
> an object we decided to delta that is already max-depth deep
> back in the delta-base window, because such a thing only wastes
> the delta base slot.  The changed pack-objects does pick up more
> delta, but the resulting pack seems bigger and I am puzzled why.

Not that I know much about the pack format, but is it possible that the deltas are deflated? In that case, a possible explanation is that a better delta is less compressible (and taken together, this could amount to more bytes).

Ciao, Dscho

Lukas Sandström· Mar 6, 2006, 10:29 UTC · re: Junio C Hamano · lore

Re: What's in git.git

Junio C Hamano wrote:
 
Show 8 quoted lines
> I'd like asciidoc tweaks in "next" by Francis Daly tested by
> people who have access to different vintages of docbook-xsl by
> trying to build manpages.  Look for displayed examples, such as
> the one in git-branch documentation.  I've tried it with v1.68
> and getting far better results than before, and Francis says
> v1.69 works fine with or without the change. IOW this is a
> workaround for a problem in v1.68.
> 

I tested it with asciidoc 7.0.1 and the examples in the git-branch man page look better with the fix.

/Lukas
Before:
 Examples
       Start development off of a know tag
              $  git  clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6 $
              cd my2.6 $ git branch my2.6.14 v2.6.14 $ git checkout my2.6.14
               These two steps are the same as "checkout -b my2.6.14 v2.6.14".
       Delete unneeded branch
              $  git clone git://git.kernel.org/.../git.git my.git $ cd my.git
              $ git branch -D todo
               delete todo branch even if the "master" branch  does  not  have
              all commits from todo branch.
After:
   Examples
       Start development off of a know tag
              $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
              $ cd my2.6
              $ git branch my2.6.14 v2.6.14
              $ git checkout my2.6.14
               These two steps are the same as "checkout -b my2.6.14 v2.6.14".
       Delete unneeded branch
              $ git clone git://git.kernel.org/.../git.git my.git
              $ cd my.git
              $ git branch -D todo
               delete todo branch even if the "master" branch does not have all
              commits from todo branch.

← back to recent threads