# [PATCH] git-send-email: Accept -n as a synonym for --dry-run

9 messages from 2010-12-09 to 2010-12-13. Participants: Alejandro R. Sedeño, Thomas Rast, Junio C Hamano.
Thread: https://gitlist.dev/t/26003

## Alejandro R. Sedeño, 2010-12-09 04:44

Subject: [PATCH] git-send-email: Accept -n as a synonym for --dry-run
Message-ID: <1291869878-19645-1-git-send-email-asedeno@mit.edu>
URL: https://gitlist.dev/e/1291869878-19645-1-git-send-email-asedeno%40mit.edu

```
git-send-email is not currently using -n for anything else, and it
seems unlikely we will want to use it to mean anything else in the
future, so add it as an alias for convenience.

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
---
 git-send-email.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 76565de..7e3df9a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -85,7 +85,7 @@ git send-email [options] <file | directory | rev-list options >
     --confirm               <str>  * Confirm recipients before sending;
                                      auto, cc, compose, always, or never.
     --quiet                        * Output one line of info per email.
-    --dry-run                      * Don't actually send the emails.
+    -n, --dry-run                  * Don't actually send the emails.
     --[no-]validate                * Perform patch sanity checks. Default on.
     --[no-]format-patch            * understand any non optional arguments as
                                      `git format-patch` ones.
@@ -304,7 +304,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "suppress-cc=s" => \@suppress_cc,
 		    "signed-off-cc|signed-off-by-cc!" => \$signed_off_by_cc,
 		    "confirm=s" => \$confirm,
-		    "dry-run" => \$dry_run,
+		    "dry-run|n" => \$dry_run,
 		    "envelope-sender=s" => \$envelope_sender,
 		    "thread!" => \$thread,
 		    "validate!" => \$validate,
-- 
1.7.3.3

```

## Alejandro R. Sedeño, 2010-12-09 06:39

Subject: Re: [PATCH] git-send-email: Accept -n as a synonym for --dry-run
Message-ID: <4D007986.60809@mit.edu>
URL: https://gitlist.dev/e/4D007986.60809%40mit.edu
In-Reply-To: <1291869878-19645-1-git-send-email-asedeno@mit.edu>

```
I noticed I forgot to make the corresponding documentation change. I'll
include it in the next version of this patch, though I'm waiting to see
if there's any other feedback first.

-Alejandro

```

## Thomas Rast, 2010-12-09 13:35

Subject: Re: [PATCH] git-send-email: Accept -n as a synonym for --dry-run
Message-ID: <201012091435.02669.trast@student.ethz.ch>
URL: https://gitlist.dev/e/201012091435.02669.trast%40student.ethz.ch
In-Reply-To: <1291869878-19645-1-git-send-email-asedeno@mit.edu>

```
Alejandro R. Sedeño wrote:
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 76565de..7e3df9a 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -85,7 +85,7 @@ git send-email [options] <file | directory | rev-list options >
>      --confirm               <str>  * Confirm recipients before sending;
>                                       auto, cc, compose, always, or never.
>      --quiet                        * Output one line of info per email.
> -    --dry-run                      * Don't actually send the emails.
> +    -n, --dry-run                  * Don't actually send the emails.
>      --[no-]validate                * Perform patch sanity checks. Default on.
>      --[no-]format-patch            * understand any non optional arguments as
>                                       `git format-patch` ones.

Good change by itself, but this is the first short option for
git-send-email.  Maybe --force should also get its analogous -f alias?
Any others?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

```

## Alejandro R. Sedeño, 2010-12-09 16:21

Subject: Re: [PATCH] git-send-email: Accept -n as a synonym for --dry-run
Message-ID: <4D0101F6.9060602@mit.edu>
URL: https://gitlist.dev/e/4D0101F6.9060602%40mit.edu
In-Reply-To: <201012091435.02669.trast@student.ethz.ch>

