All of lore.kernel.org
 help / color / mirror / Atom feed
* Adding new/create & del/delete aliases into git
@ 2021-12-16 13:29 Jasdeep Khalsa
  2021-12-16 23:43 ` Ævar Arnfjörð Bjarmason
  2021-12-17  0:57 ` Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Jasdeep Khalsa @ 2021-12-16 13:29 UTC (permalink / raw)
  To: git

Hi there Git Community!

I've been using the following aliases for a long time:

del or delete = branch -D
new or create = checkout -b

And I feel these are good candidates as an addition into the core git
API as they provide an easy way for new starters to understand the
creating and deleting of branches - which is arguably one of the most
common git operations.

In comparison, passing in flags for this purpose for new starters to
git, is both hard to remember and not easy or obvious to understand
what is going on.

From my understanding, these flags were also meant as a shortcut to do
a git branch && git checkout in one operation - effectively being
alias flags anyway.

So I wanted to reach out to find out what appetite there may be out
there to add/change these to be simpler for new starters to git :)

Thanks for considering my proposal and happy to discuss any thoughts!

Jasdeep

https://github.com/jasdeepkhalsa

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding new/create & del/delete aliases into git
  2021-12-16 13:29 Adding new/create & del/delete aliases into git Jasdeep Khalsa
@ 2021-12-16 23:43 ` Ævar Arnfjörð Bjarmason
  2021-12-17  0:57 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-12-16 23:43 UTC (permalink / raw)
  To: Jasdeep Khalsa; +Cc: git


On Thu, Dec 16 2021, Jasdeep Khalsa wrote:

> Hi there Git Community!
>
> I've been using the following aliases for a long time:
>
> del or delete = branch -D
> new or create = checkout -b
>
> And I feel these are good candidates as an addition into the core git
> API as they provide an easy way for new starters to understand the
> creating and deleting of branches - which is arguably one of the most
> common git operations.

As a general advice if we're providing any sort of sugar / default flags
either as a guide or as aliases for newcomers it's probably good to not
do so with --force, i.e. your -D will shred data users might still want,
better to make it a -d. You can always add -D when needed.

> In comparison, passing in flags for this purpose for new starters to
> git, is both hard to remember and not easy or obvious to understand
> what is going on.
>
> From my understanding, these flags were also meant as a shortcut to do
> a git branch && git checkout in one operation - effectively being
> alias flags anyway.
>
> So I wanted to reach out to find out what appetite there may be out
> there to add/change these to be simpler for new starters to git :)
>
> Thanks for considering my proposal and happy to discuss any thoughts!
>
> Jasdeep
>
> https://github.com/jasdeepkhalsa

There was a more extensive proposal discussed on-list recently here:
https://lore.kernel.org/git/20210702100506.1422429-6-felipe.contreras@gmail.com/

I think if you're interested reading that & using some of the things
that came up there as a jumping-off point would be a good place to
start.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding new/create & del/delete aliases into git
  2021-12-16 13:29 Adding new/create & del/delete aliases into git Jasdeep Khalsa
  2021-12-16 23:43 ` Ævar Arnfjörð Bjarmason
@ 2021-12-17  0:57 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2021-12-17  0:57 UTC (permalink / raw)
  To: Jasdeep Khalsa; +Cc: git

Jasdeep Khalsa <jasdeepkhalsa1@gmail.com> writes:

> I've been using the following aliases for a long time:
>
> del or delete = branch -D
> new or create = checkout -b
>
> And I feel these are good candidates as an addition into the core git
> API as they provide an easy way for new starters to understand the
> creating and deleting of branches - which is arguably one of the most
> common git operations.

He wants to see his "create" to create and "delete" to delete a
worktree, not a branch.  And she wants to see her "create" to create
and "delete" to delete a repository, not a branch.

Not everybody shares your "feel that these are common".

Aliases and synonyms are so personal and it is better to make sure
that we do not define more than necessary at the public level.
Otherwise we will end up squatting on more good names that people
may want to use for their own aliases.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-17  0:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 13:29 Adding new/create & del/delete aliases into git Jasdeep Khalsa
2021-12-16 23:43 ` Ævar Arnfjörð Bjarmason
2021-12-17  0:57 ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.