git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Organov <sorganov@gmail.com>
To: git@vger.kernel.org
Subject: Minor(?) usability issue with branch.<name>.pushRemote
Date: Wed, 12 Dec 2018 10:15:15 +0300	[thread overview]
Message-ID: <871s6n43ng.fsf@javad.com> (raw)

Hello,

I've got confusing behavior and the cause was somewhat hard to discover:

-- 8< --
$ git status
On branch linux
Your branch is ahead of 'vendor/jps2rin_arm' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
$ git push
Everything up-to-date
$ git status
On branch linux
Your branch is ahead of 'vendor/jps2rin_arm' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
$ git branch -vv
* linux  e8906f9 [vendor/jps2rin_arm: ahead 2] Linux: get rid of unused files
  master 4d1f931 [origin/master] Linux: add README and config
-- 8< --

What's going on here? Why 'git status' and 'git branch' both insist
there are 2 unpushed commits yet 'git push' does nothing? Let's try to
figure:

-- 8< --
$ git push -v
Pushing to /var/local/group/firmware/git/jps2rin
To /var/local/group/firmware/git/jps2rin
 = [up to date]      linux -> linux
updating local tracking ref 'refs/remotes/origin/linux'
Everything up-to-date
-- 8< --

So it pushes branch 'linux' to 'linux' at

/var/local/group/firmware/git/jps2rin

where everything is already published... And this push destination
doesn't match 'vendor/jps2rin_arm' to which both 'git status' and 'git
branch -vv' refer, so that's where the difference is! 

Here is actual branch configuration:

-- 8< --
$ git config --get-regexp branch[.]linux
branch.linux.remote vendor
branch.linux.merge jps2rin_arm
branch.linux.pushremote origin
branch.linux.rebase preserve
$ git remote -v
origin	/var/local/group/firmware/git/jps2rin (fetch)
origin	/var/local/group/firmware/git/jps2rin (push)
vendor	ssh://git@git/gis/Justin2 (fetch)
vendor	ssh://git@git/gis/Justin2 (push)
-- 8< --

So, finally, it's 'branch.linux.pushremote' that is the "offender".

Looks like both 'git status' and 'git branch -vv' should somehow learn
about 'branch.<name>.pushremote' feature so that their
output/suggestions make more sense?

By the way, is there a simpler/better way to print entire configuration
of a [current] branch? More human-readable? Including
"branch.<name>.description"?

$ git --version
git version 2.20.0.1.g8ad5d13

-- 
Sergey

             reply	other threads:[~2018-12-12  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12  7:15 Sergey Organov [this message]
2018-12-12  9:48 ` Minor(?) usability issue with branch.<name>.pushRemote Junio C Hamano
2018-12-12 11:18   ` Sergey Organov

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=871s6n43ng.fsf@javad.com \
    --to=sorganov@gmail.com \
    --cc=git@vger.kernel.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 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).