Add a new global command to template language rev(revset: String) -> List<Commit>
#7236
Replies: 5 comments 2 replies
-
See the discussion in #6891 which is about something similar but not the same |
Beta Was this translation helpful? Give feedback.
-
Perhaps, we can add https://repo.mercurial-scm.org/hg/help/templating We can also add revset function. |
Beta Was this translation helpful? Give feedback.
-
As a dirty hack to get something... sorta like the initial request, you could add this to you .bashrc: alias jjd="jj describe -m \"\$(jj log -T 'local_bookmarks ++ \"\n\"' --no-graph -r \"heads(::@- & bookmarks())\") - \" --edit" or if nushell is your main shell alias jjd = jj describe -m $'(jj log -T "local_bookmarks ++ '\n'" --no-graph -r "heads(::@- & bookmarks())") - ' --edit Maybe can be improved on? :/ |
Beta Was this translation helpful? Give feedback.
-
it's a good idea |
Beta Was this translation helpful? Give feedback.
-
#7422 lists least two other thing this would be nice for. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking to update my draft commit description template to automatically start with the name of the closest bookmark head (same logic as jj tug). I don't think I can accomplish this however, because there's no way to perform a revset query on its own to get potential bookmarks.
Here's what I imagine this would look like:
I'm not sure if this is a good idea or not, but I used to use a git hook
commit-msg
to do this.Personally, I think the approach of appending it to the default message is way way better. That way you can strip the suggested bookmarks if you don't want them in the commit message. But after going through the templating language, I can't see a way to do it.
For context on why I want to do this: It's a common workflow in our company to append the name of the ticket you are working on to the work you did for it. We have some handy dandy scripts that look through the git history and update the status of the ticket with information about what work has been done for a ticket, and where that work is in our release cycle.
All fine and dandy, Unless a squishy human developer fat fingers the ticket ID and suddenly it looks like no work has been done but the ticket got closed.
jujutsu please, I wish for the certainty of steel. 🦾
Beta Was this translation helpful? Give feedback.
All reactions