Squash Merge Commits

15 views
Skip to first unread message

Sam Ryan

unread,
Sep 13, 2020, 11:50:56 PM9/13/20
to Pyomo Developers
Hello! I'm totally new here so please let me know if there is good reason that the team is not using this :)

I'm wondering if there is a reason that squash merge commits are not used in the GitHub repo? Squash merges (an option on GitHub), will combine the whole PR into a single commit with a link to the PR in the description. More here.

I have had a few times where I wanted to reference where a line of code came from and it would have been nice to easily be able to refer to all the conversation in a PR via git blame (rather than only be able to find a solo commit that is unlikely to have the same context as the full PR).

Siirola, John D

unread,
Sep 14, 2020, 12:17:25 PM9/14/20
to pyomo-de...@googlegroups.com

Sam,

 

This is a fine place for discussions. 

 

There isn’t a good answer to your question in that to the best of my recollection, we never discussed it.  Pyomo started off in Subversion, so when we migrated to Git, we kept almost everything the same.  I also think there was a desire to keep the full history both so that original attribution was kept intact, and to encourage smaller commits with more targeted commit messages to help understand intent when using git blame (this was important because we regularly have large, long-running PRs with lots of moving parts and a squash merge would obfuscate the development thoughts).

 

Fortunately, GitHub helps a lot with this.  If you are looking at a blame through GitHub (e.g., https://github.com/Pyomo/pyomo/blame/master/pyomo/core/base/PyomoModel.py), then when you hover over the commit link in the left-most column, the tooltip will indicate and link to the PR where that change was merged into master; e.g.:

 

 

John

--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-developers/36c22b20-ddaf-4230-bc5a-09fa9e21f7c5n%40googlegroups.com.

Bynum, Michael Lee

unread,
Sep 14, 2020, 12:27:37 PM9/14/20
to pyomo-de...@googlegroups.com
Well said, John.

Michael

On Sep 14, 2020, at 10:17 AM, 'Siirola, John D' via Pyomo Developers <pyomo-de...@googlegroups.com> wrote:

Sam,
 
This is a fine place for discussions.  
 
There isn’t a good answer to your question in that to the best of my recollection, we never discussed it.  Pyomo started off in Subversion, so when we migrated to Git, we kept almost everything the same.  I also think there was a desire to keep the full history both so that original attribution was kept intact, and to encourage smaller commits with more targeted commit messages to help understand intent when using git blame (this was important because we regularly have large, long-running PRs with lots of moving parts and a squash merge would obfuscate the development thoughts).
 
Fortunately, GitHub helps a lot with this.  If you are looking at a blame through GitHub (e.g.,https://github.com/Pyomo/pyomo/blame/master/pyomo/core/base/PyomoModel.py), then when you hover over the commit link in the left-most column, the tooltip will indicate and link to the PR where that change was merged into master; e.g.:
 
<image001.png>
 
John
 
 
From: pyomo-de...@googlegroups.com <pyomo-de...@googlegroups.com> On Behalf Of Sam Ryan
Sent: Sunday, September 13, 2020 9:40 PM
To: Pyomo Developers <pyomo-de...@googlegroups.com>
Subject: [EXTERNAL] Squash Merge Commits
 
Hello! I'm totally new here so please let me know if there is good reason that the team is not using this :)
 
I'm wondering if there is a reason that squash merge commits are not used in the GitHub repo? Squash merges (an option on GitHub), will combine the whole PR into a single commit with a link to the PR in the description. More here.
 
I have had a few times where I wanted to reference where a line of code came from and it would have been nice to easily be able to refer to all the conversation in a PR via git blame (rather than only be able to find a solo commit that is unlikely to have the same context as the full PR).
-- 
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-developers/36c22b20-ddaf-4230-bc5a-09fa9e21f7c5n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.

Sam Ryan

unread,
Sep 14, 2020, 6:53:59 PM9/14/20
to Pyomo Developers
Thanks for the context and the git blame tip! Makes sense.

I didn't realize this in my first PR so my commits weren't the best :)

Adding a small note to the contribution guide here. Feel free to edit

Bynum, Michael Lee

unread,
Sep 16, 2020, 10:06:21 AM9/16/20
to pyomo-de...@googlegroups.com
Some of us never have great commit messages… :)

Reply all
Reply to author
Forward
0 new messages