<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff-tree.c, branch gitk-resize-error</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=gitk-resize-error</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=gitk-resize-error'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2006-05-23T20:11:13Z</updated>
<entry>
<title>Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree.</title>
<updated>2006-05-23T20:11:13Z</updated>
<author>
<name>Peter Eriksen</name>
<email>s022018@student.dtu.dk</email>
</author>
<published>2006-05-23T12:15:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=e8cc9cd98e2ecd7fd8bb03e725d470405c8e2b94'/>
<id>urn:sha1:e8cc9cd98e2ecd7fd8bb03e725d470405c8e2b94</id>
<content type='text'>
Signed-off-by: Peter Eriksen &lt;s022018@student.dtu.dk&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Provide a way to flush git-diff-tree's output</title>
<updated>2006-05-18T07:25:50Z</updated>
<author>
<name>Paul Mackerras</name>
<email>paulus@samba.org</email>
</author>
<published>2006-05-18T06:58:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=70f75cc96a3c590ac1c54c09c39446626f155ef7'/>
<id>urn:sha1:70f75cc96a3c590ac1c54c09c39446626f155ef7</id>
<content type='text'>
Gitk wants to use git-diff-tree as a filter to tell it which ids from
a given list affect a set of files or directories.  We don't want to
fork and exec a new git-diff-tree process for each batch of ids, since
there could be a lot of relatively small batches.  For example, a
batch could contain as many ids as fit in gitk's headline display
window, i.e. 20 or so, and we would be processing a new batch every
time the user scrolls that window.

The --stdin flag to git-diff-tree is suitable for this, but the main
difficulty is that the output of git-diff-tree gets buffered and
doesn't get sent until the buffer is full.

This provides a way to get git-diff-tree to flush its output buffers.
If a blank line is supplied on git-diff-tree's standard input, it will
flush its output buffers and then accept further input.

Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Log message printout cleanups</title>
<updated>2006-04-17T22:18:25Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2006-04-17T18:59:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9153983310a169a340bd1023dccafd80b70b05bc'/>
<id>urn:sha1:9153983310a169a340bd1023dccafd80b70b05bc</id>
<content type='text'>
On Sun, 16 Apr 2006, Junio C Hamano wrote:
&gt;
&gt; In the mid-term, I am hoping we can drop the generate_header()
&gt; callchain _and_ the custom code that formats commit log in-core,
&gt; found in cmd_log_wc().

Ok, this was nastier than expected, just because the dependencies between
the different log-printing stuff were absolutely _everywhere_, but here's
a patch that does exactly that.

The patch is not very easy to read, and the "--patch-with-stat" thing is
still broken (it does not call the "show_log()" thing properly for
merges). That's not a new bug. In the new world order it _should_ do
something like

	if (rev-&gt;logopt)
		show_log(rev, rev-&gt;logopt, "---\n");

but it doesn't. I haven't looked at the --with-stat logic, so I left it
alone.

That said, this patch removes more lines than it adds, and in particular,
the "cmd_log_wc()" loop is now a very clean:

	while ((commit = get_revision(rev)) != NULL) {
		log_tree_commit(rev, commit);
		free(commit-&gt;buffer);
		commit-&gt;buffer = NULL;
	}

so it doesn't get much prettier than this. All the complexity is entirely
hidden in log-tree.c, and any code that needs to flush the log literally
just needs to do the "if (rev-&gt;logopt) show_log(...)" incantation.

I had to make the combined_diff() logic take a "struct rev_info" instead
of just a "struct diff_options", but that part is pretty clean.

This does change "git whatchanged" from using "diff-tree" as the commit
descriptor to "commit", and I changed one of the tests to reflect that new
reality. Otherwise everything still passes, and my other tests look fine
too.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Split init_revisions() out of setup_revisions()</title>
<updated>2006-04-16T06:46:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-04-16T06:46:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6b9c58f4669b3832ed2830f0cb1a307ea6bc6063'/>
<id>urn:sha1:6b9c58f4669b3832ed2830f0cb1a307ea6bc6063</id>
<content type='text'>
Merging all three option parsers related to whatchanged is
unarguably the right thing, but the fallout was too big to scare
me away.  Let's try it once again, but once step at time.

This splits out init_revisions() call from setup_revisions(), so
that the callers can set different defaults to match the
traditional benaviour.

