Граф коммитов

15 Коммитов

Автор SHA1 Сообщение Дата
Derrick Stolee 6ef9242a52 scalar reconfigure: help users remove buggy repos
When running 'scalar reconfigure -a', such as at install time, Scalar
has warning messages about the repository missing (or not containing a
.git directory). Failures can also happen while trying to modify the
repository-local config for that repository.

These warnings may seem confusing to users who don't understand what
they mean or how to stop them.

Add a warning that instructs the user how to remove the warning in
future installations.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
2022-07-12 12:28:23 +02:00
Victoria Dye 071493708a scalar: upgrade to newest FSMonitor config setting
When FSMonitor was upstreamed, the 'core.useBuiltinFSMonitor' config was
deprecated and replaced with an overload of the 'core.fsmonitor' config
(i.e., if a boolean value was specified in 'core.fsmonitor', it is treated
the way 'core.useBuiltinFSMonitor' originally was). Because 'scalar
register' actively sets that config, use it to upgrade the deprecated config
setting.

Co-authored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Victoria Dye <vdye@github.com>
2022-07-12 12:28:23 +02:00
Johannes Schindelin d0b778212e scalar diagnose: accommodate Scalar's Functional Tests
Those tests specifically verify that the `.zip` file path is shown on
`stdout`. Let's do that again, under the assumption that there are
scripts out there that rely on this behavior.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-07-12 12:28:23 +02:00
Johannes Schindelin 967ef10547 scalar: parse `clone --no-fetch-commits-and-trees` for backwards compatibility
This option does not do anything anymore, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-07-12 12:28:23 +02:00
Derrick Stolee f6acdf12d2 scalar: enable untracked cache unconditionally
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2022-07-12 12:28:23 +02:00
Johannes Schindelin 86b315bbd0 scalar: add a test toggle to skip accessing the vsts/info endpoint
In Scalar's functional tests, we do not do anything with authentication.
Therefore, we do want to avoid accessing the `vsts/info` endpoint
because it requires authentication even on otherwise public
repositories.

Let's introduce the environment variable `SCALAR_TEST_SKIP_VSTS_INFO`
which can be set to `true` to simply skip that step (and force the
`url_*` style repository IDs instead of `id_*` whenever possible).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-07-12 12:28:23 +02:00
Johannes Schindelin 8c92ee04aa scalar: add the `cache-server` command
This allows setting the GVFS-enabled cache server, or listing the one(s)
associated with the remote repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-07-12 12:28:23 +02:00
Johannes Schindelin 376793131f scalar: only try GVFS protocol on https:// URLs
Well, technically also the http:// protocol is allowed _when testing_...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-07-12 12:28:22 +02:00
Johannes Schindelin 6796d08e54 scalar diagnose: include shared cache info
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-07-12 12:28:22 +02:00
Johannes Schindelin f38ceb4dc0 scalar: do initialize `gvfs.sharedCache`
This finalizes the port of the `QueryVstsInfo()` function: we already
taught `gvfs-helper` to access the `vsts/info` endpoint on demand, we
implemented proper JSON parsing, and now it is time to hook it all up.

To that end, we also provide a default local cache root directory. It
works the same way as the .NET version of Scalar: it uses

    C:\scalarCache on Windows,

    ~/.scalarCache/ on macOS and

    ~/.cache/scalar on Linux

Modified to include call to is_unattended() that was removed from a
previous commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-07-12 12:28:22 +02:00
Johannes Schindelin 8ccae13335 scalar clone: support GVFS-enabled remote repositories
With this change, we come a big step closer to feature parity with
Scalar: this allows cloning from Azure Repos (which do not support
partial clones at time of writing).

We use the just-implemented JSON parser to parse the response we got
from the `gvfs/config` endpoint; Please note that this response might,
or might not, contain information about a cache server. The presence or
absence of said cache server, however, has nothing to do with the
ability to speak the GVFS protocol (but the presence of the
`gvfs/config` endpoint does that).

An alternative considered during the development of this patch was to
perform simple string matching instead of parsing the JSON-formatted
data; However, this would have been fragile, as the response contains
free-form text (e.g. the repository's description) which might contain
parts that would confuse a simple string matcher (but not a proper JSON
parser).

Note: we need to limit the re-try logic in `git clone` to handle only
the non-GVFS case: the call to `set_config()` to un-set the partial
clone settings would otherwise fail because those settings would not
exist in the GVFS protocol case. This will at least give us a clearer
reason why such a fetch fails.

Co-authored-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2022-07-12 12:28:22 +02:00
Johannes Schindelin 818c1bf7be scalar: support the `config` command for backwards compatibility
The .NET version supported running `scalar config` to reconfigure the
current enlistment, and now the C port does, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-17 14:59:51 +02:00
Derrick Stolee ef629cf514 scalar: add retry logic to run_git()
Use a fixed 3 tries total to see how that increases our chances of
success for subcommands such as 'git fetch'.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2022-06-17 14:59:51 +02:00
Johannes Schindelin 84d67330b1 scalar (Windows): use forward slashes as directory separators
Git traditionally uses those, not backslashes, ever.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-17 14:59:51 +02:00
Johannes Schindelin d2e5e79729 scalar: move it out of contrib/
With this patch, `scalar` becomes a fully-supported top-level Git
command. The Scalar executable is installed by default as well as its
documentation, and its (minimal) regression test is run as part of the
full test suite.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-06-17 14:59:50 +02:00