Skip to content
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

[Bug]: Does not work unless it is a git repository #436

Open
fzakaria opened this issue Nov 26, 2024 · 3 comments
Open

[Bug]: Does not work unless it is a git repository #436

fzakaria opened this issue Nov 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@fzakaria
Copy link

What happened?

I have been using jujutsu https://github.com/martinvonz/jj which is a Git-compatible DVCS.
Unfortunately format and format.check only work if it's a git repository.

> bazel run format.check
INFO: Invocation ID: 7569ea60-cd07-46c0-ac9f-cae2e8773c45
INFO: Analyzed target //:format.check (0 packages loaded, 3 targets configured).
INFO: Found 1 target...
Target //tools/format:format.check up-to-date:
  bazel-bin/tools/format/format.check.bash
INFO: Elapsed time: 0.308s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/tools/format/format.check.bash
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git

There should be a fallback where it just runs on all the files.

Version

bazel --version
bazel 7.4.0

bazel_dep(name = "aspect_rules_lint", version = "1.0.3")

How to reproduce

No response

Any other information?

No response

@fzakaria fzakaria added the bug Something isn't working label Nov 26, 2024
@alexeagle
Copy link
Member

Interesting, we haven't had a customer using a non-git VCS yet. PRs welcome of course.

As a workaround, you could query jj for the files that are meant to be formatted and pass them as arguments with xargs. The format command only queries git ls-files when there are no arguments of which files to format.

@fzakaria
Copy link
Author

@alexeagle jj is the equivalent to fig a bit internally at Google (in theory); I've been enjoying using it.

@fzakaria
Copy link
Author

Here was sort of a patch I was working on if someone wants to give it a shot.
Experience is meh; wonder if it's worth pursuing adding jj specifically.
patch.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants