News for hackers. Stuff that matters.
Re:Ask HN: Best Git workflow for small teams by JimDabell on Sunday November 13, 2016 @06:54AM (#12942922)
> Squashing instead of merging has a big advantage of being able to quickly revert the changes if things go awry despite all best practices in place.

Merge with --no-ff. You can revert easily, but you don't throw away the feature branch history.

Re:Ask HN: Best Git workflow for small teams by tapan_k on Sunday November 13, 2016 @07:30AM (#12943023)
> but you don't throw away the feature branch history

Once a feature is merged, how is the history of a feature branch helpful?

Since I do not see/understand the benefits of retaining feature branch history, my preference is to squash commit and merge. Perhaps, this is a result of my habits that I carry from the ClearCase days, but would love to hear the downsides of this approach.

Re:Ask HN: Best Git workflow for small teams by JimDabell on Sunday November 13, 2016 @08:04AM (#12943133)
Well given that we're talking specifically about reverting the merge when something goes awry, firstly you want that history preserved so that you can re-start work on it, potentially without pulling in all of the changes in one go; and secondly so that you can determine the precise point at which the problem happened.

Consider the difference between:

* Well we need to revert this because it's causing problems, but now we've got one massive chunk of several day's work to pick through.

…vs:

* Well we need to revert this, but we can see that the problem was specifically commit xzy, so let's yank that, do it a different way, and merge the result.

Aside from that, it can be very useful to see the individual steps in implementing a feature for a variety of reasons. Given that a --no-ff merge achieves everything you are aiming for with the squash, why wouldn't you pick the more flexible approach?

Re:Ask HN: Best Git workflow for small teams by 32bitkid on Sunday November 13, 2016 @08:52AM (#12943305)
`git blame` and `git biscet`
Re:Ask HN: Best Git workflow for small teams by qertoip on Sunday November 13, 2016 @09:44AM (#12943496)
No, reverting a merge commit does not do what most developers think it does. Correctly reverting the merge is a know source of pain.