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

Re: [PATCH v1] 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, 01:16 UTC
Message-ID
<CAOc6etbsqZ=gTGido2b3FXZyY+1JRkeF1O9pk37+7qOogaN6oA@mail.gmail.com>
In-Reply-To
<1447722437-14937-1-git-send-email-eantoranz@gmail.com>

On Mon, Nov 16, 2015 at 7:07 PM, Edmundo Carmona Antoranz <eantoranz@gmail.com> wrote:

> -               if (!file_exists(path))
> -                       die_errno("cannot stat path '%s'", path);

Two things: 1 What I would love to do is check if revisions were provided. Something like:

if (no_revisions() && !file_exists(path))
    die_errno("cannot stat path '%s'", path);

_but_ revisions are set up a little bit later. I don't know right now if I could just move it up (I don't think it would be that simple because I see there's some messing up with argv and argc in that 'if' that encloses the lines I'm removing). Maybe it would make sense to move the check for file existence to _after_ revisions have been set up? Even without the check for revisions, it's behaving kind of the way I mean it to. But I'm sure it'd be more elegant if I checked if revisions were provided.

2 It makes sense to create test cases for this patch, right?
Looking forward to your comments. Thanks in advance.
Previous: Edmundo Carmona AntoranzNext: Edmundo Carmona Antoranz
Message 2 of 3 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. Edmundo Carmona AntoranzNov 17, 2015
  3. 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.