From: Junio C Hamano <gitster@pobox.com>
To: Daniel Vicarel <shundra8820@gmail.com>
Cc: Chris Packham <judge.packham@gmail.com>, GIT <git@vger.kernel.org>
Subject: Re: Why does "merge --continue" expect no arguments?
Date: Thu, 23 Dec 2021 10:35:51 -0800 [thread overview]
Message-ID: <xmqq1r23cgoo.fsf@gitster.g> (raw)
In-Reply-To: <CALRdAfcKSsct1gD87Pkjugttr3pFbXnh0W=kVa95G+9ZpNtLnA@mail.gmail.com> (Daniel Vicarel's message of "Thu, 23 Dec 2021 01:07:56 -0500")
Daniel Vicarel <shundra8820@gmail.com> writes:
> Thanks for the input, all.
>
> Junio C Hamano <gitster@pobox.com> writes:
>> perhaps the doc update would be the quickest one that offers the most to learn from
>
> Sounds good! Now by "doc update" do you mean updating docs in the
> Documentation/ folder, or adding a warning to the CLI output of `git
> merge --continue`?
The former. The current text says "... you can conclude the merge
by running `git merge --continue`" without giving a clue that this
is another way to say "git commit" that is longer to type.
The way it rejects extra arguments happens to work as a safety valve
that is not very end-user friendly; as you found out, it rejects
options and arguments (like pathspec). So "--continue" is more than
a mere synonym to "git commit".
> Junio C Hamano <gitster@pobox.com> writes:
>> coming up with a sensible list of allowed options and arguments [to `git merge --continue`] would be quite hard.
>
> Chris Packham <judge.packham@gmail.com> writes:
>> I think it'd be a good idea to allow [--no-edit on `git merge --continue`] as long as it's the only other option allowed with --continue.
>
> Based on these two pieces of feedback, it sounds like adding _just_
> the `--no-edit` option at this point to `git merge --continue` is
> worthwhile, and hopefully approachable for a newb. For now I'll put a
> pin in it though, and focus on the documentation task above.
Well, I don't know about Chris, but I didn't mean to suggest that by
saying that deciding which ones to allow and which ones to reject is
hard. Knowing that there are other options that deserve the same
attention as `--no-edit` to be supported now makes a patch to only
add support for `--no-edit` an incomplete one. If we need to add
support for more in the future, at least the mechanism used to add
the first one should be something we can reuse in the future for
these other ones.
The way "git commit" is internally invoked from "git merge --continue"
happens to work with the current "we only pass no arguments, and we
exit once the command is done" usage, but it fundamentally is wrong.
No cmd_foo() functions should be called from anything but the
run_builtin() function in git.c, as they are not prepared to be
called twice, and they are not prepared to be called in an
environment where other things (like reading configuration files)
have already happened. If we were to extend what is passed when
"git merge --continue" calls "git commit", we should first clean up
the (ab)use of cmd_commit() call from the code path, before adding
new features.
So, no, I do not think it is a welcome change to just allow passing
"--no-edit" in a way that is "approachable for a newb".
Thanks.
prev parent reply other threads:[~2021-12-23 18:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 14:50 Why does "merge --continue" expect no arguments? Daniel Vicarel
2021-12-21 17:13 ` Junio C Hamano
2021-12-21 17:51 ` Daniel Vicarel
2021-12-21 17:54 ` Daniel Vicarel
2021-12-22 6:20 ` Junio C Hamano
2021-12-21 17:57 ` Philip Oakley
2021-12-24 17:08 ` Ævar Arnfjörð Bjarmason
2021-12-25 2:01 ` Junio C Hamano
2021-12-26 23:31 ` Ævar Arnfjörð Bjarmason
2021-12-27 19:29 ` Junio C Hamano
[not found] ` <CAFOYHZC0r35mfOVUExHsBP5=URKFAt_wDTZ51pTc=XkXyogqKQ@mail.gmail.com>
2021-12-23 6:07 ` Daniel Vicarel
2021-12-23 18:35 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq1r23cgoo.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=judge.packham@gmail.com \
--cc=shundra8820@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).