News for hackers. Stuff that matters.
Re:Fortunately, I don't squash my commits by bluGill on Monday October 05, 2020 @08:22AM (#24687052)
If git has a concept of branches like mercurial has it would be a lot easier as you can actually see what branch your commits attached to.

(there are pros and cons of both approaches - this is a con of the git approach, I'm not knowledge about enough about esoteric details to comment on if git actually made a bad choice or just a compromise)

Re:Fortunately, I don't squash my commits by oauea on Monday October 05, 2020 @09:44AM (#24687698)
Thankfully most Git hosting websites do have this concept. You can revert a PR whole using github, etc
Re:Fortunately, I don't squash my commits by m12k on Monday October 05, 2020 @08:27AM (#24687083)
If you use the standard merge commit message in git, then you can still tell what branch things came from when being merged. As someone that has used both mercurial and git, the trouble with named branches (and having to remember to remove them when merging to master) is one of the reasons why I prefer git.
Re:Fortunately, I don't squash my commits by idoubtit on Monday October 05, 2020 @09:00AM (#24687342)
Knowing the name of the branch is not enough to find the commits. With Git, a branch is just a kind of moving tag on the last commit.

The problem mentioned in this thread is rolling back a feature that was merged. The only solution I know is navigating the log to find the first commit on the branch from which to revert. Don't forget there may have been several merges from and to master, as well as commits shared with other git branches that should not be reverted.

In a Mercurial branch, each commit is tagged with the branch name. Unamed branches, à la Git, are called "bookmarks".

Re:Fortunately, I don't squash my commits by nemetroid on Monday October 05, 2020 @10:09AM (#24687882)
> The only solution I know is navigating the log to find the first commit on the branch from which to revert. Don't forget there may have been several merges from and to master, as well as commits shared with other git branches that should not be reverted.

The only step necessary to revert the changes from a merged branch is to revert the merge commit. See:

https://stackoverflow.com/questions/7099833/how-to-revert-a-...

https://github.com/git/git/blob/master/Documentation/howto/r...