Re: [PATCH v6 2/3] branch: report invalid tracking branch as broken
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 15, 2013, 18:38 UTC
- Message-ID
- <7vmwoire82.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <8db143908bc969bbe1d720479fb6214729f7b1ae.1376590264.git.worldhello.net@gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 10 quoted lines
> If a branch has been set to track a upstream, but the upstream branch > is missing or invalid, the tracking info is silently ignored in the > output of some commands such as "git branch -vv" and "git status", > as if there were no such tracking settings. > > Junio suggested broken upstream should be reported [1]. E.g. > > $ git branch -v -v > master e67ac84 initial > * topic 3fc0f2a [topicbase: broken] topic
I'd assume this is s/broken/gone/ to match what the rest of the log message says?
Show 15 quoted lines
> $ git status > # On branch topic > # Your branch is based on a broken ref 'topicbase'. > # (use "git branch --unset-upstream" to fixup) > ... > > $ git status -b -s > ## topic...topicbase [broken] > ... > > In order to do like that, we need to distinguish these three cases > (i.e. no tracking, with configured but no longer valid tracking, and > with tracking) in function stat_tracking_info(). So the refactored > function stat_tracking_info() has three return values: -1 (with "gone" > base), 0 (no base), and 1 (with base).