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

Re: [PATCH] sha1_name.c: add an option to abort on ambiguous refs

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 23, 2016, 15:45 UTC
Message-ID
<alpine.DEB.2.20.1603231642580.4690@virtualbox>
In-Reply-To
<1458739840-15855-1-git-send-email-pclouds@gmail.com>
Hi Duy,
On Wed, 23 Mar 2016, Nguyễn Thái Ngọc Duy wrote:
> There are cases when a warning on ambiguous refs may go unnoticed
> (e.g. git-log filling up the whole screen). There are also cases when
> people want to catch ambiguity early (e.g. it happens deep in some
> script). In either case, aborting the program would accomplish it.

Whenever I see a die() in code outside of builtin/*.c, I cringe. I do that because it was *exactly* something like that that caused a serious regression in the builtin am so that we had to resort back to spawning separate processes *just so* that we could catch error conditions and run certain code in that case.

Maybe there would be a way to do what you want to do that does not fly in the face of libification? Maybe some strbuf with an atexit() that accumulates fatal errors that might be hidden and that are then written at the end of the program (colorfully, if isatty(2))?

Ciao, Dscho

Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 2 of 4 in “sha1_name.c: add an option to abort on ambiguous refs”
  1. sha1_name.c: add an option to abort on ambiguous refsNguyễn Thái Ngọc Duy, Mar 23, 2016
  2. Johannes SchindelinMar 23, 2016
  3. Duy NguyenMar 23, 2016
  4. Duy NguyenJun 28, 2016

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.