```
On 12/09/2010 08:35 AM, Thomas Rast wrote:
> Alejandro R. Sedeño wrote:
>> diff --git a/git-send-email.perl b/git-send-email.perl
>> index 76565de..7e3df9a 100755
>> --- a/git-send-email.perl
>> +++ b/git-send-email.perl
>> @@ -85,7 +85,7 @@ git send-email [options] <file | directory | rev-list options >
>>      --confirm               <str>  * Confirm recipients before sending;
>>                                       auto, cc, compose, always, or never.
>>      --quiet                        * Output one line of info per email.
>> -    --dry-run                      * Don't actually send the emails.
>> +    -n, --dry-run                  * Don't actually send the emails.
>>      --[no-]validate                * Perform patch sanity checks. Default on.
>>      --[no-]format-patch            * understand any non optional arguments as
>>                                       `git format-patch` ones.
> 
> Good change by itself, but this is the first short option for
> git-send-email.  Maybe --force should also get its analogous -f alias?
> Any others?

Sounds good to me, though I notice that --force isn't in git-send-email's
documentation at all.

If we're expanding this patch[set] to include other short options, -q for
--quiet makes sense to me as well.

Other suggestions?

-Alejandro

```

## Alejandro R. Sedeño, 2010-12-10 18:44

Subject: git-send-email: add some short options and update documentation
Message-ID: <1292006656-1264-1-git-send-email-asedeno@mit.edu>
URL: https://gitlist.dev/e/1292006656-1264-1-git-send-email-asedeno%40mit.edu
In-Reply-To: <1291869878-19645-1-git-send-email-asedeno@mit.edu>

```
Add short options that were mentioned in the thread to git-send-email,
specifically:

-n for --dry-run
-f for --force
-q for --quiet

Since --force didn't have documentation in
Documentation/git-send-email.txt, a separate commit adds some
first.

[PATCH 1/2] Add --force to git-send-email documentation
[PATCH 2/2] git-send-email: Add some short options

Documentation/git-send-email.txt |    6 ++++++
git-send-email.perl              |   12 ++++++------
2 files changed, 12 insertions(+), 6 deletions(-)

```

## Alejandro R. Sedeño, 2010-12-10 18:44

Subject: [PATCH 1/2] Add --force to git-send-email documentation
Message-ID: <1292006656-1264-2-git-send-email-asedeno@mit.edu>
URL: https://gitlist.dev/e/1292006656-1264-2-git-send-email-asedeno%40mit.edu
In-Reply-To: <1291869878-19645-1-git-send-email-asedeno@mit.edu>

```
Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
---
 Documentation/git-send-email.txt |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index ebc024a..7ec9dab 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -322,6 +322,9 @@ have been specified, in which case default to 'compose'.
 Default is the value of 'sendemail.validate'; if this is not set,
 default to '--validate'.
 
+--force::
+	Send emails even if safety checks would prevent it.
+
 
 CONFIGURATION
 -------------
-- 
1.7.3.3

```

## Alejandro R. Sedeño, 2010-12-10 18:44

Subject: [PATCH 2/2] git-send-email: Add some short options
Message-ID: <1292006656-1264-3-git-send-email-asedeno@mit.edu>
URL: https://gitlist.dev/e/1292006656-1264-3-git-send-email-asedeno%40mit.edu
In-Reply-To: <1291869878-19645-1-git-send-email-asedeno@mit.edu>

