zaquestion / lab

Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab
https://zaquestion.github.io/lab
Creative Commons Zero v1.0 Universal
1.1k stars 103 forks source link

`issue`: add alias for just `i`? #810

Closed claytonrcarter closed 2 years ago

claytonrcarter commented 2 years ago

I hesitate to make this request b/c it might be workflow specific to me (or just me being laaaazy), but I use lab issue a lot and would love to have a built-in alias for just lab i.

Considerations

Workaround I currently have a git alias defined for this: i = "!lab issue", and this works, but it triggers the "lab's git passthrough command support will be removed in a later release." warning whenever I use it.

Is there a way to create custom command aliases just w/i lab, or is the only way to do this w/ a code change w/i lab?

claytonrcarter commented 2 years ago

Oops, looks like my workaround won't work much longer: #809

prarit commented 2 years ago

@claytonrcarter , you're not the only one that has thought of this. I too am "laaaazy" :) and have thought about the same thing. I decided not to do it because I thought it was "too shorthand" if that makes any sense. I've opted, like yourself, to have just alias commands like 'alias mrlist="lab mr list"'.

We're dropping the git passthrough code (@bmeneg has an MR on this IIRC) so the alias you've described above should work better than it currently does.

bmeneg commented 2 years ago

Yes, #809 should drop the passthrough logic altogether and I'll also update the README for recommending git-alias instead with some examples like yours and Prarit's.

I don't have a strong opinion about shortening top-level commands to one-letter, I would be fine with it, but at the same time we would need to get other commands the same shorthand and, probably, start handling shorthand conflicts more often :).

If bash/git aliasing is fine by you, lets keep it as is.

prarit commented 2 years ago

@bmeneg, as usual you hit the nail on the head. My real concern is that we'd have to make this single letter alias for all commands and it would just get out-of-hand quickly. @claytonrcarter, yeah it's a bit of a pain to use aliases but I do think for our own sanity ;) it would be best to continue to use them.

Of course, this does nothing to alleviate our mutual laziness :)

bmeneg commented 2 years ago

@claytonrcarter check PR #811 for the README rework.

claytonrcarter commented 2 years ago

Of course, this does nothing to alleviate our mutual laziness :)

Indeed, we're hopeless. :)

To be clear, my "workaround" was leveraging the pass through so that I could do lab i, which would pass through to git as git i, which then re-resolve it to lab issue ... yuck! But it works! For now ...

I certainly understand the concerns about it being "too shorthandy" (that was my main hesitance, too) but may I offer:

OK, that's my piece. I'll stop pushing. I certainly don't want to clog anything up. If you both still feel like this would be bad precedent, that's fine. It won't kill me to just maintain a local branch w/ my beloved lab i alias. 😄

bmeneg commented 2 years ago

Being honest.. I'm inclined to accept your offer :). You hit the point about showing that we don't really need one-letter shorthand for all the commands: todo and fork are indeed already somewhat shorthand themselves.

Well, I think you won @claytonrcarter :D. I'm going to open the PR and let @prarit scream at me for that (or hug me? :smile:).