[PATCH git-remote-gcrypt imported] Allowing git-config to configure ...
Sean Whitton
spwhitton at spwhitton.name
Mon Jun 1 22:29:56 BST 2020
Hello,
On Fri 29 May 2020 at 03:42PM +01, Jay Colson wrote:
> diff --git a/README.rst b/README.rst
> index 04b656d..9fe96c8 100644
> --- a/README.rst
> +++ b/README.rst
> @@ -97,6 +97,17 @@ The following ``git-config(1)`` variables are supported:
> ``rsync://`` backend. If the flags are set to a specific remote, the
> global flags, if also set, will not be applied for that remote.
>
> +``remote.<name>.gcrypt-force-required``
> + ..
> +``gcrypt.force-required``
> + A known issue is that every git push effectively has a ``--force``.
> +
> + By default, git-remote-gcrypt will warn the user of this known issue
> + when a push is requested without the ``--force`` flag.
> +
> + If this flag is set to ``true``, git-remote-gcrypt will fail to push,
> + as a precaution, unless ``--force`` is passed to git.
> +
If you prefix your refspecs with a '+', instead of passing --force, that
will suppress the warning too, right?
I think that should be reflected in the docs.
> diff --git a/git-remote-gcrypt b/git-remote-gcrypt
> index 689e025..b71e10c 100755
> --- a/git-remote-gcrypt
> +++ b/git-remote-gcrypt
> @@ -725,6 +727,13 @@ do_fetch()
> # do_push PUSHARGS (multiple lines like +src:dst, with both + and src opt.)
> do_push()
> {
> + if [ "$Conf_force_required" = true ] && [ "+" != "${1:0:1}" ]
> + then
> + echo_die "gcrypt.force-required is set to true. For your protection you must pass --force in order to push your repository."
> + elif [ "+" != "${1:0:1}" ]
> + then
> + echo_info "--force push occurring! Please set 'git config --global add gcrypt.force-required true' to protect from accidental force pushes."
> + fi
> # Security protocol:
> # Each git packfile is encrypted and then named for the encrypted
> # file's hash. The manifest is updated with the pack id.
Same comment here.
Maybe you could say "implicit force push" to refer to grg's behaviour
and request the user make an "explicit force push" to override the
warning/error?
--
Sean Whitton
More information about the sgo-software-discuss
mailing list