@matheusbsbs / matheus-bagliano / commits / d45cc6e267
Fork 0

git-applymbox: Remove command

I believe noone uses git-applymbox, and noone definitely should, since it is supposed to be completely superseded and everything by its younger cousin git-am. The only known person in the universe to use it was Linus and he declared some time ago that he will try to use git-am instead in his famous dotest script. The trouble is that git-applymbox existence creates confusing UI. I'm a bit like a recycled newbie to the git porcelain and *I* was confused by git-applymbox primitiveness until I've realized a while later that I'm of course using the wrong command. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>

Petr Baudis committed May 20, 2007 at 02:10 UTC d45cc6e2670bbfecb16c608a2bb0e3f358a9ece7
7 files changed +6 -228
.gitignore
-1
@@ -7,7 +7,6 @@ git-add--interactive
7 git-am
8 git-annotate
9 git-apply
10 -git-applymbox
10 git-applypatch
11 git-archimport
12 git-archive
Documentation/cmd-list.perl
-1
@@ -72,7 +72,6 @@ __DATA__
72 git-add mainporcelain
73 git-am mainporcelain
74 git-annotate ancillaryinterrogators
75 -git-applymbox ancillaryinterrogators
75 git-applypatch purehelpers
76 git-apply plumbingmanipulators
77 git-archimport foreignscminterface
Documentation/git-am.txt
+2 -3
@@ -128,8 +128,7 @@ is terminated before the first occurrence of such a line.
128
129 When initially invoking it, you give it names of the mailboxes
130 to crunch. Upon seeing the first patch that does not apply, it
131 -aborts in the middle, just like 'git-applymbox' does. You can
132 -recover from this in one of two ways:
131 +aborts in the middle,. You can recover from this in one of two ways:
132
133 . skip the current patch by re-running the command with '--skip'
134 option.
@@ -146,7 +145,7 @@ names.
145
146 SEE ALSO
147 --------
149 -gitlink:git-applymbox[1], gitlink:git-applypatch[1], gitlink:git-apply[1].
148 +gitlink:git-applypatch[1], gitlink:git-apply[1].
149
150
151 Author
Documentation/git-applymbox.txt deleted
-98
@@ -1,98 +0,0 @@
1 -git-applymbox(1)
2 -================
3 -
4 -NAME
5 -----
6 -git-applymbox - Apply a series of patches in a mailbox
7 -
8 -
9 -SYNOPSIS
10 ---------
11 -'git-applymbox' [-u] [-k] [-q] [-m] ( -c .dotest/<num> | <mbox> ) [ <signoff> ]
12 -
13 -DESCRIPTION
14 ------------
15 -Splits mail messages in a mailbox into commit log message,
16 -authorship information and patches, and applies them to the
17 -current branch.
18 -
19 -
20 -OPTIONS
21 --------
22 --q::
23 - Apply patches interactively. The user will be given
24 - opportunity to edit the log message and the patch before
25 - attempting to apply it.
26 -
27 --k::
28 - Usually the program 'cleans up' the Subject: header line
29 - to extract the title line for the commit log message,
30 - among which (1) remove 'Re:' or 're:', (2) leading
31 - whitespaces, (3) '[' up to ']', typically '[PATCH]', and
32 - then prepends "[PATCH] ". This flag forbids this
33 - munging, and is most useful when used to read back 'git
34 - format-patch -k' output.
35 -
36 --m::
37 - Patches are applied with `git-apply` command, and unless
38 - it cleanly applies without fuzz, the processing fails.
39 - With this flag, if a tree that the patch applies cleanly
40 - is found in a repository, the patch is applied to the
41 - tree and then a 3-way merge between the resulting tree
42 - and the current tree.
43 -
44 --u::
45 - Pass `-u` flag to `git-mailinfo` (see gitlink:git-mailinfo[1]).
46 - The proposed commit log message taken from the e-mail
47 - are re-coded into UTF-8 encoding (configuration variable
48 - `i18n.commitencoding` can be used to specify project's
49 - preferred encoding if it is not UTF-8). This used to be
50 - optional but now it is the default.
51 -+
52 -Note that the patch is always used as-is without charset
53 -conversion, even with this flag.
54 -
55 --n::
56 - Pass `-n` flag to `git-mailinfo` (see
57 - gitlink:git-mailinfo[1]).
58 -
59 --c .dotest/<num>::
60 - When the patch contained in an e-mail does not cleanly
61 - apply, the command exits with an error message. The
62 - patch and extracted message are found in .dotest/, and
63 - you could re-run 'git applymbox' with '-c .dotest/<num>'
64 - flag to restart the process after inspecting and fixing
65 - them.
66 -
67 -<mbox>::
68 - The name of the file that contains the e-mail messages
69 - with patches. This file should be in the UNIX mailbox
70 - format. See 'SubmittingPatches' document to learn about
71 - the formatting convention for e-mail submission.
72 -
73 -<signoff>::
74 - The name of the file that contains your "Signed-off-by"
75 - line. See 'SubmittingPatches' document to learn what
76 - "Signed-off-by" line means. You can also just say
77 - 'yes', 'true', 'me', or 'please' to use an automatically
78 - generated "Signed-off-by" line based on your committer
79 - identity.
80 -
81 -
82 -SEE ALSO
83 ---------
84 -gitlink:git-am[1], gitlink:git-applypatch[1].
85 -
86 -
87 -Author
88 -------
89 -Written by Linus Torvalds <torvalds@osdl.org>
90 -
91 -Documentation
92 ---------------
93 -Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
94 -
95 -GIT
96 ----
97 -Part of the gitlink:git[7] suite
98 -
Documentation/hooks.txt
+3 -3
@@ -13,7 +13,7 @@ applypatch-msg
13 --------------
14
15 This hook is invoked by `git-applypatch` script, which is
16 -typically invoked by `git-applymbox`. It takes a single
16 +typically invoked by `git-am`. It takes a single
17 parameter, the name of the file that holds the proposed commit
18 log message. Exiting with non-zero status causes
19 `git-applypatch` to abort before applying the patch.
@@ -30,7 +30,7 @@ pre-applypatch
30 --------------
31
32 This hook is invoked by `git-applypatch` script, which is
33 -typically invoked by `git-applymbox`. It takes no parameter,
33 +typically invoked by `git-am`. It takes no parameter,
34 and is invoked after the patch is applied, but before a commit
35 is made. Exiting with non-zero status causes the working tree
36 after application of the patch not committed.
@@ -45,7 +45,7 @@ post-applypatch
45 ---------------
46
47 This hook is invoked by `git-applypatch` script, which is
48 -typically invoked by `git-applymbox`. It takes no parameter,
48 +typically invoked by `git-am`. It takes no parameter,
49 and is invoked after the patch is applied and a commit is made.
50
51 This hook is meant primarily for notification, and cannot affect
Makefile
+1 -1
@@ -206,7 +206,7 @@ SCRIPT_SH = \
206 git-repack.sh git-request-pull.sh git-reset.sh \
207 git-sh-setup.sh \
208 git-tag.sh git-verify-tag.sh \
209 - git-applymbox.sh git-applypatch.sh git-am.sh \
209 + git-applypatch.sh git-am.sh \
210 git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
211 git-merge-resolve.sh git-merge-ours.sh \
212 git-lost-found.sh git-quiltimport.sh
git-applymbox.sh deleted
-121
@@ -1,121 +0,0 @@
1 -#!/bin/sh
2 -##
3 -## "dotest" is my stupid name for my patch-application script, which
4 -## I never got around to renaming after I tested it. We're now on the
5 -## second generation of scripts, still called "dotest".
6 -##
7 -## Update: Ryan Anderson finally shamed me into naming this "applymbox".
8 -##
9 -## You give it a mbox-format collection of emails, and it will try to
10 -## apply them to the kernel using "applypatch"
11 -##
12 -## The patch application may fail in the middle. In which case:
13 -## (1) look at .dotest/patch and fix it up to apply
14 -## (2) re-run applymbox with -c .dotest/msg-number for the current one.
15 -## Pay a special attention to the commit log message if you do this and
16 -## use a Signoff_file, because applypatch wants to append the sign-off
17 -## message to msg-clean every time it is run.
18 -##
19 -## git-am is supposed to be the newer and better tool for this job.
20 -
21 -USAGE='[-u] [-k] [-q] [-m] (-c .dotest/<num> | mbox) [signoff]'
22 -. git-sh-setup
23 -
24 -git var GIT_COMMITTER_IDENT >/dev/null || exit
25 -
26 -keep_subject= query_apply= continue= utf8=-u resume=t
27 -while case "$#" in 0) break ;; esac
28 -do
29 - case "$1" in
30 - -u) utf8=-u ;;
31 - -n) utf8=-n ;;
32 - -k) keep_subject=-k ;;
33 - -q) query_apply=t ;;
34 - -c) continue="$2"; resume=f; shift ;;
35 - -m) fall_back_3way=t ;;
36 - -*) usage ;;
37 - *) break ;;
38 - esac
39 - shift
40 -done
41 -
42 -case "$continue" in
43 -'')
44 - rm -rf .dotest
45 - mkdir .dotest
46 - num_msgs=$(git-mailsplit "$1" .dotest) || exit 1
47 - echo "$num_msgs patch(es) to process."
48 - shift
49 -esac
50 -
51 -files=$(git-diff-index --cached --name-only HEAD) || exit
52 -if [ "$files" ]; then
53 - echo "Dirty index: cannot apply patches (dirty: $files)" >&2
54 - exit 1
55 -fi
56 -
57 -case "$query_apply" in
58 -t) touch .dotest/.query_apply
59 -esac
60 -case "$fall_back_3way" in
61 -t) : >.dotest/.3way
62 -esac
63 -case "$keep_subject" in
64 --k) : >.dotest/.keep_subject
65 -esac
66 -
67 -signoff="$1"
68 -set x .dotest/0*
69 -shift
70 -while case "$#" in 0) break;; esac
71 -do
72 - i="$1"
73 - case "$resume,$continue" in
74 - f,$i) resume=t;;
75 - f,*) shift
76 - continue;;
77 - *)
78 - git-mailinfo $keep_subject $utf8 \
79 - .dotest/msg .dotest/patch <$i >.dotest/info || exit 1
80 - test -s .dotest/patch || {
81 - echo "Patch is empty. Was it split wrong?"
82 - exit 1
83 - }
84 - git-stripspace < .dotest/msg > .dotest/msg-clean
85 - ;;
86 - esac
87 - while :; # for fixing up and retry
88 - do
89 - git-applypatch .dotest/msg-clean .dotest/patch .dotest/info "$signoff"
90 - case "$?" in
91 - 0)
92 - # Remove the cleanly applied one to reduce clutter.
93 - rm -f .dotest/$i
94 - ;;
95 - 2)
96 - # 2 is a special exit code from applypatch to indicate that
97 - # the patch wasn't applied, but continue anyway
98 - ;;
99 - *)
100 - ret=$?
101 - if test -f .dotest/.query_apply
102 - then
103 - echo >&2 "* Patch failed."
104 - echo >&2 "* You could fix it up in your editor and"
105 - echo >&2 " retry. If you want to do so, say yes here"
106 - echo >&2 " AFTER fixing .dotest/patch up."
107 - echo >&2 -n "Retry [y/N]? "
108 - read yesno
109 - case "$yesno" in
110 - [Yy]*)
111 - continue ;;
112 - esac
113 - fi
114 - exit $ret
115 - esac
116 - break
117 - done
118 - shift
119 -done
120 -# return to pristine
121 -rm -fr .dotest