The rev-list command is still broken in a big way, which is the
topic of next step.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Fix up default abbrev in setup_revisions() argument parser.</title>
<updated>2006-04-15T05:42:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-04-15T05:19:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=8e8f998739db6526fe890fabc88c866759bc2ac3'/>
<id>urn:sha1:8e8f998739db6526fe890fabc88c866759bc2ac3</id>
<content type='text'>
The default abbreviation precision should be DEFAULT_ABBREV as before.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Common option parsing for "git log --diff" and friends</title>
<updated>2006-04-15T04:56:55Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2006-04-14T23:52:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cd2bdc5309461034e5cc58e1d3e87535ed9e093b'/>
<id>urn:sha1:cd2bdc5309461034e5cc58e1d3e87535ed9e093b</id>
<content type='text'>
This basically does a few things that are sadly somewhat interdependent,
and nontrivial to split out

 - get rid of "struct log_tree_opt"

   The fields in "log_tree_opt" are moved into "struct rev_info", and all
   users of log_tree_opt are changed to use the rev_info struct instead.

 - add the parsing for the log_tree_opt arguments to "setup_revision()"

 - make setup_revision set a flag (revs-&gt;diff) if the diff-related
   arguments were used. This allows "git log" to decide whether it wants
   to show diffs or not.

 - make setup_revision() also initialize the diffopt part of rev_info
   (which we had from before, but we just didn't initialize it)

 - make setup_revision() do all the "finishing touches" on it all (it will
   do the proper flag combination logic, and call "diff_setup_done()")

Now, that was the easy and straightforward part.

The slightly more involved part is that some of the programs that want to
use the new-and-improved rev_info parsing don't actually want _commits_,
they may want tree'ish arguments instead. That meant that I had to change
setup_revision() to parse the arguments not into the "revs-&gt;commits" list,
but into the "revs-&gt;pending_objects" list.

Then, when we do "prepare_revision_walk()", we walk that list, and create
the sorted commit list from there.

This actually cleaned some stuff up, but it's the less obvious part of the
patch, and re-organized the "revision.c" logic somewhat. It actually paves
the way for splitting argument parsing _entirely_ out of "revision.c",
since now the argument parsing really is totally independent of the commit
walking: that didn't use to be true, since there was lots of overlap with
get_commit_reference() handling etc, now the _only_ overlap is the shared
(and trivial) "add_pending_object()" thing.

However, I didn't do that file split, just because I wanted the diff
itself to be smaller, and show the actual changes more clearly. If this
gets accepted, I'll do further cleanups then - that includes the file
split, but also using the new infrastructure to do a nicer "git diff" etc.

Even in this form, it actually ends up removing more lines than it adds.

It's nice to note how simple and straightforward this makes the built-in
"git log" command, even though it continues to support all the diff flags
too. It doesn't get much simpler that this.

I think this is worth merging soonish, because it does allow for future
cleanup and even more sharing of code. However, it obviously touches
"revision.c", which is subtle. I've tested that it passes all the tests we
have, and it passes my "looks sane" detector, but somebody else should
also give it a good look-over.

[jc: squashed the original and three "oops this too" updates, with
 another fix-up.]

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;

</content>
</entry>
<entry>
<title>tree-diff: do not assume we use only one pathspec</title>
<updated>2006-04-10T23:45:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-04-10T23:39:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a8baa7b9f5c8e338c09d63097f14372aca68e13f'/>
<id>urn:sha1:a8baa7b9f5c8e338c09d63097f14372aca68e13f</id>
<content type='text'>
The way tree-diff was set up assumed we would use only one set
of pathspec during the entire life of the program.  Move the
pathspec related static variables out to diff_options structure
so that we can filter commits with one set of paths while show
the actual diffs using different set of paths.

I suspect this breaks blame.c, and makes "git log paths..." to
default to the --full-diff, the latter of which is dealt with
the next commit.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>log-tree: separate major part of diff-tree.</title>
<updated>2006-04-09T08:35:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-04-09T08:11:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=5f1c3f07b7f4a8436c7773b8e7a04998190c125e'/>
<id>urn:sha1:5f1c3f07b7f4a8436c7773b8e7a04998190c125e</id>
<content type='text'>
This separates out the part that deals with one-commit diff-tree
(and --stdin form) into a separate log-tree module.

There are two goals with this.  The more important one is to be
able to make this part available to "git log --diff", so that we
can have a native "git whatchanged" command.  Another is to
simplify the commit log generation part simpler.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Use blob_, commit_, tag_, and tree_type throughout.</title>
<updated>2006-04-04T07:11:19Z</updated>
<author>
<name>Peter Eriksen</name>
<email>s022018@student.dtu.dk</email>
</author>
<published>2006-04-02T12:44:09Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=8e4402592574d630cdb5ab4f55a1b7131802ff72'/>
<id>urn:sha1:8e4402592574d630cdb5ab4f55a1b7131802ff72</id>
<content type='text'>
This replaces occurences of "blob", "commit", "tag", and "tree",
where they're really used as type specifiers, which we already
have defined global constants for.

Signed-off-by: Peter Eriksen &lt;s022018@student.dtu.dk&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>diff-tree: do not default to -c</title>
<updated>2006-02-12T07:18:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-02-12T00:43:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6932c78cb4485380a8ff63575a47a58a4e308bfd'/>
<id>urn:sha1:6932c78cb4485380a8ff63575a47a58a4e308bfd</id>
<content type='text'>
Marco says it breaks qgit.  This makes the flags a bit more
orthogonal.

  $ git-diff-tree -r --abbrev ca18

    No output from this command because you asked to skip merge by
    not having -m there.

  $ git-diff-tree -r -m --abbrev ca18
  ca182053c7710a286d72102f4576cf32e0dafcfb
  :100644 100644 538d21d... 59042d1... M	Makefile
  :100644 100644 410b758... 6c47c3a... M	entry.c
  ca182053c7710a286d72102f4576cf32e0dafcfb
  :100644 100644 30479b4... 59042d1... M	Makefile

    The same "independent sets of diff" as before without -c.

  $ git-diff-tree -r -m -c --abbrev ca18
  ca182053c7710a286d72102f4576cf32e0dafcfb
  ::100644 100644 100644 538d21d... 30479b4... 59042d1... MM	Makefile

    Combined.

  $ git-diff-tree -r -c --abbrev ca18
  ca182053c7710a286d72102f4576cf32e0dafcfb
  ::100644 100644 100644 538d21d... 30479b4... 59042d1... MM	Makefile

    Asking for combined without -m does not make sense, so -c
    implies -m.

We need to supply -c as default to whatchanged, which is a
one-liner.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
</feed>
