{"thread":{"id":"34180","subject":"[PATCH] Documentation/git-push.txt: explain better cases where --force is dangerous","startedAt":"2013-06-17T17:52:41Z","lastAt":"2013-06-18T14:35:12Z","messageCount":6,"participants":["Matthieu Moy","Junio C Hamano","Marc Branchaud"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"221078","messageId":"1371491561-19117-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"34180","inReplyTo":null,"subject":"[PATCH] Documentation/git-push.txt: explain better cases where --force is dangerous","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-06-17T17:52:41Z","receivedAt":"2013-06-17T17:52:41Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The behavior of \"git push --force\" is rather clear when it updates only\none remote ref, but running it when pushing several branches can really\nbe dangerous. Warn the users a bit more and give them the alternative to\npush only one branch.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/git-push.txt | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 938d1ee..9b9e7d1 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -136,6 +136,14 @@ already exists on the remote side.\n \tnot an ancestor of the local ref used to overwrite it.\n \tThis flag disables the check.  This can cause the\n \tremote repository to lose commits; use it with care.\n+\tNote that `--force` applies to all the refs that are pushed,\n+\thence using it with `push.default` set to `matching` or with\n+\tmultiple push destination configured may override refs other\n+\tthan the current branch (including local refs that are\n+\tstrictly behind their remote counterpart). To force a push to\n+\tonly one branch, use a `+` in front of the refspec to push\n+\t(e.g `git push origin +master` to force a push to the `master`\n+\tbranch). See the `<refspec>...` section above for details.\n \n --repo=<repository>::\n \tThis option is only relevant if no <repository> argument is\n-- \n1.8.3.1.495.g13f33cf.dirty\n"},{"id":"221092","messageId":"7vli68cyx1.fsf@alter.siamese.dyndns.org","threadId":"34180","inReplyTo":"1371491561-19117-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] Documentation/git-push.txt: explain better cases where --force is dangerous","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-17T19:36:26Z","receivedAt":"2013-06-17T19:36:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> The behavior of \"git push --force\" is rather clear when it updates only\n> one remote ref, but running it when pushing several branches can really\n> be dangerous. Warn the users a bit more and give them the alternative to\n> push only one branch.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n\nLooks good.  Thanks.\n\n\n>  Documentation/git-push.txt | 8 ++++++++\n>  1 file changed, 8 insertions(+)\n>\n> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\n> index 938d1ee..9b9e7d1 100644\n> --- a/Documentation/git-push.txt\n> +++ b/Documentation/git-push.txt\n> @@ -136,6 +136,14 @@ already exists on the remote side.\n>  \tnot an ancestor of the local ref used to overwrite it.\n>  \tThis flag disables the check.  This can cause the\n>  \tremote repository to lose commits; use it with care.\n> +\tNote that `--force` applies to all the refs that are pushed,\n> +\thence using it with `push.default` set to `matching` or with\n> +\tmultiple push destination configured may override refs other\n> +\tthan the current branch (including local refs that are\n> +\tstrictly behind their remote counterpart). To force a push to\n> +\tonly one branch, use a `+` in front of the refspec to push\n> +\t(e.g `git push origin +master` to force a push to the `master`\n> +\tbranch). See the `<refspec>...` section above for details.\n>  \n>  --repo=<repository>::\n>  \tThis option is only relevant if no <repository> argument is\n"},{"id":"221105","messageId":"51BF7B1C.2040703@xiplink.com","threadId":"34180","inReplyTo":"1371491561-19117-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] Documentation/git-push.txt: explain better cases where --force is dangerous","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2013-06-17T21:09:48Z","receivedAt":"2013-06-17T21:09:48Z","isPatch":true,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"On 13-06-17 01:52 PM, Matthieu Moy wrote:\n> The behavior of \"git push --force\" is rather clear when it updates only\n> one remote ref, but running it when pushing several branches can really\n> be dangerous. Warn the users a bit more and give them the alternative to\n> push only one branch.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>   Documentation/git-push.txt | 8 ++++++++\n>   1 file changed, 8 insertions(+)\n>\n> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\n> index 938d1ee..9b9e7d1 100644\n> --- a/Documentation/git-push.txt\n> +++ b/Documentation/git-push.txt\n> @@ -136,6 +136,14 @@ already exists on the remote side.\n>   \tnot an ancestor of the local ref used to overwrite it.\n>   \tThis flag disables the check.  This can cause the\n>   \tremote repository to lose commits; use it with care.\n> +\tNote that `--force` applies to all the refs that are pushed,\n> +\thence using it with `push.default` set to `matching` or with\n> +\tmultiple push destination configured may override refs other\n\ns/destination/destinations/\n\n\t\tM.\n"},{"id":"221107","messageId":"7v7ghsbeoo.fsf@alter.siamese.dyndns.org","threadId":"34180","inReplyTo":"51BF7B1C.2040703@xiplink.com","subject":"Re: [PATCH] Documentation/git-push.txt: explain better cases where --force is dangerous","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-17T21:38:47Z","receivedAt":"2013-06-17T21:38:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marc Branchaud <marcnarc@xiplink.com> writes:\n\n> On 13-06-17 01:52 PM, Matthieu Moy wrote:\n>> The behavior of \"git push --force\" is rather clear when it updates only\n>> one remote ref, but running it when pushing several branches can really\n>> be dangerous. Warn the users a bit more and give them the alternative to\n>> push only one branch.\n>>\n>> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n>> ---\n>>   Documentation/git-push.txt | 8 ++++++++\n>>   1 file changed, 8 insertions(+)\n>>\n>> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\n>> index 938d1ee..9b9e7d1 100644\n>> --- a/Documentation/git-push.txt\n>> +++ b/Documentation/git-push.txt\n>> @@ -136,6 +136,14 @@ already exists on the remote side.\n>>   \tnot an ancestor of the local ref used to overwrite it.\n>>   \tThis flag disables the check.  This can cause the\n>>   \tremote repository to lose commits; use it with care.\n>> +\tNote that `--force` applies to all the refs that are pushed,\n>> +\thence using it with `push.default` set to `matching` or with\n>> +\tmultiple push destination configured may override refs other\n>\n> s/destination/destinations/\n\nGood eyes.\n\nAfter I re-read the one, I found that \"override\" somewhat a strange\nexpression.  There is nothing that overrides or to be overriden.\n\nHow about putting it like this?\n\n Documentation/git-push.txt | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 8b637d3..21294aa 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -124,6 +124,15 @@ no `push.default` configuration variable is set.\n \tnot an ancestor of the local ref used to overwrite it.\n \tThis flag disables the check.  This can cause the\n \tremote repository to lose commits; use it with care.\n+\tNote that `--force` applies to all the refs that are pushed,\n+\thence using it with `push.default` set to `matching` or with\n+\tmultiple push destinations configured with `remote.*.push`\n+\tmay push out refs other than the current branch (including\n+\tlocal refs that are strictly behind their remote counterpart).\n+\tTo force a push to only one branch, use a `+` in front of the\n+\trefspec to push\t(e.g `git push origin +master` to force a push\n+\tto the `master`\tbranch). See the `<refspec>...` section above\n+\tfor details.\n \n --repo=<repository>::\n \tThis option is only relevant if no <repository> argument is\n"},{"id":"221158","messageId":"vpq38sfx3ty.fsf@anie.imag.fr","threadId":"34180","inReplyTo":"7v7ghsbeoo.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Documentation/git-push.txt: explain better cases where --force is dangerous","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-06-18T07:42:17Z","receivedAt":"2013-06-18T07:42:17Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n\n> After I re-read the one, I found that \"override\" somewhat a strange\n> expression.  There is nothing that overrides or to be overriden.\n\nRight, I actually meant \"overwrite\".\n\n> How about putting it like this?\n\nI'm not sure \"push out refs other than the current branch\" is strong\nenough. Once you are used to \"push = fast-forward = can't loose data\",\n\"push out a ref\" is not very scary.\n\nI'd do s/push out/overwrite/, but I'm fine with your version too.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"221229","messageId":"7v1u7za3mn.fsf@alter.siamese.dyndns.org","threadId":"34180","inReplyTo":"vpq38sfx3ty.fsf@anie.imag.fr","subject":"Re: [PATCH] Documentation/git-push.txt: explain better cases where --force is dangerous","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-18T14:35:12Z","receivedAt":"2013-06-18T14:35:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>\n>> After I re-read the one, I found that \"override\" somewhat a strange\n>> expression.  There is nothing that overrides or to be overriden.\n>\n> Right, I actually meant \"overwrite\".\n>\n>> How about putting it like this?\n>\n> I'm not sure \"push out refs other than the current branch\" is strong\n> enough. Once you are used to \"push = fast-forward = can't loose data\",\n> \"push out a ref\" is not very scary.\n>\n> I'd do s/push out/overwrite/, but I'm fine with your version too.\n\nOK, I agree that it makes sense to do that substitution.\nWill queue.\n"}]}