git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Vojtěch Vladyka" <Vojtech.Vladyka@velux.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Removing fully-merged branches
Date: Thu, 10 Jun 2021 10:41:24 +0900	[thread overview]
Message-ID: <xmqqwnr2h4xn.fsf@gitster.g> (raw)
In-Reply-To: <DBAPR05MB7510441970BA87A456B8C0D8EC369@DBAPR05MB7510.eurprd05.prod.outlook.com> ("Vojtěch Vladyka"'s message of "Wed, 9 Jun 2021 09:05:22 +0000")

Vojtěch Vladyka <Vojtech.Vladyka@velux.com> writes:

> I know there are command chains doing this job usually starting
> with git branch --merged followed by grep and ending with git
> branch -d but my point is why such functionality isn't in git
> client already when he has all pieces of information already and
> ability to do all of that. Maybe I am missing some reason behind
> that but to me it looks like missing feature.

I think the primary reason behind it is because the way to "prune"
(i.e. you gave a good outline yourself in your messaage) is
trivially discoverable and people can do so with more flexibility
than a hardcoded "remove every branch that does not have commits
that does not exist in the $master branch".  Add to it the fact that
those who want to make it into a "native" feature haven't produced
any usable design yet [*].

In my repository that is used to develop Git itself, for example,
"remove all branches that are merged to 'master'" is not something
I'd ever want to run, as it will lose all the maintenance tracks (it
is a rule in this project that older maintenance branches are subset
of the newer ones and the 'master' branch), and removing all topic
branches that are merged to 'maint' would not get rid of as many
stale topic branches that are already merged to 'master' and will
never be merged down to 'maint' or older maintenance tracks, so for
such a feature to be useful, I'd need to be able to express
something like:

 - If a branch is not a topic branch (identifyable by having
   two-level names like vv/topic), do not touch it.

 - If a topic branch is based on 'maint' but not merged there yet,
   keep it.

 - If a topic branch is merged to 'master' and in a tagged version
   (identifyable by having a signed tag whose name does not end with
   -rcX), lose it.

So that a bugfix topic that has appeared in the last feature release
can be kept to later be merged down to older maintenance tracks.


[Footnote]

 * As far as I remember, the message I am responding to might be the
   first to explicitly ask for such a feature.

  reply	other threads:[~2021-06-10  1:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  9:05 Removing fully-merged branches Vojtěch Vladyka
2021-06-10  1:41 ` Junio C Hamano [this message]
2021-06-10  5:07   ` Vojtěch Vladyka

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=xmqqwnr2h4xn.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Vojtech.Vladyka@velux.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public 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).