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

Re: linux-next: unnecessary merge in the v4l-dvb tree

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 12, 2018, 21:37 UTC
Message-ID
<xmqqk1vhsxdh.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CA+55aFwM0vy+pw-Xv=gA19ULMwAXNPhdO3qR5A3hkMrZKJFNSQ@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 15 quoted lines
> On Mon, Feb 12, 2018 at 1:00 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> The problem, of course, is that since git is distributed, git doesn't
> know who is "upstream" and who is "downstream", so there's no
> _technical_ difference between merging a development tree, and a
> development tree doing a back-merge of the upstream tree.
>
> Maybe it was a mistake to make signed tag merges non-fast-forward,
> since they cause these kinds of issues with people who use "pull" to
> update their otherwise unmodified trees.
>
> I can always teach myself to just use --no-ff, since I end up doing
> things like verifying at the signatures anyway.
>
> Junio, comments?

I have a slight suspicion that allowing 'pull' to fast-forward even when merging a signed tag when it is pulling from a configured default remote for the branch the user is on, and otherwise keeping the current behaviour, would make majority of people from both camps happier, but I also have a strong conviction that it is being too clever and making it hard to explain to people to do such a dwim that tries to guess which way is 'upstream'.

Another clue we _might_ be able to take advantage of is that when upstream maintainers merge a signed tag, we do *not* fetch and store the tag from downstream contributers in our local repository (it is likely that we have --no-tags in remote.<name>.tagopt), but when downstream contributers sync from us with "git pull", they do fetch and store our tags in their local repository.

So "git pull $somewhere $tag" that defaults to "--ff" when the tag gets stored somewhere in refs/ (or more explicitly, in refs/tags/) and defaults to "--no-ff" otherwise (i.e. the tag is fetched only to be recorded in the resulting merge, without ever stored in any of our refs), might be a good balance.

And it is easy to explain: "We realize that it was a mistake to unconditionally default to --no-ff and we are reverting the default to --ff, but with a twist. When we tell 'pull' to grab a tag, if we do not store it anywhere in our local ref space, that would mean the tag is totally lost if the pull fast-forwards. That is why we still use --no-ff in such a case."

Previous: Mauro Carvalho ChehabNext: Linus Torvalds
Message 3 of 15 in “Re: linux-next: unnecessary merge in the v4l-dvb tree”
  1. Linus TorvaldsFeb 12, 2018
  2. Mauro Carvalho ChehabFeb 12, 2018
  3. Junio C HamanoFeb 12, 2018
  4. Linus TorvaldsFeb 12, 2018
  5. Junio C HamanoFeb 12, 2018
  6. Linus TorvaldsFeb 12, 2018
  7. Junio C HamanoFeb 12, 2018
  8. Mauro Carvalho ChehabFeb 13, 2018
  9. Junio C HamanoFeb 13, 2018
  10. Linus TorvaldsFeb 13, 2018
  11. Junio C HamanoFeb 14, 2018
  12. merge: allow fast-forward when merging a tracked tagJunio C Hamano, Feb 15, 2018
  13. Eric SunshineFeb 15, 2018
  14. Junio C HamanoFeb 16, 2018
  15. merge: allow fast-forward when merging a tracked tagJunio C Hamano, Feb 16, 2018

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.