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

Re: [PATCHv5 0/2] bash completion: Support "divergence from upstream" messages in __git_ps1

From
ASAndrew Sayers <andrew-git@pileofstuff.org>
Date
Jun 18, 2010, 21:02 UTC
Message-ID
<4C1BDED3.2090002@pileofstuff.org>
In-Reply-To
<7vljacxqwc.fsf@alter.siamese.dyndns.org>
On 18/06/10 17:10, Junio C Hamano wrote:
Show 13 quoted lines
> 
> But doesn't all of the above suggest the decision should be per branch?
> It is not too implausible to have a branch that is actively interacting
> with SVN upstream and another branch whose upstream has migrated from SVN
> and now managed by git.  Say you and your pal are working with a project
> that is managed by SVN, and you use one of your branches to interact
> directly with SVN upstream.  Your pal has a branch forked from the same
> SVN upstream, and one of your other branches is building on top of her
> work.  When you are on the former branch, you would want to know how your
> work diverged from the SVN upstream; when you are on the latter branch,
> you would want to know how your work diverged from your pal's git branch
> that you are using as its upstream.  No?
> 

It sounds like you're asking for git-svn to set git.<branch>.{remote|upstream}, and for this script to ditch the SVN-specific workarounds. I have no problem with such a solution, but I also have no idea where to begin with it. Is there some reason we don't do this already?

A simpler 90% solution would be to switch the defaults around, so you always use @{upstream} if defined, or otherwise search for the SVN upstream. This enables every use case except noMetadata, and I suspect any solution to that one would be at least as complex as setting git.<branch>.{remote|upstream}.

Show 10 quoted lines
>>> If you "tr" to trash "\0" anyway, do you need to run "config -z"?
>>
>> The `tr` is there to work around issues like this:
>>
>> 	git config bash.showUpstream $'svn\nlegacy'
>> 	git config bash.showUpstream | tr '\0\n' '\n '
> 
> Is that even an issue?  Why should there be a LF in the value?  I thought
> you defined it as a string with space separated magic tokens...  Perhaps I
> am missing something?

My concern was more with the robustness principle than anything - LFs aren't part of the format defined in the docs, and I can't think of a reason why people would need them, but there's no mechanical way to stop people putting them in there. If you're saying that git users can be trusted not to do anything so stupid (and/or that it's their problem if they do), then I'm happy to get rid of this.

	- Andrew
Previous: Junio C HamanoNext: Andrew Sayers
Message 20 of 22 in “bash completion: Support "divergence from upstream" warnings in __git_ps1”
  1. 0/2 bash completion: Support "divergence from upstream" warnings in __git_ps1Thomas Rast, Jun 12, 2010
  2. 1/2 rev-list: introduce --count optionThomas Rast, Jun 12, 2010
  3. 2/2 bash completion: Support "divergence from upstream" warnings in __git_ps1Thomas Rast, Jun 12, 2010
  4. Junio C HamanoJun 14, 2010
  5. Thomas RastJun 14, 2010
  6. SZEDER GáborJun 14, 2010
  7. vger doesn't like UTF-8 from send-emailThomas Rast, Jun 12, 2010
  8. send-email: ask about and declare 8bit mailsThomas Rast, Jun 12, 2010
  9. Junio C HamanoJun 12, 2010
  10. Thomas RastJun 13, 2010
  11. Michael WittenJun 13, 2010
  12. Erik Faye-LundJun 14, 2010
  13. bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers, Jun 12, 2010
  14. Thomas RastJun 14, 2010
  15. [PATCHv4] bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers, Jun 15, 2010
  16. Junio C HamanoJun 16, 2010
  17. Thomas RastJun 16, 2010
  18. 0/2 bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers, Jun 17, 2010
  19. Junio C HamanoJun 18, 2010
  20. Andrew SayersJun 18, 2010
  21. 1/2 bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers, Jun 17, 2010
  22. 2/2 bash-completion: Fix __git_ps1 to work with "set -u"Andrew Sayers, Jun 17, 2010

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.