Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. Do you sqash commits when you merge to main?

Do you sqash commits when you merge to main?

Scheduled Pinned Locked Moved Uncategorized
developmentgitpythonjavajavascript
13 Posts 9 Posters 12 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • satobi@burningboard.netS This user is from outside of this forum
    satobi@burningboard.netS This user is from outside of this forum
    satobi@burningboard.net
    wrote last edited by
    #1

    Do you sqash commits when you merge to main?

    We always kept the full history but i think it is a bit messy for an overview how main changed. Especially if i want to know what changed between two MRs/PRs.

    What are your arguments to do it like you do?

    #development #git #python #java #javascript #go #rust

    graves501@fosstodon.orgG troy@opencoaster.netT kingmaype@mastodon.greenK talesfromthearmchair@hachyderm.ioT diazona@techhub.socialD 6 Replies Last reply
    1
    0
    • R relay@relay.an.exchange shared this topic
    • satobi@burningboard.netS satobi@burningboard.net

      Do you sqash commits when you merge to main?

      We always kept the full history but i think it is a bit messy for an overview how main changed. Especially if i want to know what changed between two MRs/PRs.

      What are your arguments to do it like you do?

      #development #git #python #java #javascript #go #rust

      graves501@fosstodon.orgG This user is from outside of this forum
      graves501@fosstodon.orgG This user is from outside of this forum
      graves501@fosstodon.org
      wrote last edited by
      #2

      @satobi

      IMO it only gets messy if the individual commits/commit messages are messy. Writing meaningful commit messages takes some discipline. So no, I don't squash since I see it as part of the documentation.

      The "conventional commits" approach definitely helps: https://www.conventionalcommits.org/

      satobi@burningboard.netS 1 Reply Last reply
      0
      • satobi@burningboard.netS satobi@burningboard.net

        Do you sqash commits when you merge to main?

        We always kept the full history but i think it is a bit messy for an overview how main changed. Especially if i want to know what changed between two MRs/PRs.

        What are your arguments to do it like you do?

        #development #git #python #java #javascript #go #rust

        troy@opencoaster.netT This user is from outside of this forum
        troy@opencoaster.netT This user is from outside of this forum
        troy@opencoaster.net
        wrote last edited by
        #3

        @satobi nope we don’t and it annoying when contractors or new devs come in trying to keep history clean. Reality is no one is really going through the history that often. I focus on the team having more detailed commits so when we do have to go back we know exactly what happened.

        I like proper merge commits, especially when there’s conflicts. Maybe it’s because we deal with a lot of contractors but it’s saved my butt a lot.

        meejah@mastodon.socialM michalfita@mastodon.socialM 2 Replies Last reply
        0
        • satobi@burningboard.netS satobi@burningboard.net

          Do you sqash commits when you merge to main?

          We always kept the full history but i think it is a bit messy for an overview how main changed. Especially if i want to know what changed between two MRs/PRs.

          What are your arguments to do it like you do?

          #development #git #python #java #javascript #go #rust

          kingmaype@mastodon.greenK This user is from outside of this forum
          kingmaype@mastodon.greenK This user is from outside of this forum
          kingmaype@mastodon.green
          wrote last edited by
          #4

          @satobi

          After a few weeks of microcommitting on a branch, I like to squash and I also keep the branch.

          satobi@burningboard.netS 1 Reply Last reply
          0
          • satobi@burningboard.netS satobi@burningboard.net

            Do you sqash commits when you merge to main?

            We always kept the full history but i think it is a bit messy for an overview how main changed. Especially if i want to know what changed between two MRs/PRs.

            What are your arguments to do it like you do?

            #development #git #python #java #javascript #go #rust

            talesfromthearmchair@hachyderm.ioT This user is from outside of this forum
            talesfromthearmchair@hachyderm.ioT This user is from outside of this forum
            talesfromthearmchair@hachyderm.io
            wrote last edited by
            #5

            @satobi Keep the full history, but rebase and do a --no-ff merge each time. That way you can look through history as an "express train" (just focusing on the one-per-PR merge commits) or as a "stopping train" (seeing every commit) https://pdh11.blogspot.com/2013/06/bow-shaped-branches-git-workflow.html

            satobi@burningboard.netS 1 Reply Last reply
            0
            • troy@opencoaster.netT troy@opencoaster.net

              @satobi nope we don’t and it annoying when contractors or new devs come in trying to keep history clean. Reality is no one is really going through the history that often. I focus on the team having more detailed commits so when we do have to go back we know exactly what happened.

              I like proper merge commits, especially when there’s conflicts. Maybe it’s because we deal with a lot of contractors but it’s saved my butt a lot.

              meejah@mastodon.socialM This user is from outside of this forum
              meejah@mastodon.socialM This user is from outside of this forum
              meejah@mastodon.social
              wrote last edited by
              #6

              @troy @satobi I don't like squash merging.

              As above, history exists. Often when you need to delve into a branch, I've found having the "real" commits ("oops", "cleanup", "refactor slightly") etc can help. It's not infrequently that the "simple cleanup" introduced a weird bug.

              Besides, if you want to see "nice clean history", then use "git log --merges" on main and you'll only see the PRs.

              satobi@burningboard.netS 1 Reply Last reply
              0
              • satobi@burningboard.netS satobi@burningboard.net

                Do you sqash commits when you merge to main?

                We always kept the full history but i think it is a bit messy for an overview how main changed. Especially if i want to know what changed between two MRs/PRs.

                What are your arguments to do it like you do?

                #development #git #python #java #javascript #go #rust

                diazona@techhub.socialD This user is from outside of this forum
                diazona@techhub.socialD This user is from outside of this forum
                diazona@techhub.social
                wrote last edited by
                #7

                @satobi No, absolutely not. Because on a main branch it's often useful to maintain invariants like, the branch tip should always compile and pass tests, and each "step" from one main branch tip to the next should represent a coherent functional change in the software (e.g. a feature or bug fix), but when reviewing the history of the code it's often useful to see each functional change broken down in more granularity than that, so that you understand the story of how the change was made. (For example, in test driven development, you might write the tests in one step and write the code that makes them pass in a later step.) You can only get the benefits of both approaches if you don't squash commits.

                Though, when I'm working I do make tiny commits like "fix", "WIP on thing", "checkpoint - some tests pass", and _those_ I do squash, but I usually do that before even pushing the branch. Those tiny incremental commits are just "implementation details".

                #development #Git

                1 Reply Last reply
                0
                • troy@opencoaster.netT troy@opencoaster.net

                  @satobi nope we don’t and it annoying when contractors or new devs come in trying to keep history clean. Reality is no one is really going through the history that often. I focus on the team having more detailed commits so when we do have to go back we know exactly what happened.

                  I like proper merge commits, especially when there’s conflicts. Maybe it’s because we deal with a lot of contractors but it’s saved my butt a lot.

                  michalfita@mastodon.socialM This user is from outside of this forum
                  michalfita@mastodon.socialM This user is from outside of this forum
                  michalfita@mastodon.social
                  wrote last edited by
                  #8

                  @troy @satobi I'm in agreement with you on that.

                  1 Reply Last reply
                  0
                  • satobi@burningboard.netS satobi@burningboard.net

                    Do you sqash commits when you merge to main?

                    We always kept the full history but i think it is a bit messy for an overview how main changed. Especially if i want to know what changed between two MRs/PRs.

                    What are your arguments to do it like you do?

                    #development #git #python #java #javascript #go #rust

                    inguin@nerdculture.deI This user is from outside of this forum
                    inguin@nerdculture.deI This user is from outside of this forum
                    inguin@nerdculture.de
                    wrote last edited by
                    #9

                    @satobi I never squash.

                    I require the MR author to create a sequence of logically separate, easily reviewable commits, with detailed log messages describing what was changed and why. Squashing would waste all that work.

                    When the MR is accepted I rebase it on top of the target branch so we get a linear history, but that's only a matter of taste. We use merge commits only for concurrently maintained release lines.

                    1 Reply Last reply
                    0
                    • graves501@fosstodon.orgG graves501@fosstodon.org

                      @satobi

                      IMO it only gets messy if the individual commits/commit messages are messy. Writing meaningful commit messages takes some discipline. So no, I don't squash since I see it as part of the documentation.

                      The "conventional commits" approach definitely helps: https://www.conventionalcommits.org/

                      satobi@burningboard.netS This user is from outside of this forum
                      satobi@burningboard.netS This user is from outside of this forum
                      satobi@burningboard.net
                      wrote last edited by
                      #10

                      @graves501

                      I don‘t want to hear, that my discipline is the problem🫠😂
                      But yes I spend not enough time an attention at the commit messages so they aren‘t as clear as they should.

                      I want to learn that👍

                      1 Reply Last reply
                      0
                      • meejah@mastodon.socialM meejah@mastodon.social

                        @troy @satobi I don't like squash merging.

                        As above, history exists. Often when you need to delve into a branch, I've found having the "real" commits ("oops", "cleanup", "refactor slightly") etc can help. It's not infrequently that the "simple cleanup" introduced a weird bug.

                        Besides, if you want to see "nice clean history", then use "git log --merges" on main and you'll only see the PRs.

                        satobi@burningboard.netS This user is from outside of this forum
                        satobi@burningboard.netS This user is from outside of this forum
                        satobi@burningboard.net
                        wrote last edited by
                        #11

                        @meejah @troy

                        Okay nice to learn from your experience.

                        Git log - -name-only is exactly what I need to have and so I can keep the history 👍

                        Thank you!

                        1 Reply Last reply
                        0
                        • kingmaype@mastodon.greenK kingmaype@mastodon.green

                          @satobi

                          After a few weeks of microcommitting on a branch, I like to squash and I also keep the branch.

                          satobi@burningboard.netS This user is from outside of this forum
                          satobi@burningboard.netS This user is from outside of this forum
                          satobi@burningboard.net
                          wrote last edited by
                          #12

                          @KingmaYpe

                          Why do you do microcommitting? And what does it mean to you?

                          1 Reply Last reply
                          1
                          0
                          • talesfromthearmchair@hachyderm.ioT talesfromthearmchair@hachyderm.io

                            @satobi Keep the full history, but rebase and do a --no-ff merge each time. That way you can look through history as an "express train" (just focusing on the one-per-PR merge commits) or as a "stopping train" (seeing every commit) https://pdh11.blogspot.com/2013/06/bow-shaped-branches-git-workflow.html

                            satobi@burningboard.netS This user is from outside of this forum
                            satobi@burningboard.netS This user is from outside of this forum
                            satobi@burningboard.net
                            wrote last edited by
                            #13

                            @TalesFromTheArmchair

                            Ahh interesting approach. I think it gets harder with many Developers. Have you experience with that?

                            1 Reply Last reply
                            1
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups