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

Re: Avoiding 'master' nomenclature

From
Jeff King <peff@peff.net>
Date
Jul 30, 2020, 00:29 UTC
Message-ID
<20200730002944.GB2996059@coredump.intra.peff.net>
In-Reply-To
<CAHk-=wg7r=y_tYpWuRwNFP0JU5D4g=UN1puCzkvQP4bey0-Hmw@mail.gmail.com>
On Wed, Jul 29, 2020 at 02:20:07PM -0700, Linus Torvalds wrote:
Show 5 quoted lines
> I use that prepare-commit-msg hook to do that.
> 
> I *could* have done that for branch names too, but that is something
> that git has done right for the last 15+ years, so I never had to
> worry or think about it.

Yeah, I think that "just use a hook" is not the right response here. Hooks are great for making hard or uncommon things possible, but we should still be making easy things easy. If tweaking this part of the merge msg in a standard way is something many people want to do, it's much friendlier for us to provide a config option that does that.

Show 8 quoted lines
> But a generic replacement (or generation) machinery for the whole line
> would be lovely. And then perhaps just _default_ that regex to be the
> equivalent of
> 
>    sed 's/ into master$//'
> 
> would work really well not just for the branch name prettification,
> but also for things like that "internal vs external hostnames".

This is an interesting middle ground. I'm a little iffy on it just because it complicates the very simple case of "should I mention the destination branch", which is what I'd expect most people to care about. That it also solves your "tweak the source branch" problem is interesting, but I'm not sure how many people will care (i.e., enough to justify the extra complication).

Show 8 quoted lines
> >   2. Optionally a repository created with "git init" could copy its
> >      init.defaultBranch into merge.suppressDest. And likewise a clone
> >      might copy the remote HEAD into that variable. I'm not sure if that
> >      is worth doing or not, but it would restore the original behavior
> >      for the most part.
> 
> Well, the real objection I have to that commit 489947cee5 is that it
> breaks existing users workflow.

I'm not entirely onboard with the characterization of "breaking workflows". Yes, the result is _different_, but it's mostly a matter of aesthetics. I'd be more convinced it was a breakage if we were somehow leaking information about the workflows. E.g., if you merge on a detached HEAD and then fast-forward your branch to match and you get an ugly "into HEAD", that might be bad. But nothing changed there (we do give you the ugly "into HEAD" ;) ). The case that changed is conveying the same information as before, just more verbosely (by saying the branch name instead of implying it by omission).

It may be a matter of perspective / opinion, though. And I don't know that we even need to come to an agreement on it. Whether we treat it as a feature to suppress the mention of the destination branch, or a bug-fix to correct a regression, the end result is the same (and to be clear, I'm on board with doing it in a way that defaults to handling "master", which is a key part of those two things being equivalent).

-Peff
Previous: Linus TorvaldsNext: Linus Torvalds
Message 13 of 42 in “Avoiding 'master' nomenclature”
  1. Linus TorvaldsJul 29, 2020
  2. Junio C HamanoJul 29, 2020
  3. Linus TorvaldsJul 29, 2020
  4. Jonathan NiederJul 29, 2020
  5. Linus TorvaldsJul 29, 2020
  6. Linus TorvaldsJul 29, 2020
  7. lego_12239@rambler.ruJul 30, 2020
  8. Jeff KingJul 31, 2020
  9. OlegJul 31, 2020
  10. Linus TorvaldsJul 29, 2020
  11. Jeff KingJul 29, 2020
  12. Linus TorvaldsJul 29, 2020
  13. Jeff KingJul 30, 2020
  14. Linus TorvaldsJul 30, 2020
  15. Jeff KingJul 30, 2020
  16. Linus TorvaldsJul 30, 2020
  17. Jeff KingJul 31, 2020
  18. Junio C HamanoJul 29, 2020
  19. Junio C HamanoJul 29, 2020
  20. Jeff KingJul 30, 2020
  21. Linus TorvaldsJul 30, 2020
  22. Michal SuchánekJul 30, 2020
  23. Jeff KingJul 30, 2020
  24. Junio C HamanoJul 30, 2020
  25. 0/2 fmt-merge-msg: selectively suppress "into <branch>"Junio C Hamano, Jul 30, 2020
  26. 2/2 fmt-merge-msg: allow merge destination to be omitted againJunio C Hamano, Jul 30, 2020
  27. 1/2 Revert "fmt-merge-msg: stop treating `master` specially"Junio C Hamano, Jul 30, 2020
  28. Eric SunshineJul 30, 2020
  29. Junio C HamanoJul 30, 2020
  30. Jeff KingJul 31, 2020
  31. Junio C HamanoJul 31, 2020
  32. Jeff KingJul 31, 2020
  33. Taylor BlauJul 31, 2020
  34. Junio C HamanoJul 31, 2020
  35. Taylor BlauJul 31, 2020
  36. Michal SuchánekAug 1, 2020
  37. Johannes SchindelinAug 10, 2020
  38. Junio C HamanoAug 10, 2020
  39. Johannes SchindelinAug 11, 2020
  40. Junio C HamanoAug 12, 2020
  41. Junio C HamanoJul 29, 2020
  42. Linus TorvaldsJul 29, 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.