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

Re: sequencer "edit" command always issues a warning

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 16, 2017, 22:29 UTC
Message-ID
<xmqqy3w4ama4.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170316131534.4vpbub3vmde7maua@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 36 quoted lines
> I was rebasing with the new built-in sequencer code today, and I was
> surprised to see the use of warning() here:
>
>   $ git rebase -i
>   [set one commit to 'edit']
>   warning: stopped at 6ce6b914a... odb_pack_keep(): stop generating keepfile name
>   You can amend the commit now, with
>     [...more instructions...]
>
> It alarmed me for a minute until I realized that no, this is nothing to
> be alarmed about, but just git doing exactly what I told it to do.
>
> The original just wrote:
>
>   Stopped at 6ce6b914a... odb_pack_keep(): stop generating keepfile name
>
> It would be easy to switch back:
>
> diff --git a/sequencer.c b/sequencer.c
> index 1f729b053..8183a83c1 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -1997,7 +1997,8 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
>  			if (item->command == TODO_EDIT) {
>  				struct commit *commit = item->commit;
>  				if (!res)
> -					warning(_("stopped at %s... %.*s"),
> +					fprintf(stderr,
> +						_("Stopped at %s...  %.*s"),
>  						short_commit_name(commit),
>  						item->arg_len, item->arg);
>  				return error_with_patch(commit,
>
> and that would match most of the other messages that the command issues,
> which use a bare fprintf() and start with a capital letter. But I'm not
> sure if there was some reason to treat this one differently.

I doubt there was. At least, I didn't think I read any rationale for switching in logs or in-code comments.

If we stop due to conflicting changes during a "rebase -i" or a range "cherry-pick/revert" session, warning() might make sense, but I agree with you that stopping at "edit" is an expected thing. If we had info("stopped at...") that may be appropriate, but writing it out to stderr is just fine, I would think.

Thanks for spotting.
Previous: Jeff KingNext: Johannes Schindelin
Message 2 of 4 in “sequencer "edit" command always issues a warning”
  1. Jeff KingMar 16, 2017
  2. Junio C HamanoMar 16, 2017
  3. Johannes SchindelinMar 16, 2017
  4. Jeff KingMar 17, 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.