git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Tiwald <christiwald@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Matthieu.Moy@grenoble-inp.fr, peff@peff.net
Subject: Re: [PATCH] Give better 'pull' advice when pushing non-ff updates to current branch
Date: Tue, 24 Apr 2012 00:58:44 -0400	[thread overview]
Message-ID: <20120424045844.GA41274@gmail.com> (raw)
In-Reply-To: <xmqqvckpho0a.fsf@junio.mtv.corp.google.com>

On Mon, Apr 23, 2012 at 07:17:25PM -0700, Junio C Hamano wrote:
> So what makes it dangerous is the use of "--rebase", if anything, isn't
> it?  It does not seem to have much to do with how the local branches are
> named.

After thinking about this argument, there might be a deeper problem with
my reasoning. Take the workflow you describe. In the "devel tracks to origin
master" workflow, this patch would advise 'git pull <repository> <refspec>'.
The advice misses the point of setting the upstream branch. Worse, the
advice is broken if the user issues 'git pull origin devel' and no 'devel'
branch exists on origin or the 'devel' branch is simply out of date (as
might occur if the user pushes between a personal remote clone of a
shared repo and the shared repo itself with different frequency).

Maybe the solution here is to ditch the $dest_ref and $dest_remote
matching entirely and just touch the one case I _know_ the advice could
do better: git should advise 'git pull <repo> <refspec>' or something
like "consider setting an upstream branch and pulling before pushing
again" when branch->merge doesn't exist at all. I like the former
because it's simpler as an end user and doesn't require enforcing a
setting he or she may not understand.

I think that might be the way to go. I approached this from a specific
workflow assumption. In retrospect, I can't divine the motivation of
merge configurations well enough to avoid bad advice.

--
Christopher Tiwald

  reply	other threads:[~2012-04-24  4:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 22:45 [PATCH] Give better 'pull' advice when pushing non-ff updates to current branch Christopher Tiwald
2012-04-24  2:17 ` Junio C Hamano
2012-04-24  4:58   ` Christopher Tiwald [this message]
2012-04-24 19:06     ` Junio C Hamano
2012-04-24  2:29 ` Junio C Hamano
2012-04-24  7:04 ` Matthieu Moy
2012-04-24 12:21   ` Christopher Tiwald

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=20120424045844.GA41274@gmail.com \
    --to=christiwald@gmail.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).