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

Re: [PATCH v3] status: always show tracking branch even no change

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 12, 2013, 06:15 UTC
Message-ID
<7vd2pj1lk6.fsf@alter.siamese.dyndns.org>
In-Reply-To
<8b2e7fa581846aca3209b430ac46950ff9d92924.1376146168.git.worldhello.net@gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 27 quoted lines
> 2013/8/10 Junio C Hamano <gitster@pobox.com>:
>> Jiang Xin <worldhello.net@gmail.com> writes:
>>
>>> So always show the remote tracking branch in the output of "git status"
>>> and other commands will help users to see where the current branch
>>> will push to and pull from. E.g.
>>> ...
>>
>> Hmmph.
>>
>> I do not know if this will help any case you described above, even
>> though this might help some other cases.  The added output is to
>> always show the current branch and its upstream, but the thing is,
>> the original issue in $gmane/198703 was *not* that the current
>> branch was pushed and up to date.  It was that there was no current
>> branch to be pushed.  The same thing would happen if you are on a
>> local branch that is not set to be pushed to the other side
>> (e.g. the configuration is set to "matching" and there is no such
>> branch on the other end).
>>
>
> How about write the commit log like this:
> ...
> Then if there is no tracking info reported, the user may need to do
> something. Maybe the current branch is a new branch that needs to be
> pushed out, or maybe it's a branch which should add remote tracking
> settings.
Would that help anybody, though?

A user who does not notice the _lack_ of mention of the current branch in the feedback from "git push" would not notice the lack of "ahead, behind or the same".

We could contemplate on saying "your current branch is not set to be pushed out to anywhere" instead of being silent in the case where the output with your patch is silent, but that would make "status" output irritatingly chatty when you are on a private topic branch that you never intend to push out except as a part of an integration branch after merging into it, so it is not a good solution either, but at least that would solve the original problem.

Isn't it the real solution to the original poster's problem to make "git push" explain "Everything is up to date, and nothing is pushed" case better?

Perhaps "git push" can learn an option to show what the command would push out if there were something to push. If push.default is set to matching and the user is on a branch that does not exist on the receiving end, matching branches will be listed as "up to date" and the user could notice that his current branch is _not_ among the ones that are listed. When there is _no_ branch to be pushed out (e.g. there is no matching branches, or you are on a detached HEAD) that "please explain" option could really explain whey there is no branch to be pushed out".

Previous: Jiang XinNext: Jiang Xin
Message 9 of 36 in “[RFC] status: show tracking branch even no difference”
  1. Jiang XinAug 7, 2013
  2. Matthieu MoyAug 7, 2013
  3. Jiang XinAug 7, 2013
  4. status: always show tracking branch even no changeJiang Xin, Aug 8, 2013
  5. status: always show tracking branch even no changeJiang Xin, Aug 8, 2013
  6. status: always show tracking branch even no changeJiang Xin, Aug 8, 2013
  7. Junio C HamanoAug 9, 2013
  8. Jiang XinAug 10, 2013
  9. Junio C HamanoAug 12, 2013
  10. Jiang XinAug 13, 2013
  11. 1/2 branch: not report invalid tracking branchJiang Xin, Aug 13, 2013
  12. 2/2 status: always show tracking branch even no changeJiang Xin, Aug 13, 2013
  13. Junio C HamanoAug 14, 2013
  14. Jiang XinAug 15, 2013
  15. Junio C HamanoAug 14, 2013
  16. 1/3 branch: not report invalid tracking branchJiang Xin, Aug 15, 2013
  17. 2/3 branch: report invalid tracking branch as brokenJiang Xin, Aug 15, 2013
  18. Junio C HamanoAug 15, 2013
  19. Junio C HamanoAug 15, 2013
  20. 0/3 some enhancements for reporting branch tracking infoJiang Xin, Aug 16, 2013
  21. 1/3 branch: not report invalid tracking branchJiang Xin, Aug 16, 2013
  22. 2/3 branch: mark missing tracking branch as goneJiang Xin, Aug 16, 2013
  23. Matthieu MoyAug 21, 2013
  24. Jiang XinAug 22, 2013
  25. 3/3 status: always show tracking branch even no changeJiang Xin, Aug 16, 2013
  26. Junio C HamanoAug 18, 2013
  27. Jiang XinAug 19, 2013
  28. 0/2 some enhancements for reporting branch tracking infoJiang Xin, Aug 26, 2013
  29. 1/2 branch: report invalid tracking branch as goneJiang Xin, Aug 26, 2013
  30. 2/2 status: always show tracking branch even no changeJiang Xin, Aug 26, 2013
  31. Jeremy RosenAug 26, 2013
  32. Jiang XinAug 26, 2013
  33. Junio C HamanoAug 26, 2013
  34. Junio C HamanoAug 26, 2013
  35. 3/3 status: always show tracking branch even no changeJiang Xin, Aug 15, 2013
  36. Junio C HamanoAug 15, 2013

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.