The problem is that a jj change with a conflict is represented as a dummy git patch with a set of empty directories. When `git diff HEAD` processes a branch containing such a commit, it thinks that every file in the repo was changed.
With this patch, things still won't go well if you try to run `mach clang-format` when your patch stack is based on a conflict, but that's a kind of weird thing to do. (It's reasonable to get a conflict, `jj new <conflict>`, fix it, then run `mach clang-format` with the intention of reformatting the fixed tree, which previously broke.)
Differential Revision: https://phabricator.services.mozilla.com/D262707
Currently, the caller potentially prepares files, add them to the VCS,
and then calls the function to create the commit, does whatever it wants
to do with it, then undoes it.
With the ultimate goal of not doing local changes to the work tree to
act on that try commit (for a push), this change in API makes it so
that everything except what do do with the commit is handled by one
function, that now takes paths and file contents for the files that were
previously created by the caller.
Differential Revision: https://phabricator.services.mozilla.com/D214214
A previous patch added parsing `git remote -v`, preferring
`mozilla-unified` as the official upstream remote and falling
back to the first official-looking remote if unified was not
found. We assumed that a developer is either using mozilla-unified,
or is using a single-headed repo like central. This overlooks
the fact that it is possible to clone from central, and then
pull other repos in, creating a repo with multiple official
remotes.
Update the `get_upstream_remote` function to find all official
looking remotes instead of a single official remote, and change
the `get_remote_arg` function to return a list of `--remotes`
arguments to be passed to various Git commands. This allows
Git to take all official remotes into consideration and more
precisely find the commits which are not present on any official
upsteams.
Add a test for `get_mozilla_remote_args` while we are here.
Differential Revision: https://phabricator.services.mozilla.com/D199637