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

Re: [PATCH] Functions for updating refs.

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 5, 2007, 00:16 UTC
Message-ID
<7vd4wym0ec.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1b46aba20709041632x60ee4d3eweae9f5217d2f3b86@mail.gmail.com>
"Carlos Rica" <jasampler@gmail.com> writes:
Show 7 quoted lines
>>  - Why doesn't "or_error" side allow "flags" as "or_die" one?
>>    Could the 'quiet' option become part of "flags" perhaps?
>
> I saw that the only code that needed the flags was the
> builtin-update-ref.c, and it also needed to die(). The
> others I saw only want that parameter set to 0.
> builtin-tag.c was doing die() also, not using flags, though.

Ok, when other built-ins start using these functions, they might want to pass different flags, but it is easy enough for us to extend the interface later.

Show 7 quoted lines
>>  - They look quite similar.  Is it a good idea to refactor them
>>    further, or they are so small it does not matter?
>
> The function die() returns 128 and terminates the program,
> prepending "fatal: " in the message, while error() doesn't exit
> and prepend "error: ", so they were very different and I
> resolved to separate them.
Fair enough.
>>  - Why isn't lock released with unlock_ref()?
>
> I inspected this some weeks ago, and I finally came to think
> that it is released in the write_ref_sha1 call after the lock.
Ah, that's right!
Previous: Carlos Rica
Message 10 of 10 in “Functions for updating refs.”
  1. Functions for updating refs.Carlos Rica, Sep 4, 2007
  2. Johannes SchindelinSep 4, 2007
  3. Johannes SixtSep 4, 2007
  4. Johannes SchindelinSep 4, 2007
  5. Johannes SixtSep 4, 2007
  6. Karl HasselströmSep 4, 2007
  7. Johannes SchindelinSep 4, 2007
  8. Junio C HamanoSep 4, 2007
  9. Carlos RicaSep 4, 2007
  10. Junio C HamanoSep 5, 2007

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.