From daf9d4148e8a97418a1fc1b9f22d2a500bdf254d Mon Sep 17 00:00:00 2001 From: Hugo Ruiz-Mireles Date: Tue, 21 Oct 2025 20:49:27 -0700 Subject: [PATCH] Made Git Magic use `--force-with-lease` (#1218) This change simply overwrites the usage of `-f` with `--force-with-lease` in git-magic because `--force-with-lease` is a safer alternative. --- bin/git-magic | 2 +- man/git-magic.1 | 173 ++++++++++------------- man/git-magic.html | 334 ++++++++++++++++++++++----------------------- man/git-magic.md | 2 +- 4 files changed, 240 insertions(+), 271 deletions(-) diff --git a/bin/git-magic b/bin/git-magic index 8bc159a..de1dbaf 100755 --- a/bin/git-magic +++ b/bin/git-magic @@ -30,7 +30,7 @@ while getopts "m:eapfh" arg; do PUSH=true ;; f) - FORCE='-f' + FORCE='--force-with-lease' ;; h) echo "$USAGE" diff --git a/man/git-magic.1 b/man/git-magic.1 index f2b1b48..fae6717 100644 --- a/man/git-magic.1 +++ b/man/git-magic.1 @@ -1,102 +1,71 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "GIT\-MAGIC" "1" "May 2023" "" "Git Extras" -. -.SH "NAME" -\fBgit\-magic\fR \- Automate add/commit/push routines -. -.SH "SYNOPSIS" -\fBgit\-magic\fR [\-a] [\-m \fImsg\fR] [\-e] [\-p] [\-f] -. -.SH "DESCRIPTION" -Produces summary of changes for commit message from \fBgit status \-\-porcelain\fR output\. Commits staged changes with the generated commit message and opens editor to modify generated commit message optionally\. Also staging and pushing can be automated optionally\. -. -.SH "OPTIONS" -\-a -. -.P -Adds everything including untracked files\. -. -.P -\-m \fImsg\fR -. -.P -Use the given \fImsg\fR as the commit message\. If multiple \-m options are given, their values are concatenated as separate paragraphs\. Passed to git commit command\. The generated is appended to user\-given messages\. -. -.P -\-e -. -.P -This option lets you further edit the generated message\. Passed to git commit command\. -. -.P -\-p -. -.P -Runs \fBgit push\fR after commit\. -. -.P -\-f -. -.P -Adds \fB\-f\fR option to \fBgit push\fR command\. -. -.P -\-h -. -.P -Prints synopsis\. -. -.SH "EXAMPLES" -This example stages all changes then commits with automatic commit message\. -. -.IP "" 4 -. -.nf - -$ git magic \-a -[feature/magic dc2a11e] A man/git\-magic\.md - 1 file changed, 37 insertions(+) - create mode 100644 man/git\-auto\.md -# git log -Author: overengineer <54alpersaid@gmail\.com> -Date: Thu Sep 30 20:14:22 2021 +0300 - - M man/git\-magic\.md -. -.fi -. -.IP "" 0 -. -.P -\fB\-m\fR option PREPENDS generated message\. -. -.IP "" 4 -. -.nf - -$ git magic \-am "Added documentation for git magic" -[feature/magic dc2a11e] Added documentation for git magic - 1 file changed, 42 insertions(+), 0 deletions(\-) - create mode 100644 A man/git\-auto\.md -$ git log -Author: overengineer <54alpersaid@gmail\.com> -Date: Thu Sep 30 20:14:22 2021 +0300 - - Added documentation for git magic - - M man/git\-magic\.md -. -.fi -. -.IP "" 0 -. -.SH "AUTHOR" -Written by Alper S\. Soylu <54alpersaid@gmail\.com> -. -.SH "REPORTING BUGS" -<\fIhttps://github\.com/tj/git\-extras/issues\fR> -. -.SH "SEE ALSO" -<\fIhttps://github\.com/tj/git\-extras\fR> +.\" generated with Ronn-NG/v0.10.1 +.\" http://github.com/apjanke/ronn-ng/tree/0.10.1 +.TH "GIT\-MAGIC" "1" "September 2025" "" "Git Extras" +.SH "NAME" +\fBgit\-magic\fR \- Automate add/commit/push routines +.SH "SYNOPSIS" +\fBgit\-magic\fR [\-a] [\-m \fImsg\fR] [\-e] [\-p] [\-f] +.SH "DESCRIPTION" +Produces summary of changes for commit message from \fBgit status \-\-porcelain\fR output\. Commits staged changes with the generated commit message and opens editor to modify generated commit message optionally\. Also staging and pushing can be automated optionally\. +.SH "OPTIONS" +\-a +.P +Adds everything including untracked files\. +.P +\-m \fImsg\fR +.P +Use the given \fImsg\fR as the commit message\. If multiple \-m options are given, their values are concatenated as separate paragraphs\. Passed to git commit command\. The generated is appended to user\-given messages\. +.P +\-e +.P +This option lets you further edit the generated message\. Passed to git commit command\. +.P +\-p +.P +Runs \fBgit push\fR after commit\. +.P +\-f +.P +Adds \fB\-\-force\-with\-lease\fR option to \fBgit push\fR command for safer force pushing\. +.P +\-h +.P +Prints synopsis\. +.SH "EXAMPLES" +This example stages all changes then commits with automatic commit message\. +.IP "" 4 +.nf +$ git magic \-a +[feature/magic dc2a11e] A man/git\-magic\.md + 1 file changed, 37 insertions(+) + create mode 100644 man/git\-auto\.md +# git log +Author: overengineer <54alpersaid@gmail\.com> +Date: Thu Sep 30 20:14:22 2021 +0300 + + M man/git\-magic\.md +.fi +.IP "" 0 +.P +\fB\-m\fR option PREPENDS generated message\. +.IP "" 4 +.nf +$ git magic \-am "Added documentation for git magic" +[feature/magic dc2a11e] Added documentation for git magic + 1 file changed, 42 insertions(+), 0 deletions(\-) + create mode 100644 A man/git\-auto\.md +$ git log +Author: overengineer <54alpersaid@gmail\.com> +Date: Thu Sep 30 20:14:22 2021 +0300 + + Added documentation for git magic + + M man/git\-magic\.md +.fi +.IP "" 0 +.SH "AUTHOR" +Written by Alper S\. Soylu \fI54alpersaid@gmail\.com\fR +.SH "REPORTING BUGS" +<\fIhttps://github\.com/tj/git\-extras/issues\fR> +.SH "SEE ALSO" +<\fIhttps://github\.com/tj/git\-extras\fR> diff --git a/man/git-magic.html b/man/git-magic.html index 90d668e..a9506e7 100644 --- a/man/git-magic.html +++ b/man/git-magic.html @@ -1,167 +1,167 @@ - - - - - - git-magic(1) - Automate add/commit/push routines - - - - -
- - - -
    -
  1. git-magic(1)
  2. -
  3. Git Extras
  4. -
  5. git-magic(1)
  6. -
- -

NAME

-

- git-magic - Automate add/commit/push routines -

- -

SYNOPSIS

- -

git-magic [-a] [-m msg] [-e] [-p] [-f]

- -

DESCRIPTION

- -

Produces summary of changes for commit message from git status --porcelain output. -Commits staged changes with the generated commit message and -opens editor to modify generated commit message optionally. -Also staging and pushing can be automated optionally.

- -

OPTIONS

- -

-a

- -

Adds everything including untracked files.

- -

-m msg

- -

Use the given msg as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs. -Passed to git commit command. The generated is appended to user-given messages.

- -

-e

- -

This option lets you further edit the generated message. -Passed to git commit command.

- -

-p

- -

Runs git push after commit.

- -

-f

- -

Adds -f option to git push command.

- -

-h

- -

Prints synopsis.

- -

EXAMPLES

- -

This example stages all changes then commits with automatic commit message.

- -
$ git magic -a
-[feature/magic dc2a11e] A  man/git-magic.md
- 1 file changed, 37 insertions(+)
- create mode 100644 man/git-auto.md
-# git log
-Author: overengineer <54alpersaid@gmail.com>
-Date:   Thu Sep 30 20:14:22 2021 +0300
-
-    M  man/git-magic.md
-
- -

-m option PREPENDS generated message.

- -
$ git magic -am "Added documentation for git magic"
-[feature/magic dc2a11e] Added documentation for git magic
- 1 file changed, 42 insertions(+), 0 deletions(-)
- create mode 100644 A man/git-auto.md
-$ git log
-Author: overengineer <54alpersaid@gmail.com>
-Date:   Thu Sep 30 20:14:22 2021 +0300
-
-    Added documentation for git magic
-
-    M  man/git-magic.md
-
- -

AUTHOR

- -

Written by Alper S. Soylu <54alpersaid@gmail.com>

- -

REPORTING BUGS

- -

<https://github.com/tj/git-extras/issues>

- -

SEE ALSO

- -

<https://github.com/tj/git-extras>

- - -
    -
  1. -
  2. May 2023
  3. -
  4. git-magic(1)
  5. -
- -
- - + + + + + + git-magic(1) - Automate add/commit/push routines + + + + +
+ + + +
    +
  1. git-magic(1)
  2. +
  3. Git Extras
  4. +
  5. git-magic(1)
  6. +
+ + + +

NAME

+

+ git-magic - Automate add/commit/push routines +

+

SYNOPSIS

+ +

git-magic [-a] [-m msg] [-e] [-p] [-f]

+ +

DESCRIPTION

+ +

Produces summary of changes for commit message from git status --porcelain output. +Commits staged changes with the generated commit message and +opens editor to modify generated commit message optionally. +Also staging and pushing can be automated optionally.

+ +

OPTIONS

+ +

-a

+ +

Adds everything including untracked files.

+ +

-m msg

+ +

Use the given msg as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs. +Passed to git commit command. The generated is appended to user-given messages.

+ +

-e

+ +

This option lets you further edit the generated message. +Passed to git commit command.

+ +

-p

+ +

Runs git push after commit.

+ +

-f

+ +

Adds --force-with-lease option to git push command for safer force pushing.

+ +

-h

+ +

Prints synopsis.

+ +

EXAMPLES

+ +

This example stages all changes then commits with automatic commit message.

+ +
$ git magic -a
+[feature/magic dc2a11e] A  man/git-magic.md
+ 1 file changed, 37 insertions(+)
+ create mode 100644 man/git-auto.md
+# git log
+Author: overengineer <54alpersaid@gmail.com>
+Date:   Thu Sep 30 20:14:22 2021 +0300
+
+    M  man/git-magic.md
+
+ +

-m option PREPENDS generated message.

+ +
$ git magic -am "Added documentation for git magic"
+[feature/magic dc2a11e] Added documentation for git magic
+ 1 file changed, 42 insertions(+), 0 deletions(-)
+ create mode 100644 A man/git-auto.md
+$ git log
+Author: overengineer <54alpersaid@gmail.com>
+Date:   Thu Sep 30 20:14:22 2021 +0300
+
+    Added documentation for git magic
+    
+    M  man/git-magic.md
+
+ +

AUTHOR

+ +

Written by Alper S. Soylu 54alpersaid@gmail.com

+ +

REPORTING BUGS

+ +

<https://github.com/tj/git-extras/issues>

+ +

SEE ALSO

+ +

<https://github.com/tj/git-extras>

+ +
    +
  1. +
  2. September 2025
  3. +
  4. git-magic(1)
  5. +
+ +
+ + diff --git a/man/git-magic.md b/man/git-magic.md index 8da5878..d640d66 100644 --- a/man/git-magic.md +++ b/man/git-magic.md @@ -34,7 +34,7 @@ Runs `git push` after commit. -f -Adds `-f` option to `git push` command. +Adds `--force-with-lease` option to `git push` command for safer force pushing. -h