git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Finn Arne Gangstad <finnag@pvv.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH] git push usability improvements and default change
Date: Tue, 10 Mar 2009 11:04:00 +0100	[thread overview]
Message-ID: <20090310100400.GC11448@pvv.org> (raw)
In-Reply-To: <7vfxhmdyvn.fsf@gitster.siamese.dyndns.org>

On Mon, Mar 09, 2009 at 05:07:08PM -0700, Junio C Hamano wrote:
> Finn Arne Gangstad <finnag@pvv.org> writes:
> 
> I think the last four are more or less sane, but I am not sure about the
> first three, which makes it very unfortunate that the former depends on
> the latter.

No problem splitting them up, there is just a single function that is
shared between 1-3 and 4-7 really.

[...]
>  * What's the point of having --matching option, when you can already say
>    ':', i.e.
> 
> 	$ git push origin :

If you have the name of your remote easily available, --matching is
identical to "git push remote :". As I believe I found out, getting
the name of the current remote is a bit more tedious than it should
be, which is why I also suggested being able to use "-" as the current
remote.

If a way to specify the default remote is possible, --matching would
not be necessary, but would probably be more obvious to the reader
than "git push - :" or whatever we can agree on.

>  * What's the point of having --current option, when you can already
> say HEAD, i.e.  $ git push origin HEAD

It does something very different. Maybe --tracking would be a better name.
--current does basically this:

branch=`git-symbolic-ref HEAD`
branch=${branch#refs/heads/}
remote=$(git config branch.$branch.remote)

for remotebranch in $(git config branch.$branch.merge); do
	git push $remote $branch:$remotebranch
done

This is the shortest shell script sequence I could find to mimic the
behaviour, maybe I have missed something very obvious. All error
handling is removed for clarity.

The goal here is to be able to:

git checkout -b junios-next origin/next
git push --current  <=>  git push origin junios-next:next

git push origin HEAD would do git push origin junios-next:junios-next,
which was not the intention.

It seems that there is an assumption that branch names are identical
in different repositories, we find that that is not the case at all,
people choose local names that make sense to themselves. Or, from
another viewpoint, even if branches have the same name in two
repositories, they are not necessarily (strongly) related!

"A tracks B" can be a much stronger relation than "A has the same name
as B".

>  * Is push.default still necessary if we had "remote.*.push" (where '*' is
>    literally an "asterisk") that is used as a fall-back default when there
>    is no "remote.<name>.push" for the remote we are about to push to?

The main reason for push.default is to be able to change the default
behaviour for git push to push nothing in a staged manner, and still
let people who are used to and fond of the old behavior continue as before.

You are thinking of something like this in .gitconfig?
[remote "*"]
	push = __something__

Previously you indicated that there is no way to specify the current
matching rule in a remote push line I think?

- Finn Arne

  parent reply	other threads:[~2009-03-10 10:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09 22:35 [RFC/PATCH] git push usability improvements and default change Finn Arne Gangstad
2009-03-09 22:35 ` [PATCH 1/7] remote: Make "-" an alias for the current remote Finn Arne Gangstad
2009-03-09 22:35 ` [PATCH 2/7] New config option push.default Finn Arne Gangstad
2009-03-09 22:35 ` [PATCH 3/7] git push: New options --matching and --current Finn Arne Gangstad
2009-03-09 23:49   ` Daniel Barkalow
2009-03-10  8:54     ` Finn Arne Gangstad
2009-03-09 22:35 ` [PATCH 4/7] git push: Display warning on unconfigured default push Finn Arne Gangstad
2009-03-10  0:25   ` Jay Soffian
2009-03-09 22:35 ` [PATCH 5/7] git push: Document that "nothing" is the future push default Finn Arne Gangstad
2009-03-09 22:35 ` [PATCH 6/7] git push: Change default for "git push" to nothing Finn Arne Gangstad
2009-03-09 22:35 ` [PATCH 7/7] git push: Remove warning for "git push" default change Finn Arne Gangstad
2009-03-09 23:35 ` [RFC/PATCH] git push usability improvements and " Johannes Schindelin
2009-03-10  0:12   ` Junio C Hamano
2009-03-10  8:46   ` Finn Arne Gangstad
2009-03-10 11:01     ` Johannes Schindelin
2009-03-10 11:12       ` Finn Arne Gangstad
2009-03-10  0:07 ` Junio C Hamano
2009-03-10  0:19   ` Junio C Hamano
2009-03-10 10:04   ` Finn Arne Gangstad [this message]
2009-03-10 16:20     ` Jay Soffian
2009-03-11 20:35     ` Junio C Hamano
2009-03-12  3:01       ` Nanako Shiraishi
2009-03-12 10:22         ` Finn Arne Gangstad
2009-03-12 10:52           ` Miles Bader
2009-03-12 12:20             ` Finn Arne Gangstad
2009-03-13  8:28               ` Miles Bader
2009-03-13 10:07                 ` John Tapsell
2009-03-10 17:52 ` Jeff King
2009-03-10 22:04   ` Finn Arne Gangstad
2009-03-10 22:10     ` Jeff King
2009-03-11  1:57     ` Jay Soffian

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=20090310100400.GC11448@pvv.org \
    --to=finnag@pvv.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).