{"thread":{"id":"50014","subject":"Minor(?) usability issue with branch.<name>.pushRemote","startedAt":"2018-12-12T07:15:20Z","lastAt":"2018-12-12T11:18:18Z","messageCount":3,"participants":["Sergey Organov","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"365153","messageId":"871s6n43ng.fsf@javad.com","threadId":"50014","inReplyTo":null,"subject":"Minor(?) usability issue with branch.<name>.pushRemote","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2018-12-12T07:15:15Z","receivedAt":"2018-12-12T07:15:20Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Hello,\n\nI've got confusing behavior and the cause was somewhat hard to discover:\n\n-- 8< --\n$ git status\nOn branch linux\nYour branch is ahead of 'vendor/jps2rin_arm' by 2 commits.\n  (use \"git push\" to publish your local commits)\n\nnothing to commit, working tree clean\n$ git push\nEverything up-to-date\n$ git status\nOn branch linux\nYour branch is ahead of 'vendor/jps2rin_arm' by 2 commits.\n  (use \"git push\" to publish your local commits)\n\nnothing to commit, working tree clean\n$ git branch -vv\n* linux  e8906f9 [vendor/jps2rin_arm: ahead 2] Linux: get rid of unused files\n  master 4d1f931 [origin/master] Linux: add README and config\n-- 8< --\n\nWhat's going on here? Why 'git status' and 'git branch' both insist\nthere are 2 unpushed commits yet 'git push' does nothing? Let's try to\nfigure:\n\n-- 8< --\n$ git push -v\nPushing to /var/local/group/firmware/git/jps2rin\nTo /var/local/group/firmware/git/jps2rin\n = [up to date]      linux -> linux\nupdating local tracking ref 'refs/remotes/origin/linux'\nEverything up-to-date\n-- 8< --\n\nSo it pushes branch 'linux' to 'linux' at\n\n/var/local/group/firmware/git/jps2rin\n\nwhere everything is already published... And this push destination\ndoesn't match 'vendor/jps2rin_arm' to which both 'git status' and 'git\nbranch -vv' refer, so that's where the difference is! \n\nHere is actual branch configuration:\n\n-- 8< --\n$ git config --get-regexp branch[.]linux\nbranch.linux.remote vendor\nbranch.linux.merge jps2rin_arm\nbranch.linux.pushremote origin\nbranch.linux.rebase preserve\n$ git remote -v\norigin\t/var/local/group/firmware/git/jps2rin (fetch)\norigin\t/var/local/group/firmware/git/jps2rin (push)\nvendor\tssh://git@git/gis/Justin2 (fetch)\nvendor\tssh://git@git/gis/Justin2 (push)\n-- 8< --\n\nSo, finally, it's 'branch.linux.pushremote' that is the \"offender\".\n\nLooks like both 'git status' and 'git branch -vv' should somehow learn\nabout 'branch.<name>.pushremote' feature so that their\noutput/suggestions make more sense?\n\nBy the way, is there a simpler/better way to print entire configuration\nof a [current] branch? More human-readable? Including\n\"branch.<name>.description\"?\n\n$ git --version\ngit version 2.20.0.1.g8ad5d13\n\n-- \nSergey\n"},{"id":"365165","messageId":"xmqqh8fjhy8k.fsf@gitster-ct.c.googlers.com","threadId":"50014","inReplyTo":"871s6n43ng.fsf@javad.com","subject":"Re: Minor(?) usability issue with branch.<name>.pushRemote","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-12-12T09:48:27Z","receivedAt":"2018-12-12T09:48:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergey Organov <sorganov@gmail.com> writes:\n\n> So, finally, it's 'branch.linux.pushremote' that is the \"offender\".\n>\n> Looks like both 'git status' and 'git branch -vv' should somehow learn\n> about 'branch.<name>.pushremote' feature so that their\n> output/suggestions make more sense?\n\nDoesn't \"ahead of X by N\" mean \"you forked from X and built N commits\non top\", not \"you have N commits that is not in X which is where you\nwould push to\"?\n\n"},{"id":"365167","messageId":"87d0q72du2.fsf@javad.com","threadId":"50014","inReplyTo":"xmqqh8fjhy8k.fsf@gitster-ct.c.googlers.com","subject":"Re: Minor(?) usability issue with branch.<name>.pushRemote","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2018-12-12T11:18:13Z","receivedAt":"2018-12-12T11:18:18Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sergey Organov <sorganov@gmail.com> writes:\n>\n>> So, finally, it's 'branch.linux.pushremote' that is the \"offender\".\n>>\n>> Looks like both 'git status' and 'git branch -vv' should somehow learn\n>> about 'branch.<name>.pushremote' feature so that their\n>> output/suggestions make more sense?\n>\n> Doesn't \"ahead of X by N\" mean \"you forked from X and built N commits\n> on top\", not \"you have N commits that is not in X which is where you\n> would push to\"?\n\nSure, but the problem is that 'git status' gives exact suggestion:\n\n (use \"git push\" to publish your local commits)\n\nthat is somewhat misleading in this particular case ('git push' is now a\nno-op), and then 'git branch -vv', while tells me relationship to\n\"upstream\", keeps silence about non-matching push destination.\n\nTo add even more complexity to the case, notice that the first time\nafter I committed locally, the invocation of 'git push' (exactly as\nsuggested by 'git status') did successfully push those two commits, so\nthe suggestion is exactly right before the commits are pushed, yet\nis rather misleading afterwards.\n\n-- \nSergey\n"}]}