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

Re: git tag -s: TAG_EDITMSG should not be deleted upon failures

From
Jeff King <peff@peff.net>
Date
Dec 6, 2008, 21:54 UTC
Message-ID
<20081206215400.GA29440@coredump.intra.peff.net>
In-Reply-To
<7v8wqtvvql.fsf@gitster.siamese.dyndns.org>
On Sat, Dec 06, 2008 at 01:28:50PM -0800, Junio C Hamano wrote:
> Thanks.  I love patches that addresses bugs during -rc period.

Well, I'm not sure this was a bug fix versus an improvement, but at least wasn't an all new feature. And it was short enough to look at in one sitting.

Of course, I did still manage to introduce a bug in my 4-line change...;)

Show 5 quoted lines
>     - the "path" variable is uninitialized if we do not start editor at
>       all, so unlink(path) and free(path) have a very high chance of
>       failing.
> 
>       I think you need [Update #1] below squashed in to fix this.
Oops. Yes, that is definitely a problem.
> [Update #1]
> [...]
> -	char *path;
> +	char *path = NULL;
Right, that fix looks good.
Show 6 quoted lines
> +	if (build_tag_object(buf, sign, result) < 0) {
> +		if (path)
> +			fprintf(stderr, "What you edited in your editor is left in %s",
> +				path);
> +		exit(128);
> +	}
Much better, though the message is a bit awkward. How about
  "The tag message has been left in %s"
?
Do you want me to resend, or do you want to fix up locally?
-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “git tag -s: TAG_EDITMSG should not be deleted upon failures”
  1. Christian JaegerDec 3, 2008
  2. Jeff KingDec 6, 2008
  3. Jeff KingDec 6, 2008
  4. Junio C HamanoDec 6, 2008
  5. Jeff KingDec 6, 2008
  6. Junio C HamanoDec 6, 2008

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.