git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Vishal Verma <vishal@kernel.org>
Cc: git@vger.kernel.org, "Vishal Verma" <vishal@stellar.sh>,
	"Rafael Ascensão" <rafa.almas@gmail.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH v4] merge: refuse --commit with --squash
Date: Tue, 28 May 2019 12:07:29 -0700	[thread overview]
Message-ID: <xmqq1s0i2ya6.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190524183617.8291-1-vishal@kernel.org> (Vishal Verma's message of "Fri, 24 May 2019 12:36:17 -0600")

Vishal Verma <vishal@kernel.org> writes:

> From: Vishal Verma <vishal@stellar.sh>
>
> Convert option_commit to tristate, representing the states of
> 'default/untouched', 'enabled-by-cli', 'disabled-by-cli'. With this in
> place, check whether option_commit was enabled by cli when squashing a
> merge. If so, error out, as this is not supported.
>
> Previously, when --squash was supplied, 'option_commit' was silently
> dropped. This could have been surprising to a user who tried to override
> the no-commit behavior of squash using --commit explicitly.
>
> Add a note to the --squash option for git-merge to clarify the
> incompatibility, and add a test case to t7600-merge.sh
>
> Cc: Junio C Hamano <gitster@pobox.com>
> Cc: Rafael Ascensão <rafa.almas@gmail.com>
> Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> Signed-off-by: Vishal Verma <vishal@stellar.sh>
> ---

I personally feel that "merge --squash --commit" that does not
complain and leaves the result in the working tree to be tweaked and
then committed is perfectly fine, especially given that the reason
why "--commit" option exists is primarily because we need to allow
"--no-commit" to stop the normal merge from recording the result in
a new commit.

A user who really wanted to record what a merge would bring to the
current state in a single-parent commit would have to do "git
commit" after that anyway, and with this patch, the user would
instead need to run the same "git merge" command again, without
"--commit", before being able to do so, so in the sense, it is
likely that this change makes it more cumbersome to use for such a
user to use the command. 

But I guess that this change will give an incentive to actually
allow the combination to "just work" by making it more obvious that
the combination is not supported, so it would be a slight
improvement in that sense ;-)

      reply	other threads:[~2019-05-28 19:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 22:53 [PATCH v3] builtin/merges: clarify --squash behavior with --commit Vishal Verma
2019-05-24 18:36 ` [PATCH v4] merge: refuse --commit with --squash Vishal Verma
2019-05-28 19:07   ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1s0i2ya6.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=rafa.almas@gmail.com \
    --cc=vishal@kernel.org \
    --cc=vishal@stellar.sh \
    --subject='Re: [PATCH v4] merge: refuse --commit with --squash' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).