Skip to content

Commit daf9d41

Browse files
authored
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.
1 parent eb34655 commit daf9d41

File tree

4 files changed

+240
-271
lines changed

4 files changed

+240
-271
lines changed

bin/git-magic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ while getopts "m:eapfh" arg; do
3030
PUSH=true
3131
;;
3232
f)
33-
FORCE='-f'
33+
FORCE='--force-with-lease'
3434
;;
3535
h)
3636
echo "$USAGE"

man/git-magic.1

Lines changed: 71 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,71 @@
1-
.\" generated with Ronn/v0.7.3
2-
.\" http://github.com/rtomayko/ronn/tree/0.7.3
3-
.
4-
.TH "GIT\-MAGIC" "1" "May 2023" "" "Git Extras"
5-
.
6-
.SH "NAME"
7-
\fBgit\-magic\fR \- Automate add/commit/push routines
8-
.
9-
.SH "SYNOPSIS"
10-
\fBgit\-magic\fR [\-a] [\-m \fImsg\fR] [\-e] [\-p] [\-f]
11-
.
12-
.SH "DESCRIPTION"
13-
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\.
14-
.
15-
.SH "OPTIONS"
16-
\-a
17-
.
18-
.P
19-
Adds everything including untracked files\.
20-
.
21-
.P
22-
\-m \fImsg\fR
23-
.
24-
.P
25-
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\.
26-
.
27-
.P
28-
\-e
29-
.
30-
.P
31-
This option lets you further edit the generated message\. Passed to git commit command\.
32-
.
33-
.P
34-
\-p
35-
.
36-
.P
37-
Runs \fBgit push\fR after commit\.
38-
.
39-
.P
40-
\-f
41-
.
42-
.P
43-
Adds \fB\-f\fR option to \fBgit push\fR command\.
44-
.
45-
.P
46-
\-h
47-
.
48-
.P
49-
Prints synopsis\.
50-
.
51-
.SH "EXAMPLES"
52-
This example stages all changes then commits with automatic commit message\.
53-
.
54-
.IP "" 4
55-
.
56-
.nf
57-
58-
$ git magic \-a
59-
[feature/magic dc2a11e] A man/git\-magic\.md
60-
1 file changed, 37 insertions(+)
61-
create mode 100644 man/git\-auto\.md
62-
# git log
63-
Author: overengineer <54alpersaid@gmail\.com>
64-
Date: Thu Sep 30 20:14:22 2021 +0300
65-
66-
M man/git\-magic\.md
67-
.
68-
.fi
69-
.
70-
.IP "" 0
71-
.
72-
.P
73-
\fB\-m\fR option PREPENDS generated message\.
74-
.
75-
.IP "" 4
76-
.
77-
.nf
78-
79-
$ git magic \-am "Added documentation for git magic"
80-
[feature/magic dc2a11e] Added documentation for git magic
81-
1 file changed, 42 insertions(+), 0 deletions(\-)
82-
create mode 100644 A man/git\-auto\.md
83-
$ git log
84-
Author: overengineer <54alpersaid@gmail\.com>
85-
Date: Thu Sep 30 20:14:22 2021 +0300
86-
87-
Added documentation for git magic
88-
89-
M man/git\-magic\.md
90-
.
91-
.fi
92-
.
93-
.IP "" 0
94-
.
95-
.SH "AUTHOR"
96-
Written by Alper S\. Soylu <54alpersaid@gmail\.com>
97-
.
98-
.SH "REPORTING BUGS"
99-
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
100-
.
101-
.SH "SEE ALSO"
102-
<\fIhttps://github\.com/tj/git\-extras\fR>
1+
.\" generated with Ronn-NG/v0.10.1
2+
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3+
.TH "GIT\-MAGIC" "1" "September 2025" "" "Git Extras"
4+
.SH "NAME"
5+
\fBgit\-magic\fR \- Automate add/commit/push routines
6+
.SH "SYNOPSIS"
7+
\fBgit\-magic\fR [\-a] [\-m \fImsg\fR] [\-e] [\-p] [\-f]
8+
.SH "DESCRIPTION"
9+
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\.
10+
.SH "OPTIONS"
11+
\-a
12+
.P
13+
Adds everything including untracked files\.
14+
.P
15+
\-m \fImsg\fR
16+
.P
17+
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\.
18+
.P
19+
\-e
20+
.P
21+
This option lets you further edit the generated message\. Passed to git commit command\.
22+
.P
23+
\-p
24+
.P
25+
Runs \fBgit push\fR after commit\.
26+
.P
27+
\-f
28+
.P
29+
Adds \fB\-\-force\-with\-lease\fR option to \fBgit push\fR command for safer force pushing\.
30+
.P
31+
\-h
32+
.P
33+
Prints synopsis\.
34+
.SH "EXAMPLES"
35+
This example stages all changes then commits with automatic commit message\.
36+
.IP "" 4
37+
.nf
38+
$ git magic \-a
39+
[feature/magic dc2a11e] A man/git\-magic\.md
40+
1 file changed, 37 insertions(+)
41+
create mode 100644 man/git\-auto\.md
42+
# git log
43+
Author: overengineer <54alpersaid@gmail\.com>
44+
Date: Thu Sep 30 20:14:22 2021 +0300
45+
46+
M man/git\-magic\.md
47+
.fi
48+
.IP "" 0
49+
.P
50+
\fB\-m\fR option PREPENDS generated message\.
51+
.IP "" 4
52+
.nf
53+
$ git magic \-am "Added documentation for git magic"
54+
[feature/magic dc2a11e] Added documentation for git magic
55+
1 file changed, 42 insertions(+), 0 deletions(\-)
56+
create mode 100644 A man/git\-auto\.md
57+
$ git log
58+
Author: overengineer <54alpersaid@gmail\.com>
59+
Date: Thu Sep 30 20:14:22 2021 +0300
60+
61+
Added documentation for git magic
62+
63+
M man/git\-magic\.md
64+
.fi
65+
.IP "" 0
66+
.SH "AUTHOR"
67+
Written by Alper S\. Soylu \fI54alpersaid@gmail\.com\fR
68+
.SH "REPORTING BUGS"
69+
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
70+
.SH "SEE ALSO"
71+
<\fIhttps://github\.com/tj/git\-extras\fR>

0 commit comments

Comments
 (0)