git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Detecting squash-merged branches (and question about git-diff-tree)

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Dec 3, 2024, 15:30 UTC
Message-ID
<75269425-49ee-4a16-beef-614da392d528@app.fastmail.com>
In-Reply-To
<Z08N4AlQKiNi-IOI@framework>
Hi Max
On Tue, Dec 3, 2024, at 14:55, Max Gautier wrote:
Show 13 quoted lines
> Hi,
>
> I tend to work on project which do a lot of "squash-merging" e.g, merge
> branches by having a robot squash the branch in a new commit on top of
> the main branch.
>
> This makes it a bit hard to remove my branches when they are
> "squash-merged" (in contrast to using `git branch --merged`)
>
>
> I started a little script to detect such branches; initially I used git
> cherry, but this only detect the case where the branch has 1 commit,
> which is not enough.

I’m working on a program/script to detect merged/squashed/rebased (or cherry-picked) refs. Is it okay if I contact you if I finish it? ;)

There’s also this program which says it can do the same thing (not tried):
https://github.com/foriequal0/git-trim

My program tries to be like a for-each-ref for merged etc. refs. More focused on reporting first since that can then be used for deletion or whatever else.

Previous: Max GautierNext: Max Gautier
Message 2 of 5 in “Detecting squash-merged branches (and question about git-diff-tree)”
  1. Max GautierDec 3, 2024
  2. Kristoffer HaugsbakkDec 3, 2024
  3. Max GautierDec 3, 2024
  4. Kristoffer HaugsbakkDec 3, 2024
  5. Max GautierDec 3, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.