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

Re: [PATCH] builtin/tag.c: return appropriate value when --points-at finds an empty list

From
George Papanikolaou <g3orge.app@gmail.com>
Date
Dec 11, 2017, 15:25 UTC
Message-ID
<CAByyCQDBtCdxB9fLUeH6A8o-g444TO_yD+O7ap8RO2Bg0b6aAA@mail.gmail.com>
In-Reply-To
<ca421d38-2d9a-8681-7947-3799c59984a7@gmail.com>

I agree with what you're saying, just I thought this might be ultra-minor for API-breakage. To me, 0 doesn't necessarily mean "I didn't segfault". I lot of tools use ret-values to give information back. And that way it's much easier to just `||` the command to something else instead of `[[ -z ]]` in the script.

But I see what you're saying... -- /ΓΠ

On Mon, Dec 11, 2017 at 4:05 PM, Derrick Stolee <stolee@gmail.com> wrote:
Show 19 quoted lines
> On 12/11/2017 8:44 AM, George Papanikolaou wrote:
>>
>> `git tag --points-at` can simply return if the given rev does not have
>> any tags pointing to it. It's not a failure but it shouldn't return
>> with 0 value.
>
>
> I disagree. I think the 0 return means "I completed successfully" and the
> empty output means "I didn't find any tags pointing to this object."
>
> Changing the return value here could break a lot of scripts out in the wild,
> and I consider this to be an "API" compatibility that needs to stay as-is.
>
> What are you using "--points-at" where you need a nonzero exit code instead
> of a different indicator?
>
> Thanks,
> -Stolee
>
Previous: Derrick Stolee
Message 3 of 3 in “builtin/tag.c: return appropriate value when --points-at finds an empty list”
  1. builtin/tag.c: return appropriate value when --points-at finds an empty listGeorge Papanikolaou, Dec 11, 2017
  2. Derrick StoleeDec 11, 2017
  3. George PapanikolaouDec 11, 2017

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.