Re: [PATCH 1/3] branch: introduce --set-upstream-to

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:

> You can think of it this way.
>
> "git branch" can not only _create_ a new branch (or list existing
> ones, but that is another entirely different mode), but also can be
> used to set attributes to an existing branch.  Imagine a new option,
> say --set-description, to replace branch.frotz.description, for
> example.  It would be used like this:
>
> 	$ git branch --set-description='add frotz feature' frotz

That's the same question.

You say that it would be used like that.  I say that it would be
more intuitive, given how "git remote", "git config", and other
commands other than "update-index --chmod" that set attributes already
work, for it to be used like this:

	git branch --set-description frotz 'add frotz feature'

Notice how similar that is to "git remote set-head origin master".
It would just be the consistent thing to do.

The truth is that neither one of us is right.  Both conventions
could work, and which one is more intuitive will vary from person
to person.  The convention used for plain "git branch" is

	copy(target, source)

That matches memcpy() and is the opposite of what "cp" uses.  Oh
well.  The convention used for "git remote add" is

	method(this, args...)

It's generally pretty natural.  The convention used for "git
update-index --chmod" is

	action(parameters)(files...)

That matches "chmod" so it was probably a good choice.

Hoping that clarifies,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]