git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Subject: Re: [PATCH/RFC] improve no-op push output
Date: Wed, 30 May 2012 10:52:28 -0700	[thread overview]
Message-ID: <7vr4u1zhcz.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120530120804.GA3501@sigill.intra.peff.net> (Jeff King's message of "Wed, 30 May 2012 08:08:04 -0400")

Jeff King <peff@peff.net> writes:

> I noticed the mention of the "Everything up-to-date" message in a nearby
> thread. This patch doesn't help with the case there, but it made me
> think about how vague that message is.
>
> -- >8 --
> When a push is a no-op because all refs are up-to-date, we print
> "Everything up-to-date". That is reasonable when push.default is
> "matching" (or when a wildcard refspec is given), because "Everything"
> pretty obviously means "everything you asked git to push".
>
> But when one of the single-ref push.default modes is used, the
> "Everything" is slightly misleading; we only tried to push one thing,
> and we should not give the user the impression that the remote is
> completely in sync with what is in their local repo.
>
> Instead, let's detect the case that we attempted to push a single ref,
> and if so, just show the verbose status table (which includes the
> up-to-date ref). We don't want to show it if we tried to push many refs,
> because it could be quite long (e.g., in the case of "matching").
>
> ---
> So before, running:
>
>   git init -q --bare parent &&
>   git clone -q parent child 2>/dev/null &&
>   cd child &&
>   echo one >one && git add one && git commit -q -m one &&
>   git branch other &&
>   git -c push.default=simple push
>
> would just print:
>
>   Everything up-to-date
>
> and now you get:
>
>   To /tmp/push-message/parent
>    = [up to date]      master -> master
>
> which is much more informative.

I think a more interesting case is to do this in the child:

	git checkout other
        git -c push.default=matching push

after the above sequence.  It will try to push master to master (and
the most important part is 'other' is not involved in this push at
all) and would give you the same updated message, which would make
it more clear that 'other' is not involved.  Although it by itself
is good, but unless you are paying attention, you may not catch that
your current branch is *not* listed in the output, so it might not
help people that much, even if they weren't on a detached HEAD.

Somebody who is unaware that she has been working on detached HEAD
is by definition very unlikely to notice that the 'master' in the
output is different from her current branch, as she is not paying
attention to what branch she is working on.

It might be a better approach to check if the set of pushed refs
include the current branch and rephrase the message only in that
case, perhaps

	Everything up-to-date (the current branch not pushed)

or something.

  reply	other threads:[~2012-05-30 17:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30 12:08 [PATCH/RFC] improve no-op push output Jeff King
2012-05-30 17:52 ` Junio C Hamano [this message]
2012-05-31  6:10   ` Matthieu Moy
2012-06-04 12:51   ` Jeff King
2012-06-04 16:35     ` Junio C Hamano
2012-06-05 10:10       ` Jeff King

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=7vr4u1zhcz.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --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).