# [PATCH] completion: add --irreversible-delete for format-patch

3 messages from 2014-12-21 to 2014-12-22. Participants: Eric Wong, Junio C Hamano.
Thread: https://gitlist.dev/t/38216

## Eric Wong, 2014-12-21 11:50

Subject: [PATCH] completion: add --irreversible-delete for format-patch
Message-ID: <20141221115007.GA23500@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20141221115007.GA23500%40dcvr.yhbt.net

```
Normally I would use "-D", but send-email (which normally passes options
to format-patch) interprets the "-D" as a case-insensitive abbreviation
for "--dry-run", preventing format-patch from seeing "-D".

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 Case-insensitivity strikes again! :<
 What a wacky default for Getopt::Long...  And it's probably too late
 for us to disable case-insensitivity in CLI parsing for send-email.

 contrib/completion/git-completion.bash | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 2fece98..41d8ff8 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1257,6 +1257,7 @@ __git_format_patch_options="
 	--not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
 	--inline --suffix= --ignore-if-in-upstream --subject-prefix=
 	--output-directory --reroll-count --to= --quiet --notes
+	--irreversible-delete
 "
 
 _git_format_patch ()
-- 
EW

```

## Junio C Hamano, 2014-12-22 18:39

Subject: Re: [PATCH] completion: add --irreversible-delete for format-patch
Message-ID: <xmqq3887a5qd.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqq3887a5qd.fsf%40gitster.dls.corp.google.com
In-Reply-To: <20141221115007.GA23500@dcvr.yhbt.net>

```
Eric Wong <normalperson@yhbt.net> writes:

> Normally I would use "-D", but send-email (which normally passes options
> to format-patch) interprets the "-D" as a case-insensitive abbreviation
> for "--dry-run", preventing format-patch from seeing "-D".

Is this nonstandard option that is designed to produce an
inapplicable patch so widely used to warrant a completion?

I'd actually understand it if this were to complete "git show" and
friends, but not for format-patch.  I'd actually think we might be
better off forbidding its use for the format-patch command (but not
for other commands in the "git log" family), not just at the
completion level but at the command line argument parser level.

Hmph...

> Signed-off-by: Eric Wong <normalperson@yhbt.net>
> ---
>  Case-insensitivity strikes again! :<
>  What a wacky default for Getopt::Long...  And it's probably too late
>  for us to disable case-insensitivity in CLI parsing for send-email.
>
>  contrib/completion/git-completion.bash | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 2fece98..41d8ff8 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1257,6 +1257,7 @@ __git_format_patch_options="
>  	--not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
>  	--inline --suffix= --ignore-if-in-upstream --subject-prefix=
>  	--output-directory --reroll-count --to= --quiet --notes
> +	--irreversible-delete
>  "
>  
>  _git_format_patch ()

```

## Eric Wong, 2014-12-22 19:00

Subject: Re: [PATCH] completion: add --irreversible-delete for format-patch
Message-ID: <20141222190059.GA19490@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20141222190059.GA19490%40dcvr.yhbt.net
In-Reply-To: <xmqq3887a5qd.fsf@gitster.dls.corp.google.com>

```
Junio C Hamano <gitster@pobox.com> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
> 
> > Normally I would use "-D", but send-email (which normally passes options
> > to format-patch) interprets the "-D" as a case-insensitive abbreviation
> > for "--dry-run", preventing format-patch from seeing "-D".
> 
> Is this nonstandard option that is designed to produce an
> inapplicable patch so widely used to warrant a completion?
> 
> I'd actually understand it if this were to complete "git show" and
> friends, but not for format-patch.  I'd actually think we might be
> better off forbidding its use for the format-patch command (but not
> for other commands in the "git log" family), not just at the
> completion level but at the command line argument parser level.
> 
> Hmph...

I was actually hoping Paul would resurrect his work on getting apply
to understand --irreversible-delete:

http://mid.gmane.org/1343939748-12256-1-git-send-email-paul.gortmaker@windriver.com
($gmane/202789)

I find this option useful to reduce mail traffic for others to review
changes which are already pushed to a public repo.

> > Signed-off-by: Eric Wong <normalperson@yhbt.net>
> > ---
> >  Case-insensitivity strikes again! :<
> >  What a wacky default for Getopt::Long...  And it's probably too late
> >  for us to disable case-insensitivity in CLI parsing for send-email.
> >
> >  contrib/completion/git-completion.bash | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> > index 2fece98..41d8ff8 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -1257,6 +1257,7 @@ __git_format_patch_options="
> >  	--not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
> >  	--inline --suffix= --ignore-if-in-upstream --subject-prefix=
> >  	--output-directory --reroll-count --to= --quiet --notes
> > +	--irreversible-delete
> >  "
> >  
> >  _git_format_patch ()

```
