Skip to content

diff.git: Add a show-path-prefix option to disable a/ and b/ prefixes#9231

Merged
jonmeow merged 1 commit intojj-vcs:mainfrom
jonmeow:git-diff-prefix
Apr 6, 2026
Merged

diff.git: Add a show-path-prefix option to disable a/ and b/ prefixes#9231
jonmeow merged 1 commit intojj-vcs:mainfrom
jonmeow:git-diff-prefix

Conversation

@jonmeow
Copy link
Copy Markdown
Contributor

@jonmeow jonmeow commented Apr 1, 2026

Adding this based on the feature request in #9102.

There's a question there of whether a convenience flag would be helpful (presumably something like --git-path-prefix. This PR isn't adding that because I thought --config=diff.git.show-path-prefix=<value> might be good enough; i.e., maybe flipping back and forth won't be a common operation and so keeping the jj diff options smaller would be better.

Fixes #9102

@jonmeow jonmeow requested a review from a team as a code owner April 1, 2026 18:39
@PhilipMetzger
Copy link
Copy Markdown
Contributor

PhilipMetzger commented Apr 1, 2026

Please put all of that in the commit description to adhere to our style thanks. Also moves the fixes line into to it per our conventions.

Copy link
Copy Markdown
Contributor Author

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put all of that in the commit description to adhere to our style thanks. Also moves the fixes line into to it per our conventions.

Fixed. Thanks for pointing that out.

@josephlou5
Copy link
Copy Markdown
Contributor

With the new setting name change, could you also update the commit description and PR title and description?

@PhilipMetzger
Copy link
Copy Markdown
Contributor

Please put all of that in the commit description to adhere to our style thanks. Also moves the fixes line into to it per our conventions.

Fixed. Thanks for pointing that out.

Thanks, now my last minor thing is that you dropped the Assisted-By: line. We currently don't really have a policy on them but I think we should add them for AI-assisted commits.

@jonmeow jonmeow changed the title diff.git: Add a no-prefix option to disable a/ and b/ prefixes diff.git: Add a path-prefix option to disable a/ and b/ prefixes Apr 1, 2026
@jonmeow
Copy link
Copy Markdown
Contributor Author

jonmeow commented Apr 1, 2026

With the new setting name change, could you also update the commit description and PR title and description?

Should be updated now

Thanks, now my last minor thing is that you dropped the Assisted-By: line. We currently don't really have a policy on them but I think we should add them for AI-assisted commits.

Re-added. Not sure if it's worth noting, but in this case I wasn't using an agent [ed: for coding], just tab completion -- but to avoid ambiguities, I'm happy to just add it if I'm using an AI-assisted IDE at all.

@PhilipMetzger
Copy link
Copy Markdown
Contributor

Re-added. Not sure if it's worth noting, but in this case I wasn't using an agent [ed: for coding], just tab completion -- but to avoid ambiguities, I'm happy to just add it if I'm using an AI-assisted IDE at all.

OK, then you can drop it or keep it w/e you prefer. I assume it was initially added because you have a similar config as https://github.com/carbon-language/carbon-lang/blob/5b7c908e8b92e53328337892c5368a13abec505f/docs/project/contribution_tools.md#jujutsu-jj?

@jonmeow
Copy link
Copy Markdown
Contributor Author

jonmeow commented Apr 1, 2026

Re-added. Not sure if it's worth noting, but in this case I wasn't using an agent [ed: for coding], just tab completion -- but to avoid ambiguities, I'm happy to just add it if I'm using an AI-assisted IDE at all.

OK, then you can drop it or keep it w/e you prefer. I assume it was initially added because you have a similar config as https://github.com/carbon-language/carbon-lang/blob/5b7c908e8b92e53328337892c5368a13abec505f/docs/project/contribution_tools.md#jujutsu-jj?

Yes, exactly. :)

I'm fine keeping it, Carbon's own process is noted at https://github.com/carbon-language/carbon-lang/blob/trunk/CONTRIBUTING.md#using-ai-based-contribution-tools. "largely derived from AI-based tooling" is a pretty subjective bar, and I find it easier to err on the side of marking it as long as I use AI tooling at all.

@jonmeow jonmeow changed the title diff.git: Add a path-prefix option to disable a/ and b/ prefixes diff.git: Add a show-path-prefix option to disable a/ and b/ prefixes Apr 1, 2026
@jonmeow jonmeow requested a review from josephlou5 April 1, 2026 21:26
Copy link
Copy Markdown
Contributor

@josephlou5 josephlou5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but still needs a review from a maintainer.

@jonmeow
Copy link
Copy Markdown
Contributor Author

jonmeow commented Apr 2, 2026

Just to note, Martin's tried adding me to contributors a couple times and (probably) Google automation keeps kicking me out (I'm leaving Google, my account is recently unlinked). I'll keep trying but may not be able to merge myself pending resolution. :)

@PhilipMetzger
Copy link
Copy Markdown
Contributor

PhilipMetzger commented Apr 2, 2026

. I'll keep trying but may not be able to merge myself pending resolution. :)

If you need it and you no longer want to fight the automation, either I, Joseph or Yuya can land it for you.

@martinvonz
Copy link
Copy Markdown
Member

I just invited you to jj-vcs/contributors again. Feel free to accept it now or later, whichever you think makes you less likely to get automatically kicked out again, perhaps :) Also feel free to let us know you prefer that we merge it for now.

Adding this based on the feature request in jj-vcs#9102.

There's a question there of whether a convenience flag would be helpful (presumably something like `--git-show-path-prefix`. This PR isn't adding that because I thought `--config=diff.git.show-path-prefix=<value>` might be good enough; i.e., maybe flipping back and forth won't be a common operation and so keeping the `jj diff` options smaller would be better.

Fixes jj-vcs#9102

Assisted-by: Google Antigravity with Gemini
Assisted-by: My AI Tool
@jonmeow jonmeow added this pull request to the merge queue Apr 6, 2026
Merged via the queue into jj-vcs:main with commit 09ede03 Apr 6, 2026
29 checks passed
@jonmeow jonmeow deleted the git-diff-prefix branch April 6, 2026 18:32
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

Successfully merging this pull request may close these issues.

FR: Support git-diff diff.noprefix option

5 participants