```
* Accept -n as a synonym for --dry-run
* Accept -f as a synonym for --force
* Accept -q as a synonym for --quiet

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
---
 Documentation/git-send-email.txt |    3 +++
 git-send-email.perl              |   12 ++++++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 7ec9dab..2d0faf2 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -297,6 +297,7 @@ Default is the value of 'sendemail.confirm' configuration value; if that
 is unspecified, default to 'auto' unless any of the suppress options
 have been specified, in which case default to 'compose'.
 
+-n::
 --dry-run::
 	Do everything except actually send the emails.
 
@@ -306,6 +307,7 @@ have been specified, in which case default to 'compose'.
 	or as a file name ('--no-format-patch'). By default, when such a conflict
 	occurs, git send-email will fail.
 
+-q::
 --quiet::
 	Make git-send-email less verbose.  One line per email should be
 	all that is output.
@@ -322,6 +324,7 @@ have been specified, in which case default to 'compose'.
 Default is the value of 'sendemail.validate'; if this is not set,
 default to '--validate'.
 
+-f::
 --force::
 	Send emails even if safety checks would prevent it.
 
diff --git a/git-send-email.perl b/git-send-email.perl
index 76565de..ede7835 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -84,12 +84,12 @@ git send-email [options] <file | directory | rev-list options >
   Administering:
     --confirm               <str>  * Confirm recipients before sending;
                                      auto, cc, compose, always, or never.
-    --quiet                        * Output one line of info per email.
-    --dry-run                      * Don't actually send the emails.
+    -q, --quiet                    * Output one line of info per email.
+    -n, --dry-run                  * Don't actually send the emails.
     --[no-]validate                * Perform patch sanity checks. Default on.
     --[no-]format-patch            * understand any non optional arguments as
                                      `git format-patch` ones.
-    --force                        * Send even if safety checks would prevent it.
+    -f, --force                    * Send even if safety checks would prevent it.
 
 EOT
 	exit(1);
@@ -298,19 +298,19 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "identity=s" => \$identity,
 		    "annotate" => \$annotate,
 		    "compose" => \$compose,
-		    "quiet" => \$quiet,
+		    "quiet|q" => \$quiet,
 		    "cc-cmd=s" => \$cc_cmd,
 		    "suppress-from!" => \$suppress_from,
 		    "suppress-cc=s" => \@suppress_cc,
 		    "signed-off-cc|signed-off-by-cc!" => \$signed_off_by_cc,
 		    "confirm=s" => \$confirm,
-		    "dry-run" => \$dry_run,
+		    "dry-run|n" => \$dry_run,
 		    "envelope-sender=s" => \$envelope_sender,
 		    "thread!" => \$thread,
 		    "validate!" => \$validate,
 		    "format-patch!" => \$format_patch,
 		    "8bit-encoding=s" => \$auto_8bit_encoding,
-		    "force" => \$force,
+		    "force|f" => \$force,
 	 );
 
 unless ($rc) {
-- 
1.7.3.3

```

## Alejandro R. Sedeño, 2010-12-13 20:12

Subject: Re: git-send-email: add some short options and update documentation
Message-ID: <4D067E19.1060904@mit.edu>
URL: https://gitlist.dev/e/4D067E19.1060904%40mit.edu
In-Reply-To: <1292006656-1264-1-git-send-email-asedeno@mit.edu>

```
On 12/10/2010 01:44 PM, Alejandro R. Sedeño wrote:
> Add short options that were mentioned in the thread to git-send-email,
> specifically:
> 
> -n for --dry-run
> -f for --force
> -q for --quiet
> 
> Since --force didn't have documentation in
> Documentation/git-send-email.txt, a separate commit adds some
> first.
> 
> [PATCH 1/2] Add --force to git-send-email documentation

I see this has been pulled into master. Thanks, Junio.

> [PATCH 2/2] git-send-email: Add some short options

Any more comments on this?

-Alejandro

```

## Junio C Hamano, 2010-12-13 21:47

Subject: Re: git-send-email: add some short options and update documentation
Message-ID: <7vtyihxs3f.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vtyihxs3f.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4D067E19.1060904@mit.edu>

```
"Alejandro R. Sedeño" <asedeno@mit.edu> writes:

>> [PATCH 2/2] git-send-email: Add some short options
>
> Any more comments on this?

Not from me, other than that I am not overly interested myself.

```
