All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Jeff King <peff@peff.net>
Cc: Shawn Pearce <spearce@spearce.org>,
	Junio C Hamano <gitster@pobox.com>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	<git@vger.kernel.org>
Subject: Re: [RFC/PATCH] fetch: bigger forced-update warnings
Date: Thu, 8 Sep 2011 00:42:45 +0200	[thread overview]
Message-ID: <201109080042.45980.trast@student.ethz.ch> (raw)
In-Reply-To: <20110907212042.GG13364@sigill.intra.peff.net>

Jeff King wrote:
> On Mon, Sep 05, 2011 at 02:14:57PM -0700, Shawn O. Pearce wrote:
> 
> > > Right. What I mean is, what should the bigger warning look like?
> > 
> > Its a bikeshed. I refuse to paint bikesheds. :-)
[...]
> +	if (uncommon_forced_update)
> +		warning("HEY STUPID FIX YOUR TOPICS");

Whatever comes out of the bikeshedding, I'm going to keep a patch
locally that refreshes the mental picture of Shawn shouting that!

That being said, I think there should be a multiline warning pointing
the user at the "recovering from upstream rebase" section in
git-rebase(1).  At least by default with an advice.* setting to
disable it.

> +       if (!prefixcmp(message, "fetch: fast-forward"))
> +               uc->fastforward++;
> +       else if (!prefixcmp(message, "fetch: forced-update\n"))
> +               uc->forced++;

That doesn't work: fetch puts the whole command line there.
E.g.

  git fetch altgit
  --> fetch altgit: fast-forward

  git fetch altgit next:refs/remotes/next
  --> fetch altgit next:remotes/altgit/next: fast-forward

There's also a minor subtlety here that I had to double-check first:
the message for a branch creation is 'storing head', so the later
check

> +       return uc.fastforward && uc.forced <= 1; /* 1 for the one we just did */

never triggers at the second fetch.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  parent reply	other threads:[~2011-09-07 22:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 18:25 Dropping '+' from fetch = +refs/heads/*:refs/remotes/origin/*? Junio C Hamano
2011-09-01 18:39 ` Junio C Hamano
2011-09-01 19:14   ` Shawn Pearce
2011-09-01 19:20 ` Michael J Gruber
2011-09-01 19:35   ` Matthieu Moy
2011-09-01 19:50     ` Shawn Pearce
2011-09-02  5:55       ` Matthieu Moy
2011-09-02  0:00 ` Jeff King
2011-09-02  7:00   ` Johannes Sixt
2011-09-02 15:26     ` Jeff King
2011-09-02  7:42   ` Michael J Gruber
2011-09-02 15:29     ` Jeff King
2011-09-02 16:14       ` Junio C Hamano
2011-09-02 16:25         ` Jeff King
2011-09-02 16:47           ` Junio C Hamano
2011-09-05 18:15           ` Shawn Pearce
2011-09-05 20:47             ` Jeff King
2011-09-05 20:53               ` Shawn Pearce
2011-09-05 20:57                 ` Jeff King
2011-09-05 21:14                   ` Shawn Pearce
2011-09-07 21:20                     ` [RFC/PATCH] fetch: bigger forced-update warnings Jeff King
2011-09-07 21:39                       ` Shawn Pearce
2011-09-07 21:53                       ` Junio C Hamano
2011-09-07 21:57                         ` Jeff King
2011-09-07 22:42                       ` Thomas Rast [this message]
2011-09-06  7:39             ` Dropping '+' from fetch = +refs/heads/*:refs/remotes/origin/*? Matthieu Moy
2011-09-06  7:51               ` Michael J Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201109080042.45980.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.