Skip to content

Feature request: Can a parameter be given to "stg goto" so that it can go to a commit ID rather than a patch name #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dhowells opened this issue Jan 13, 2021 · 4 comments

Comments

@dhowells
Copy link

Can "stg goto" be given a new parameter that allows you to specify the patch to go to by commit ID rather than by patch name?E.g.:

stg goto -c 1e08868e23502e59205b6208483e967b3e6c3f1a

Alternatively/additionally, it would be handy to have a way to look up the name of a patch by commit ID, maybe:

stg id -n 1e08868e23502e59205b6208483e967b3e6c3f1a

giving the name of the patch rather than its ID.

@jpgrayson
Copy link
Collaborator

These features seems possible to implement. We would have to linearly scan the stack's patches' commits to find id matches, which wouldn't be too costly.

My question is: why? I'm interested in the context or application where these features would be useful. At the moment, I'm unconvinced that these would be worth the implementation effort and maintenance overhead, but I'm willing to be convinced otherwise.

@dhowells
Copy link
Author

Because git blame gives you a commit ID, and there's no direct way to turn the commit ID into an stgit patch name.

@jpgrayson
Copy link
Collaborator

This use case makes sense to me. Thanks for clarifying.

Add the features you suggest to goto and/or id would be okay with me. I will work on it eventually if nobody submits a PR.

jpgrayson added a commit that referenced this issue Apr 23, 2021
A partial sha1 hash may now be provided to `stg goto`. The sha1 must
unambiguously map to a patch within the current branch.

Signed-off-by: Peter Grayson <[email protected]>
@jpgrayson
Copy link
Collaborator

This feature was added in 1069060. Note that the patch's hash may be specified as an argument on the command line in place of a patch name; i.e. not as a command line option (no -c option).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants