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

Re: [PATCH 1/3] docs: explain why squash merges are broken with long-running branches

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Sep 13, 2020, 15:05 UTC
Message-ID
<CAN0heSo8XsToRm1st4PqPp8PNwc98Csx-+o78J-mh3bbYoneWQ@mail.gmail.com>
In-Reply-To
<20200912204824.2824106-2-sandals@crustytoothpaste.net>

On Sat, 12 Sep 2020 at 22:52, brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 7 quoted lines
>
> In many projects, squash merges are commonly used, primarily to keep a
> tidy history in the face of developers who do not use logically
> independent, bisectable commits.  As common as this is, this tends to
> cause significant problems when squash merges are used to merge
> long-running branches due to the lack of any new merge bases.  Even very
> experienced developers may make this mistakes, so let's add a FAQ entry
s/mistakes/mistake/
> explaining why this is problematic and explaining that regular merge
> commits should be used to merge two long-running branches.
Show 6 quoted lines
> +What kinds of problems can occur when merging long-running branches with squash merges?::
> +       In general, there are a variety of problems that can occur when using squash
> +       merges with long-running branches.  These can include seeing extra commits in
> +       `git log` output, with a GUI, or when using the `...` notation to express a
> +       range, as well as the possibility of needing to re-resolve conflicts again and
> +       again.
Very well-written, as always.

I grepped around a little and couldn't find that we're using this "long- running branch" notion anywhere. I think it might make sense to define/explain that somewhere early, e.g., with something like "... merged repeatedly ... more development...".

So in particular, a "long-running" branch is not something like
  I branched off a long time ago, I've been hacking on this feature for
  a long time and the branch has run quite long with lots of commits.
  Now it's time to merge it and be done with it!

Once that piece of background is in place, what you have here reads very well to me. It was only somewhere halfway through the second paragraph that I got what you meant by "long-running branch".

Martin
Previous: brian m. carlsonNext: brian m. carlson
Message 7 of 13 in “FAQ entries for merges and modified files”
  1. 0/3 FAQ entries for merges and modified filesbrian m. carlson, Sep 12, 2020
  2. 3/3 docs: explain how to deal with files that are always modifiedbrian m. carlson, Sep 12, 2020
  3. Martin ÅgrenSep 13, 2020
  4. 2/3 docs: explain why reverts are not always applied on mergebrian m. carlson, Sep 12, 2020
  5. Martin ÅgrenSep 13, 2020
  6. 1/3 docs: explain why squash merges are broken with long-running branchesbrian m. carlson, Sep 12, 2020
  7. Martin ÅgrenSep 13, 2020
  8. brian m. carlsonSep 13, 2020
  9. Junio C HamanoSep 12, 2020
  10. 0/3 FAQ entries for merges and modified filesbrian m. carlson, Sep 20, 2020
  11. 2/3 docs: explain why reverts are not always applied on mergebrian m. carlson, Sep 20, 2020
  12. 1/3 docs: explain why squash merges are broken with long-running branchesbrian m. carlson, Sep 20, 2020
  13. 3/3 docs: explain how to deal with files that are always modifiedbrian m. carlson, Sep 20, 2020

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.