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:15 UTC
Message-ID
<20080731091515.GC12867@artemis.madism.org>
In-Reply-To
<20080731090348.GB20691@sigill.intra.peff.net>
On Thu, Jul 31, 2008 at 09:03:49AM +0000, Jeff King wrote:
Show 20 quoted lines
> Not necessarily. The logic there goes:
> 
>   1. it's not a revision option, so pass to diff
>   2. it's not a diff opt, so it is unknown; we parsed no options
>   3. the caller sees we failed to parse, so it barfs
> 
> but the logic here is:
> 
>   1. it _is_ a revision option. Our handling of it is just a little odd,
>      in that we need to parse it later, when we are in setup_revisions.
>      So put it aside for now as a "revision" that just happens to look
>      like an option.
>   2. caller sees we parsed, and doesn't complain
>   3. caller later passes the "revision" to setup_revisions, which knows
>      what to do
> 
> Now my patch doesn't just operate on "--all", but rather several other
> options including --no-walk. And maybe that is not right, and --all
> should be handled separately (though I think --remotes would follow the
> same logic). I'm not really sure why --no-walk is separated like that.

--no-walk alters how add_pending_object_with_mode works, which is called by handle_revision_arg. IOW, <ref1> --no-walk <ref2> is not the same as --no-walk <ref1> <ref2>. IOW reference arguments and --no-walk ordering must be preserved, IOW --no-walk is a pseudo-argument like --all --tags or --remote are.

It's okay for parse_revision_opt to take out any option that doesn't alter handle_revision_arg (as for parse_option based parsers it's the sole thing setup_revision will be doing: consuming revisions in a loop with handle_revision_arg), but only those.

The full list (that I made when I wrote parse_revision_opt) is actually:
  pseudo arguments: --all --branches --tags --remotes --reflog
  combining operator: --not
  behavior modifying: --no-walk --do-walk
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Jeff KingNext: Jeff King
Message 14 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.