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

Re: --follow is ignored when used with --reverse

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 2, 2013, 19:11 UTC
Message-ID
<7v38rw93pp.fsf@alter.siamese.dyndns.org>
In-Reply-To
<87vc4t9tn5.fsf@linux-k42r.v.cablecom.net>
Thomas Rast <trast@inf.ethz.ch> writes:
Show 20 quoted lines
> Lukas Fleischer <git@cryptocrack.de> writes:
>
>> On Tue, Jul 02, 2013 at 10:19:36AM +0100, John Keeping wrote:
> [...]
>>>     $ git log --oneline --follow builtin/clone.c | wc -l
>>>     125
>>>     $ git log --oneline --follow --reverse builtin/clone.c | wc -l
>>>     3
>>
>> I just wanted to point out that it works fine when specifying the *original*
>> file name (which kind of makes sense given that everything is done in reverse
>> order):
> [...]
>> However, that also doesn't seem to work for builtin/clone.c:
>>
>>     $ git log --oneline --follow --reverse -- builtin-clone.c | wc -l
>>     65
>
> I'm pretty sure that is simply because --follow iis a horrible hack,
> known to be broken in many ways.

The machinery the follow uses simplifies the history with dynamic pathspec correctly (in a simple history, at least), but the output is coupled too strongly to the traversal. If you collect all the revs you will show first, reverse them and then try to show (which is what --reverse essentially is), the dynamic pathspec used for each rev is long gone.

Perhaps we should make --follow mutually incompatible with problematic options (I suspect --reverse is not the only case) at the command line parser level to avoid hurting users.

Previous: John KeepingNext: Johannes Sixt
Message 8 of 9 in “--follow is ignored when used with --reverse”
  1. Alois MahdalMay 23, 2013
  2. alois.mahdal.1-ndmail@zxcvb.czJul 2, 2013
  3. Ramkumar RamachandraJul 2, 2013
  4. John KeepingJul 2, 2013
  5. Lukas FleischerJul 2, 2013
  6. Thomas RastJul 2, 2013
  7. John KeepingJul 2, 2013
  8. Junio C HamanoJul 2, 2013
  9. Johannes SixtJul 2, 2013

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.