Can you parameterize aliases / make functions #7129
-
Can you create aliases with defaults and / or read parameters in jj? The documentation is a little unclear (or doesn't quite seem to cover it?), and I haven't found any clear answers to it. (So I'm actually guessing you probably want a shell function for this, but thought I'd ask.) Specifically, what I have found myself doing a lot, is jj git push --named <branch>=<rev> (For my own convenience, I've been using a branch/bookmark name that maps to the ticket I'm working on.) This isn't terrible, but it's a little more typing than I'd like. Ideally, I'd like to create an alias--such as jj pub xyz to be the same as jj git push --named xyz=@- and jj pub abc @ to be the same as jj git push --named abc=@ Is that possible in the jj config file, or is this something I'll need to create a shell function for instead? ChatGPT says this needs to be a shell function, so that's what I'm expecting. But still, it'd be nice if it could just live in the jj config file. Come to think of it, I think I've seen aliases that are actual shell scripts? Is this a use case for one of those? Are there docs for that? I tried searching the docs, but couldn't find them. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
No native support yet. You'll have to use shell script. There's an idea, but it's not landed. |
Beta Was this translation helpful? Give feedback.
No native support yet. You'll have to use shell script.
There's an idea, but it's not landed.
#3673 (comment)