git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Mike Rappazzo <rappazzo@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Michael Rappazzo via GitGitGadget <gitgitgadget@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH 0/1] sequencer: comment out the 'squash!' line
Date: Mon, 6 Jan 2020 19:36:39 -0800	[thread overview]
Message-ID: <20200107033639.GH92456@google.com> (raw)
In-Reply-To: <20200106193253.GA971477@coredump.intra.peff.net>

Jeff King wrote:

> But I thought that was the point of "squash" versus "fixup"? One
> includes the commit message, and the other does not.
>
> I do think "commit --squash" is mostly useless for that reason, and I
> suspect we could do a better job in the documentation about pushing
> people to "--fixup".
>
> But --squash _can_ be useful with other options to populate the commit
> message (e.g., "--edit", which just pre-populates the subject with the
> right "squash!" line but lets you otherwise write a normal commit
> message). If that's the workflow you're using, then I'm sympathetic to
> auto-removing just a "squash!" line, as it's automated garbage that is
> only meant as a signal for --autosquash.

It's a signal for --autosquash and it gives a visual signal to humans
of where the squashed commit came from.

--squash already implies --edit, supporting this kind of workflow.

If we could turn back time and start over, would we want something
like the following?

 1. if someone leaves the squash! message as is, include it as is in
    the commit message without commenting out

 2. if someone edits the squash! commit message to include a body
    describing what is being squashed in, include the squash! line as
    part of the commented marker

 3. if someone leaves the (uncommented) squash! message in after being
    presented with an editor at --autosquash time, reopen the editor
    with some text verifying they really meant to do that

It's rare that concatenated commit messages make sense to be used as
is, especially when trailers (sign-offs, Fixes, etc) are involved.  I
suspect that (3) is more important than (2) here --- we're using the
same space in the editor for input and output, and the result is a
kind of error-prone process of getting the output right.

Since we can't turn back time, one possibility would be to make tools
like "git show --check" notice the squash! lines.  Would that be
useful?

One nice thing about (2) is that it's unlikely to affect scripted use.
Thoughts?

Thanks,
Jonathan

  reply	other threads:[~2020-01-07  3:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06 16:04 [PATCH 0/1] sequencer: comment out the 'squash!' line Michael Rappazzo via GitGitGadget
2020-01-06 16:04 ` [PATCH 1/1] " Michael Rappazzo via GitGitGadget
2020-01-06 17:10   ` Phillip Wood
2020-01-06 17:34     ` Mike Rappazzo
2020-01-06 17:32 ` [PATCH 0/1] " Junio C Hamano
2020-01-06 19:20   ` Mike Rappazzo
2020-01-06 19:32     ` Jeff King
2020-01-07  3:36       ` Jonathan Nieder [this message]
2020-01-07 11:15         ` Jeff King
2020-01-06 20:41     ` Junio C Hamano
2020-01-07  1:34     ` brian m. carlson
2020-01-07 16:15       ` Junio C Hamano
2020-01-08  2:55         ` brian m. carlson
2020-01-08 13:23           ` Johannes Schindelin
2020-01-08 16:53           ` Junio C Hamano

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=20200107033639.GH92456@google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=rappazzo@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).