Git Mailing List Archive on lore.kernel.org
 help / color / Atom feed
From: Bryan Turner <bturner@atlassian.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	Git Users <git@vger.kernel.org>,
	phillip.wood123@gmail.com,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH] rebase -i: mark commits that begin empty in todo editor
Date: Thu, 9 Apr 2020 19:06:42 -0700
Message-ID: <CAGyf7-H4jtnVjgZ20qC-mzJHRd7Ffqm=Vh18wJPiiSS4NPnhyQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqimi8kvue.fsf@gitster.c.googlers.com>

On Thu, Apr 9, 2020 at 5:50 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Elijah Newren <newren@gmail.com>
> >
> > While many users who intentionally create empty commits do not want them
> > thrown away by a rebase, there are third-party tools that generate empty
> > commits that a user might not want.  In the past, users have used rebase
> > to get rid of such commits (a side-effect of the fact that the --apply
> > backend is not currently capable of keeping them).  While such users
> > could fire up an interactive rebase and just remove the lines
> > corresponding to empty commits, that might be difficult if the
> > third-party tool generates many of them.  Simplify this task for users
> > by marking such lines with a suffix of " # empty" in the todo list.
> >
> > Suggested-by: Sami Boukortt <sami@boukortt.com>
> > Signed-off-by: Elijah Newren <newren@gmail.com>
> > ---
> >     rebase -i: mark commits that begin empty in todo editor
> >
> >     If this isn't enough, we could talk about resurrecting --no-keep-empty
> >     (and making --keep-empty just exist to countermand an earlier
> >     --no-keep-empty), but perhaps this is good enough?
>
> This does look like an unsatisfying substitute for the real thing,
> but perhaps looking for " # empty" and turning them a drop is simple
> enough?  Emacs types may do something like
>
>     C-x h C-u M-|
>     sed -e '/ # empty$/s/^pick /drop /'
>     <RET>
>
> and vi folks have something similar that begins with a ':'.
>
> But it would not beat just being able to say "--no-keep-empty" (or
> "--discard-empty"), would it?
>
> On the other hand, even if there were "--discard-empty" available,
> there may still be two classes of empty ones (e.g. ones that were
> created by third-party tools, the others that were deliberately
> empty) that the user may need and want to sift through, and for such
> a use case, the marking this patch does would be very valuable.
>
> So, from that point of view, this may not be enough, but a "throw
> away all" option is not enough, either.  We'd want to have both to
> serve such users better.

This was why I wondered whether it might be worth extending the
--empty option to add another possible value, like "drop-all", that
would allow the caller to say they want to drop all empty
commits--both those that started out empty and those that became
empty. That fourth mode would be distinct from the existing three.
(I'm not sure what to call said mode; "drop-all" looks odd alongside
the existing "drop". I just say "drop-all" here to help illustrate the
idea.)

  reply index

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 23:26 Elijah Newren via GitGitGadget
2020-04-10  0:50 ` Junio C Hamano
2020-04-10  2:06   ` Bryan Turner [this message]
2020-04-10  4:57     ` Junio C Hamano
2020-04-10 17:51 ` [PATCH v2 0/3] " Elijah Newren via GitGitGadget
2020-04-10 17:51   ` [PATCH v2 1/3] " Elijah Newren via GitGitGadget
2020-04-10 17:51   ` [PATCH v2 2/3] rebase: reinstate --no-keep-empty Elijah Newren via GitGitGadget
2020-04-10 20:37     ` Junio C Hamano
2020-04-10 21:41       ` Elijah Newren
2020-04-10 17:51   ` [PATCH v2 3/3] rebase: fix an incompatible-options error message Elijah Newren via GitGitGadget
2020-04-10 20:42   ` [PATCH v2 0/3] rebase -i: mark commits that begin empty in todo editor Junio C Hamano
2020-04-10 21:04     ` Junio C Hamano
2020-04-10 21:14       ` Junio C Hamano
2020-04-10 22:11         ` Elijah Newren
2020-04-10 21:29     ` Junio C Hamano
2020-04-10 22:13       ` Elijah Newren
2020-04-10 22:30         ` Junio C Hamano
2020-04-11  0:07           ` Elijah Newren
2020-04-11 21:14             ` Junio C Hamano
2020-04-11  2:44   ` [PATCH v3 0/4] " Elijah Newren via GitGitGadget
2020-04-11  2:44     ` [PATCH v3 1/4] " Elijah Newren via GitGitGadget
2020-04-15 20:52       ` Junio C Hamano
2020-04-11  2:44     ` [PATCH v3 2/4] rebase: reinstate --no-keep-empty Elijah Newren via GitGitGadget
2020-04-11  2:44     ` [PATCH v3 3/4] rebase: fix an incompatible-options error message Elijah Newren via GitGitGadget
2020-04-11  2:44     ` [PATCH v3 4/4] rebase --merge: optionally skip upstreamed commits Jonathan Tan via GitGitGadget
2020-04-11 18:12       ` Jonathan Tan
2020-04-14  9:11     ` [PATCH v3 0/4] rebase -i: mark commits that begin empty in todo editor Phillip Wood
2020-04-10 17:25 [PATCH] " Lia Rosas

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='CAGyf7-H4jtnVjgZ20qC-mzJHRd7Ffqm=Vh18wJPiiSS4NPnhyQ@mail.gmail.com' \
    --to=bturner@atlassian.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=phillip.wood123@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

Git Mailing List Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/git/0 git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ https://lore.kernel.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.git


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git