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

Re: [PATCH v2] blame: avoid checking if a file exists on the working tree if a revision is provided

From
Edmundo Carmona Antoranz <eantoranz@gmail.com>
Date
Nov 17, 2015, 23:37 UTC
Message-ID
<CAOc6etbjCYRp4gbSNRtcngwbh93R67JYZHJn0=D=FeiBm5=FNw@mail.gmail.com>
In-Reply-To
<CAPig+cTjg8yvmLO0uuWZt4nATUnfxJOj4f_AmvRP9mHsGRmEOg@mail.gmail.com>
On Mon, Nov 16, 2015 at 11:11 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 7 quoted lines
>
> This subject is a bit long; try to keep it to about 72 characters or less.
>
> More importantly, though, it doesn't give us a high level overview of
> the purpose of the patch, which is that it is fixing blame to work on
> a file at a given revision even if the file no longer exists in the
> worktree.
Sure!
Show 9 quoted lines
> git-blame documentation does not advertise "blame <file> <rev>" as a
> valid invocation. It does advertise "blame <rev> -- <file>", and this
> case already works correctly even when <file> does not exist in the
> worktree.
>
> git-annotate documentation, on the other hand, does advertise
> "annotate <file> <rev>", and it fails to work when <file> is absent
> from the worktree, so perhaps you want to sell this patch as fixing
> git-annotate instead?

So, do I forget about the blame patch (given that I'm not fixing an advertised syntax, even if it's supported) and fix annotate instead or do I fix both? And if I should swing for both, do I create a single patch or a chain of two patches, one for each builtin?

Show 6 quoted lines
> This example is certainly illustrative, but an even more common case
> may be trying to blame/annotate a file which existed in an older
> revision but doesn't exist anymore at HEAD, thus is absent from the
> worktree. Such a case could likely be described in a sentence or two
> without resorting to verbose examples (though, not a big deal if you
> keep the example).
K.
>
> A new test or two would be welcome, possibly in t/annotate-tests.sh if
> you consider this also fixing git-blame, or in t8001-annotate.sh if
> you're selling it only as a fix for git-annotate.

I guess I'll wait for feedback about my first question before I decide what I will do about the tests.

Thank you very much for your comments, Eric.
Previous: Eric SunshineNext: Edmundo Carmona Antoranz
Message 8 of 9 in “blame: avoid checking if a file exists on the working tree if a revision is provided”
  1. blame: avoid checking if a file exists on the working tree if a revision is providedEdmundo Carmona Antoranz, Nov 17, 2015
  2. Eric SunshineNov 17, 2015
  3. Jeff KingNov 17, 2015
  4. Stefan BellerNov 17, 2015
  5. Eric SunshineNov 17, 2015
  6. Jeff KingNov 17, 2015
  7. Eric SunshineNov 20, 2015
  8. Edmundo Carmona AntoranzNov 17, 2015
  9. Edmundo Carmona AntoranzNov 17, 2015

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.