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

Re: [PATCH 1/2] t3200-branch: test setting branch as own upstream

From
Jeff King <peff@peff.net>
Date
Feb 28, 2014, 13:03 UTC
Message-ID
<20140228130340.GB23448@sigill.intra.peff.net>
In-Reply-To
<CAN7MxmVxYhF1VXWZNAXyfF8iBNQaqqwoyjmDAP_9_bc5NUUU6A@mail.gmail.com>
On Fri, Feb 28, 2014 at 08:16:13PM +0900, Brian Gesiak wrote:
Show 7 quoted lines
> > I just don't want to regress somebody else's workflow due
> > to my lack of imagination.
> 
> This makes a lot of sense to me, although as-is the function emits a
> warning and returns immediately (although with a successful status
> code), so I'm also stumped as to what kind of workflow this would be
> included in.

I'm cc-ing Matthieu, who wrote 85e2233, which introduces the check. Its commit message says:

  branch: warn and refuse to set a branch as a tracking branch of
  itself.
  Previous patch allows commands like "git branch --set-upstream foo
  foo", which doesn't make much sense. Warn the user and don't change
  the configuration in this case. Don't die to let the caller finish its
  job in such case.

For those just joining us, we are focused on the final statement, and deciding whether we should die() in this case. But I am not clear what job it would want to be finishing (creating the branch, I guess, but you cannot be doing anything useful, since by definition the branch already exists and you are not changing its tip). There wasn't any relevant discussion on the list[1]. Matthieu, can you remember anything else that led to that decision?

> In any case, if the jury's out on this one, I suppose the two patches
> I submitted are good to merge? Part of me thinks the bump from warning
> to error belongs in its own patch anyway.
Yeah, it should definitely be a separate patch on top.
-Peff
[1] Threads are:
      http://thread.gmane.org/gmane.comp.version-control.git/137297/focus=137299
    and
      http://thread.gmane.org/gmane.comp.version-control.git/137401/focus=137403
    but the discussion focused on the first part of the series.
Previous: Brian GesiakNext: Matthieu Moy
Message 17 of 22 in “t3200-branch: test setting branch as own upstream”
  1. 1/2 t3200-branch: test setting branch as own upstreamBrian Gesiak, Feb 28, 2014
  2. 2/2 branch: use skip_prefixBrian Gesiak, Feb 28, 2014
  3. Jeff KingFeb 28, 2014
  4. Junio C HamanoMar 3, 2014
  5. Jeff KingFeb 28, 2014
  6. Brian GesiakFeb 28, 2014
  7. Jeff KingFeb 28, 2014
  8. brian m. carlsonFeb 28, 2014
  9. Johannes SixtFeb 28, 2014
  10. Jeff KingFeb 28, 2014
  11. Jeff KingFeb 28, 2014
  12. Brian GesiakFeb 28, 2014
  13. Jeff KingFeb 28, 2014
  14. Brian GesiakFeb 28, 2014
  15. Jeff KingFeb 28, 2014
  16. Brian GesiakFeb 28, 2014
  17. Jeff KingFeb 28, 2014
  18. Matthieu MoyFeb 28, 2014
  19. branch: die when setting branch as own upstreamBrian Gesiak, Mar 1, 2014
  20. 3/3 branch: die when setting branch as own upstreamBrian Gesiak, Mar 1, 2014
  21. Brian GesiakMar 1, 2014
  22. Johannes SixtFeb 28, 2014

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.