@@ -98,7 +98,7 @@ progress () {
98
98
assert () {
99
99
if ! "$@"
100
100
then
101
- die "assertion failed: $*"
101
+ die "fatal: assertion failed: $*"
102
102
fi
103
103
}
104
104
@@ -107,7 +107,7 @@ die_incompatible_opt () {
107
107
assert test "$#" = 2
108
108
opt="$1"
109
109
arg_command="$2"
110
- die "The '$opt' flag does not make sense with 'git subtree $arg_command'."
110
+ die "fatal: the '$opt' flag does not make sense with 'git subtree $arg_command'."
111
111
}
112
112
113
113
main () {
@@ -155,7 +155,7 @@ main () {
155
155
allow_addmerge=$arg_split_rejoin
156
156
;;
157
157
*)
158
- die "Unknown command '$arg_command'"
158
+ die "fatal: unknown command '$arg_command'"
159
159
;;
160
160
esac
161
161
# Reset the arguments array for "real" flag parsing.
@@ -244,25 +244,25 @@ main () {
244
244
break
245
245
;;
246
246
*)
247
- die "Unexpected option: $opt"
247
+ die "fatal: unexpected option: $opt"
248
248
;;
249
249
esac
250
250
done
251
251
shift
252
252
253
253
if test -z "$arg_prefix"
254
254
then
255
- die "You must provide the --prefix option."
255
+ die "fatal: you must provide the --prefix option."
256
256
fi
257
257
258
258
case "$arg_command" in
259
259
add)
260
260
test -e "$arg_prefix" &&
261
- die "prefix '$arg_prefix' already exists."
261
+ die "fatal: prefix '$arg_prefix' already exists."
262
262
;;
263
263
*)
264
264
test -e "$arg_prefix" ||
265
- die "'$arg_prefix' does not exist; use 'git subtree add'"
265
+ die "fatal: '$arg_prefix' does not exist; use 'git subtree add'"
266
266
;;
267
267
esac
268
268
@@ -282,11 +282,11 @@ cache_setup () {
282
282
assert test $# = 0
283
283
cachedir="$GIT_DIR/subtree-cache/$$"
284
284
rm -rf "$cachedir" ||
285
- die "Can 't delete old cachedir: $cachedir"
285
+ die "fatal: can 't delete old cachedir: $cachedir"
286
286
mkdir -p "$cachedir" ||
287
- die "Can 't create new cachedir: $cachedir"
287
+ die "fatal: can 't create new cachedir: $cachedir"
288
288
mkdir -p "$cachedir/notree" ||
289
- die "Can 't create new cachedir: $cachedir/notree"
289
+ die "fatal: can 't create new cachedir: $cachedir/notree"
290
290
debug "Using cachedir: $cachedir" >&2
291
291
}
292
292
@@ -342,7 +342,7 @@ cache_set () {
342
342
test "$oldrev" != "latest_new" &&
343
343
test -e "$cachedir/$oldrev"
344
344
then
345
- die "cache for $oldrev already exists!"
345
+ die "fatal: cache for $oldrev already exists!"
346
346
fi
347
347
echo "$newrev" >"$cachedir/$oldrev"
348
348
}
@@ -396,7 +396,7 @@ find_latest_squash () {
396
396
;;
397
397
git-subtree-split:)
398
398
sub="$(git rev-parse --verify --quiet "$b^{commit}")" ||
399
- die "could not rev-parse split hash $b from commit $sq"
399
+ die "fatal: could not rev-parse split hash $b from commit $sq"
400
400
;;
401
401
END)
402
402
if test -n "$sub"
@@ -448,7 +448,7 @@ find_existing_splits () {
448
448
;;
449
449
git-subtree-split:)
450
450
sub="$(git rev-parse --verify --quiet "$b^{commit}")" ||
451
- die "could not rev-parse split hash $b from commit $sq"
451
+ die "fatal: could not rev-parse split hash $b from commit $sq"
452
452
;;
453
453
END)
454
454
debug "Main is: '$main'"
@@ -498,7 +498,7 @@ copy_commit () {
498
498
cat
499
499
) |
500
500
git commit-tree "$2" $3 # reads the rest of stdin
501
- ) || die "Can 't copy commit $1"
501
+ ) || die "fatal: can 't copy commit $1"
502
502
}
503
503
504
504
# Usage: add_msg DIR LATEST_OLD LATEST_NEW
@@ -726,19 +726,19 @@ ensure_clean () {
726
726
assert test $# = 0
727
727
if ! git diff-index HEAD --exit-code --quiet 2>&1
728
728
then
729
- die "Working tree has modifications. Cannot add."
729
+ die "fatal: working tree has modifications. Cannot add."
730
730
fi
731
731
if ! git diff-index --cached HEAD --exit-code --quiet 2>&1
732
732
then
733
- die "Index has modifications. Cannot add."
733
+ die "fatal: index has modifications. Cannot add."
734
734
fi
735
735
}
736
736
737
737
# Usage: ensure_valid_ref_format REF
738
738
ensure_valid_ref_format () {
739
739
assert test $# = 1
740
740
git check-ref-format "refs/heads/$1" ||
741
- die "'$1' does not look like a ref"
741
+ die "fatal: '$1' does not look like a ref"
742
742
}
743
743
744
744
# Usage: process_split_commit REV PARENTS
@@ -804,7 +804,7 @@ cmd_add () {
804
804
if test $# -eq 1
805
805
then
806
806
git rev-parse -q --verify "$1^{commit}" >/dev/null ||
807
- die "'$1' does not refer to a commit"
807
+ die "fatal: '$1' does not refer to a commit"
808
808
809
809
cmd_add_commit "$@"
810
810
@@ -819,7 +819,7 @@ cmd_add () {
819
819
820
820
cmd_add_repository "$@"
821
821
else
822
- say >&2 "error : parameters were '$*'"
822
+ say >&2 "fatal : parameters were '$*'"
823
823
die "Provide either a commit or a repository and commit."
824
824
fi
825
825
}
@@ -882,9 +882,9 @@ cmd_split () {
882
882
elif test $# -eq 1
883
883
then
884
884
rev=$(git rev-parse -q --verify "$1^{commit}") ||
885
- die "'$1' does not refer to a commit"
885
+ die "fatal: '$1' does not refer to a commit"
886
886
else
887
- die "You must provide exactly one revision. Got: '$*'"
887
+ die "fatal: you must provide exactly one revision. Got: '$*'"
888
888
fi
889
889
890
890
if test -n "$arg_split_rejoin"
@@ -927,7 +927,7 @@ cmd_split () {
927
927
latest_new=$(cache_get latest_new) || exit $?
928
928
if test -z "$latest_new"
929
929
then
930
- die "No new revisions were found"
930
+ die "fatal: no new revisions were found"
931
931
fi
932
932
933
933
if test -n "$arg_split_rejoin"
@@ -948,7 +948,7 @@ cmd_split () {
948
948
then
949
949
if ! git merge-base --is-ancestor "$arg_split_branch" "$latest_new"
950
950
then
951
- die "Branch '$arg_split_branch' is not an ancestor of commit '$latest_new'."
951
+ die "fatal: branch '$arg_split_branch' is not an ancestor of commit '$latest_new'."
952
952
fi
953
953
action='Updated'
954
954
else
@@ -965,17 +965,17 @@ cmd_split () {
965
965
# Usage: cmd_merge REV
966
966
cmd_merge () {
967
967
test $# -eq 1 ||
968
- die "You must provide exactly one revision. Got: '$*'"
968
+ die "fatal: you must provide exactly one revision. Got: '$*'"
969
969
rev=$(git rev-parse -q --verify "$1^{commit}") ||
970
- die "'$1' does not refer to a commit"
970
+ die "fatal: '$1' does not refer to a commit"
971
971
ensure_clean
972
972
973
973
if test -n "$arg_addmerge_squash"
974
974
then
975
975
first_split="$(find_latest_squash "$dir")" || exit $?
976
976
if test -z "$first_split"
977
977
then
978
- die "Can 't squash-merge: '$dir' was never added."
978
+ die "fatal: can 't squash-merge: '$dir' was never added."
979
979
fi
980
980
set $first_split
981
981
old=$1
@@ -1003,7 +1003,7 @@ cmd_merge () {
1003
1003
cmd_pull () {
1004
1004
if test $# -ne 2
1005
1005
then
1006
- die "You must provide <repository> <ref>"
1006
+ die "fatal: you must provide <repository> <ref>"
1007
1007
fi
1008
1008
ensure_clean
1009
1009
ensure_valid_ref_format "$2"
@@ -1015,7 +1015,7 @@ cmd_pull () {
1015
1015
cmd_push () {
1016
1016
if test $# -ne 2
1017
1017
then
1018
- die "You must provide <repository> <refspec>"
1018
+ die "fatal: you must provide <repository> <refspec>"
1019
1019
fi
1020
1020
if test -e "$dir"
1021
1021
then
@@ -1030,13 +1030,13 @@ cmd_push () {
1030
1030
fi
1031
1031
ensure_valid_ref_format "$remoteref"
1032
1032
localrev_presplit=$(git rev-parse -q --verify "$localrevname_presplit^{commit}") ||
1033
- die "'$localrevname_presplit' does not refer to a commit"
1033
+ die "fatal: '$localrevname_presplit' does not refer to a commit"
1034
1034
1035
1035
echo "git push using: " "$repository" "$refspec"
1036
1036
localrev=$(cmd_split "$localrev_presplit") || die
1037
1037
git push "$repository" "$localrev":"refs/heads/$remoteref"
1038
1038
else
1039
- die "'$dir' must already exist. Try 'git subtree add'."
1039
+ die "fatal: '$dir' must already exist. Try 'git subtree add'."
1040
1040
fi
1041
1041
}
1042
1042
0 commit comments