Re: [PATCH] git-send-pack: don't consider branch lagging behind as errors.
- From
Jeff King <peff@peff.net>
- Date
- Jun 19, 2008, 15:11 UTC
- Message-ID
- <20080619151110.GA31654@sigill.intra.peff.net>
- In-Reply-To
- <20080619135159.GA19560@artemis.madism.org>
On Thu, Jun 19, 2008 at 03:52:00PM +0200, Pierre Habouzit wrote:
Show 7 quoted lines
> > http://thread.gmane.org/gmane.comp.version-control.git/73038/focus=73186 > [...] > > - should stale branches be shown without -v? > > I believe so, it's valuable information. It's as valuable as what you > get after a git fetch nowadays (like branches have diverged n and m > commits each or similar) But oh well… I don't care that much.
If you read the beginning of that thread, the original impetus was people cloning repos that had dozens of branches, then doing a push. If they hadn't recently done a fetch, they got dozens of lines of "rejected".
Show 8 quoted lines
> > - calling ref_newer here is inefficient, since we have already called > > it in the other direction. We should probably do the traversal once > > in such a way as to find out which ref is newer (or if it is > > indeterminate). > > Well, true, though I don't expect people to have tons of local > branches that match a refspec _and_ lag behind. I suspect this is a very > minor performance loss.
Yeah, maybe it is not worth worrying about; I haven't actually measured any performance issue. I'll try to look and see how painful it is to combine the traversals.
Show 6 quoted lines
> > - there is a possible danger with "git push -f", in that you force > > both rejected branches as well as stale branches. Junio and I > Well afaict this is a separate issue, as we're (with such a patch) > only changing what gets printed on the console, not the internal > behavior. So solving this second issue should not really be a > precondition to the inclusion of such a patch.
It is a separate issue, but it is exacerbated by hiding stale refs. Imagine:
$ git push To /path/to/repo ! [rejected] master -> master (non-fast forward)
$ git push -f To /path/to/repo + 0abfa88...c1ed93b master -> master (forced update) + 0329485...3498576 stale_branch -> stale_branch (forced update)
I think that is a nasty surprise to spring on an unsuspecting user. Another solution might be "-f" not pushing rewound branches, but then we need a way to specify "no, really, push this rewound branch". Perhaps "-f -f"?
> Please please please do :) > The exit 1 of git-push is really annoying me these days.
OK, I will try to take a look in the next few days.
-Peff