From: Junio C Hamano <gitster@pobox.com>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: "Jakub Narebski" <jnareb@gmail.com>, "Git List" <git@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] add a --delete option to git push
Date: Thu, 13 Aug 2009 23:53:50 -0700 [thread overview]
Message-ID: <7vab22ubr5.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1250226349-20397-2-git-send-email-srabbelier@gmail.com> (Sverre Rabbelier's message of "Thu\, 13 Aug 2009 22\:05\:48 -0700")
Sverre Rabbelier <srabbelier@gmail.com> writes:
> Currently `git push --delete master:master` results in a somewhat
> cryptic error message. ...
What does "git push --delete name:destination" say?
What does "git push --delete :destination" say?
> ... It seems unlikely however, that those new
> to git would use the 'old:new' notation,...
I doubt that assumption is warranted. I've seen new people on this list
who want to be as specific as possible before they get familiar with the
tool (I guess it is in the same spirit that they like to spell out long
option names instead of short ones).
And I happen to think it is a good discipline, when learning a new tool,
to understand the underlying generic model before advancing to lazy and
useful short-hand. That's how I teach in my upcoming book.
Your "old:new" demonstrates a fuzzy understanding of the underlying
concept. They are not <old> nor <new>. They are <object name> and
<destination>; with this object, update that destination. And you can
abbreviate when they are textually spelled the same. I.e. "git push
origin master" is equivalent to "git push origin master:master" because
both sides are spelled 'm a s t e r' the same way.
Having said all that.
I tend to agree with Jeff that it would probably make sense to limit this
new feature to colonless form and error out if you see a refspec with a
colon and --delete at the same time. Also --delete should imply not
looking at configured refspecs at all. After all, this is incompatible
with the way git expresses push with refspecs, and trying to mix these two
would lead to confusion.
I do not mean that this new feature is useless nor stupid. Being able to
say "git push --delete branch1 branch2" matches _a_ mental model (perhaps
Hg inspired one) _very_ naturally. There are branches on the other side,
and there is a special operation called 'delete' that you can inflict on
them.
But it is a different mental model of how git natively does "push". In
git model, you give list of instructions <which branch to update with what
commit>, and as a special case "what commit" could be "empty" to signal
deletion, and "push" carries out the instructions.
These are both valid models. They just do not mix, so let's avoid
confusion by not allowing both at the same time.
next prev parent reply other threads:[~2009-08-14 6:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-14 5:05 [RFC PATCH 0/2] add a --delete option to git push Sverre Rabbelier
2009-08-14 5:05 ` [RFC PATCH 1/2] " Sverre Rabbelier
2009-08-14 5:05 ` [RFC PATCH 2/2] test that git push --delete deletes the remote ref Sverre Rabbelier
2009-08-14 5:21 ` [RFC PATCH 1/2] add a --delete option to git push Jeff King
2009-08-14 6:24 ` Sverre Rabbelier
2009-08-14 6:33 ` Jeff King
2009-08-14 6:40 ` Sverre Rabbelier
2009-08-14 6:55 ` Jeff King
2009-08-14 6:53 ` Junio C Hamano [this message]
2009-08-14 7:00 ` Jeff King
2009-08-14 7:01 ` Jeff King
2009-08-14 7:05 ` Sverre Rabbelier
2009-08-14 7:51 ` Junio C Hamano
2009-08-15 2:01 ` Junio C Hamano
2009-08-16 2:30 ` Sverre Rabbelier
2009-08-16 9:19 ` Jakub Narebski
2009-08-14 8:50 ` [RFC PATCH 0/2] " Jakub Narebski
[not found] ` <fabb9a1e0908140953w2d3f571cv3e7415817c2758a7@mail.gmail.com>
2009-08-14 20:25 ` Jakub Narebski
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=7vab22ubr5.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=srabbelier@gmail.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