jj icon indicating copy to clipboard operation
jj copied to clipboard

FR: `jj git remote list` is missing `--template` / `-T`

Open Vampire opened this issue 2 months ago • 2 comments

Is your feature request related to a problem? Please describe. For example for listing all remote branches or otherwise processing the remote names or urls.

Describe the solution you'd like --template or -T option like for other listing commands. With that you could for example do

jj bookmark list "(jj git remote list --template 'concat("--remote ", name, " ")')"

or

jj git remote list --template 'concat("--remote ", name, " ")' | xargs -or jj bookmark list

Describe alternatives you've considered

jj git remote list --quiet | cut -d ' ' -f 1 | sed 's/^/--remote /' | xargs -or jj bookmark list

Vampire avatar Oct 28 '25 11:10 Vampire

Is the intent to provide ease of scripting or trying to get around the lack of a flag like --tracked on another command?

In my view, the tool output is the source of truth, so when you can manipulate it, any future outputs are questionable, especially when the PR for using a config in the repo is approved. (this applies to all templates, not just this FR)

joyously avatar Oct 28 '25 14:10 joyously

Both I guess, besides that it is not --tracked in the example case but show all remote - and only remote - branches.

But yes, of course you can only trust the output of the tool if you specify the output template yourself. But I really like this template feature of JJ as it allows to display things exactly like needed for the current task or mood or user preference.

Vampire avatar Oct 28 '25 16:10 Vampire