git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git blame not respecting --find-copies-harder ?

From
Pierre Habouzit <madcoder@debian.org>
Date
Jul 31, 2008, 09:06 UTC
Message-ID
<20080731090646.GB12867@artemis.madism.org>
In-Reply-To
<20080731090146.GA12867@artemis.madism.org>
On Thu, Jul 31, 2008 at 09:01:46AM +0000, Pierre Habouzit wrote:
Show 33 quoted lines
> On Thu, Jul 31, 2008 at 08:35:33AM +0000, Junio C Hamano wrote:
> > Jeff King <peff@peff.net> writes:
> > 
> > > On Thu, Jul 31, 2008 at 12:36:59AM -0700, Junio C Hamano wrote:
> > >
> > >> Alas, shortlog does not take --all.  Yes, I know
> > >> 
> > >> 	git log --since=3.day --all | git shortlog | sort | uniq -c
> > >> 
> > >> is an obvious workaround, but it is mildly irritating.
> > >
> > > Hmm. Could it be as simple as:
> > >
> > > diff --git a/revision.c b/revision.c
> > > index a843c42..eaa5572 100644
> > > --- a/revision.c
> > > +++ b/revision.c
> > > @@ -1002,7 +1002,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
> > >  	    !strcmp(arg, "--no-walk") || !strcmp(arg, "--do-walk"))
> > >  	{
> > >  		unkv[(*unkc)++] = arg;
> > > -		return 0;
> > > +		return 1;
> > >  	}
> > >  
> > >  	if (!prefixcmp(arg, "--max-count=")) {
> > >
> > > That is, handle_revision_opt says "yes we parsed this, and it should be
> > > gone" even though it still gets stuck in the "unknown" section to be
> > > parsed by setup_revisions later.
> 
>   Ack this is a correct fix. I wonder how this even works with other
> commands that use --all and stuff like that.

Oh actually I know: the parse_revision_opt machinery (that is buggy because of this 0 result) is used in git-blame where --all is meaningless anyways, and ... git-shortlog only. The legacy way to parse revision options does not treats `0' answers differently from `1' actually, I wonder why, because this is probably wrong.

This was a regression, I suppose prior to its parse-optification git-shortlog accepted --all (and I see no valid reason for it not to).

Thanks a lot to Jeff for the good catch.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Jeff KingNext: Jeff King
Message 12 of 17 in “git blame not respecting --find-copies-harder ?”
  1. Stephen R. van den BergJul 30, 2008
  2. Björn SteinbrinkJul 30, 2008
  3. Sverre RabbelierJul 30, 2008
  4. Jeff KingJul 31, 2008
  5. Junio C HamanoJul 31, 2008
  6. Jeff KingJul 31, 2008
  7. Junio C HamanoJul 31, 2008
  8. Jeff KingJul 31, 2008
  9. Junio C HamanoJul 31, 2008
  10. Pierre HabouzitJul 31, 2008
  11. Jeff KingJul 31, 2008
  12. Pierre HabouzitJul 31, 2008
  13. Jeff KingJul 31, 2008
  14. Pierre HabouzitJul 31, 2008
  15. Jeff KingJul 31, 2008
  16. Pierre HabouzitJul 31, 2008
  17. Jeff KingJul 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.