Skip to content

Commit

Permalink
Rewrite "git-frotz" to "git frotz"
Browse files Browse the repository at this point in the history
This uses the remove-dashes target to replace "git-frotz" to "git frotz".

Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
gitster committed Jul 3, 2007
1 parent 36e5e70 commit 5be6007
Show file tree
Hide file tree
Showing 142 changed files with 2,094 additions and 2,094 deletions.
8 changes: 4 additions & 4 deletions Documentation/install-doc-quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ USAGE='<refname> <target directory>'
export GIT_DIR

test -z "$mandir" && usage
if ! git-rev-parse --verify "$head^0" >/dev/null; then
if ! git rev-parse --verify "$head^0" >/dev/null; then
echo >&2 "head: $head does not exist in the current repository"
usage
fi

GIT_INDEX_FILE=`pwd`/.quick-doc.index
export GIT_INDEX_FILE
rm -f "$GIT_INDEX_FILE"
git-read-tree $head
git-checkout-index -a -f --prefix="$mandir"/
git read-tree $head
git checkout-index -a -f --prefix="$mandir"/

if test -n "$GZ"; then
cd "$mandir"
for i in `git-ls-tree -r --name-only $head`
for i in `git ls-tree -r --name-only $head`
do
gzip < $i > $i.gz && rm $i
done
Expand Down
8 changes: 4 additions & 4 deletions contrib/examples/git-gc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ notbare|"")
esac

test "true" != "$pack_refs" ||
git-pack-refs --prune &&
git-reflog expire --all &&
git pack-refs --prune &&
git reflog expire --all &&
git-repack -a -d -l &&
$no_prune git-prune &&
git-rerere gc || exit
$no_prune git prune &&
git rerere gc || exit
34 changes: 17 additions & 17 deletions contrib/examples/git-resolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ dropheads() {
"$GIT_DIR/LAST_MERGE" || exit 1
}

head=$(git-rev-parse --verify "$1"^0) &&
merge=$(git-rev-parse --verify "$2"^0) &&
head=$(git rev-parse --verify "$1"^0) &&
merge=$(git rev-parse --verify "$2"^0) &&
merge_name="$2" &&
merge_msg="$3" || usage

Expand All @@ -34,7 +34,7 @@ dropheads
echo $head > "$GIT_DIR"/ORIG_HEAD
echo $merge > "$GIT_DIR"/LAST_MERGE

common=$(git-merge-base $head $merge)
common=$(git merge-base $head $merge)
if [ -z "$common" ]; then
die "Unable to find common commit between" $merge $head
fi
Expand All @@ -46,11 +46,11 @@ case "$common" in
exit 0
;;
"$head")
echo "Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $merge)"
git-read-tree -u -m $head $merge || exit 1
git-update-ref -m "resolve $merge_name: Fast forward" \
echo "Updating $(git rev-parse --short $head)..$(git rev-parse --short $merge)"
git read-tree -u -m $head $merge || exit 1
git update-ref -m "resolve $merge_name: Fast forward" \
HEAD "$merge" "$head"
git-diff-tree -p $head $merge | git-apply --stat
git diff-tree -p $head $merge | git apply --stat
dropheads
exit 0
;;
Expand All @@ -62,7 +62,7 @@ git var GIT_COMMITTER_IDENT >/dev/null || exit
# Find an optimum merge base if there are more than one candidates.
LF='
'
common=$(git-merge-base -a $head $merge)
common=$(git merge-base -a $head $merge)
case "$common" in
?*"$LF"?*)
echo "Trying to find the optimum merge base."
Expand All @@ -72,10 +72,10 @@ case "$common" in
for c in $common
do
rm -f $G
GIT_INDEX_FILE=$G git-read-tree -m $c $head $merge \
GIT_INDEX_FILE=$G git read-tree -m $c $head $merge \
2>/dev/null || continue
# Count the paths that are unmerged.
cnt=`GIT_INDEX_FILE=$G git-ls-files --unmerged | wc -l`
cnt=`GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l`
if test $best_cnt -le 0 -o $cnt -le $best_cnt
then
best=$c
Expand All @@ -92,21 +92,21 @@ case "$common" in
esac

echo "Trying to merge $merge into $head using $common."
git-update-index --refresh 2>/dev/null
git-read-tree -u -m $common $head $merge || exit 1
result_tree=$(git-write-tree 2> /dev/null)
git update-index --refresh 2>/dev/null
git read-tree -u -m $common $head $merge || exit 1
result_tree=$(git write-tree 2> /dev/null)
if [ $? -ne 0 ]; then
echo "Simple merge failed, trying Automatic merge"
git-merge-index -o git-merge-one-file -a
if [ $? -ne 0 ]; then
echo $merge > "$GIT_DIR"/MERGE_HEAD
die "Automatic merge failed, fix up by hand"
fi
result_tree=$(git-write-tree) || exit 1
result_tree=$(git write-tree) || exit 1
fi
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree -p $head -p $merge)
result_commit=$(echo "$merge_msg" | git commit-tree $result_tree -p $head -p $merge)
echo "Committed merge $result_commit"
git-update-ref -m "resolve $merge_name: In-index merge" \
git update-ref -m "resolve $merge_name: In-index merge" \
HEAD "$result_commit" "$head"
git-diff-tree -p $head $result_commit | git-apply --stat
git diff-tree -p $head $result_commit | git apply --stat
dropheads
4 changes: 2 additions & 2 deletions contrib/remotes2config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if [ -d "$GIT_DIR"/remotes ]; then
mv "$GIT_DIR"/remotes "$GIT_DIR"/remotes.old
fi ;;
*)
echo "git-config $key "$value" $regex"
git-config $key "$value" $regex || error=1 ;;
echo "git config $key "$value" $regex"
git config $key "$value" $regex || error=1 ;;
esac
done
fi
40 changes: 20 additions & 20 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ fall_back_3way () {
mkdir "$dotest/patch-merge-tmp-dir"

# First see if the patch records the index info that we can use.
git-apply -z --index-info "$dotest/patch" \
git apply -z --index-info "$dotest/patch" \
>"$dotest/patch-merge-index-info" &&
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git-update-index -z --index-info <"$dotest/patch-merge-index-info" &&
git update-index -z --index-info <"$dotest/patch-merge-index-info" &&
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git-write-tree >"$dotest/patch-merge-base+" ||
git write-tree >"$dotest/patch-merge-base+" ||
cannot_fallback "Repository lacks necessary blobs to fall back on 3-way merge."

echo Using index info to reconstruct a base tree...
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git-apply $binary --cached <"$dotest/patch"
git apply $binary --cached <"$dotest/patch"
then
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
Expand All @@ -80,7 +80,7 @@ It does not apply to blobs recorded in its index."
fi

test -f "$dotest/patch-merge-index" &&
his_tree=$(GIT_INDEX_FILE="$dotest/patch-merge-index" git-write-tree) &&
his_tree=$(GIT_INDEX_FILE="$dotest/patch-merge-index" git write-tree) &&
orig_tree=$(cat "$dotest/patch-merge-base") &&
rm -fr "$dotest"/patch-merge-* || exit 1

Expand All @@ -97,7 +97,7 @@ It does not apply to blobs recorded in its index."
git-merge-recursive $orig_tree -- HEAD $his_tree || {
if test -d "$GIT_DIR/rr-cache"
then
git-rerere
git rerere
fi
echo Failed to merge in the changes.
exit 1
Expand Down Expand Up @@ -198,7 +198,7 @@ else
# Start afresh.
mkdir -p "$dotest" || exit

git-mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" || {
git mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" || {
rm -fr "$dotest"
exit 1
}
Expand All @@ -216,7 +216,7 @@ fi

case "$resolved" in
'')
files=$(git-diff-index --cached --name-only HEAD) || exit
files=$(git diff-index --cached --name-only HEAD) || exit
if [ "$files" ]; then
echo "Dirty index: cannot apply patches (dirty: $files)" >&2
exit 1
Expand Down Expand Up @@ -254,7 +254,7 @@ if test "$skip" = t
then
if test -d "$GIT_DIR/rr-cache"
then
git-rerere clear
git rerere clear
fi
this=`expr "$this" + 1`
resume=
Expand Down Expand Up @@ -287,14 +287,14 @@ do
# by the user, or the user can tell us to do so by --resolved flag.
case "$resume" in
'')
git-mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
git mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
<"$dotest/$msgnum" >"$dotest/info" ||
stop_here $this
test -s $dotest/patch || {
echo "Patch is empty. Was it split wrong?"
stop_here $this
}
git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
git stripspace < "$dotest/msg" > "$dotest/msg-clean"
;;
esac

Expand Down Expand Up @@ -347,7 +347,7 @@ do
case "$resolved$interactive" in
tt)
# This is used only for interactive view option.
git-diff-index -p --cached HEAD >"$dotest/patch"
git diff-index -p --cached HEAD >"$dotest/patch"
;;
esac
esac
Expand Down Expand Up @@ -399,7 +399,7 @@ do

case "$resolved" in
'')
git-apply $git_apply_opt $binary --index "$dotest/patch"
git apply $git_apply_opt $binary --index "$dotest/patch"
apply_status=$?
;;
t)
Expand All @@ -408,11 +408,11 @@ do
# trust what the user has in the index file and the
# working tree.
resolved=
git-diff-index --quiet --cached HEAD && {
git diff-index --quiet --cached HEAD && {
echo "No changes - did you forget to use 'git add'?"
stop_here_user_resolve $this
}
unmerged=$(git-ls-files -u)
unmerged=$(git ls-files -u)
if test -n "$unmerged"
then
echo "You still have unmerged paths in your index"
Expand All @@ -433,7 +433,7 @@ do
then
# Applying the patch to an earlier tree and merging the
# result may have produced the same tree as ours.
git-diff-index --quiet --cached HEAD && {
git diff-index --quiet --cached HEAD && {
echo No changes -- Patch already applied.
go_next
continue
Expand All @@ -453,12 +453,12 @@ do
"$GIT_DIR"/hooks/pre-applypatch || stop_here $this
fi

tree=$(git-write-tree) &&
tree=$(git write-tree) &&
echo Wrote tree $tree &&
parent=$(git-rev-parse --verify HEAD) &&
commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") &&
parent=$(git rev-parse --verify HEAD) &&
commit=$(git commit-tree $tree -p $parent <"$dotest/final-commit") &&
echo Committed: $commit &&
git-update-ref -m "$GIT_REFLOG_ACTION: $SUBJECT" HEAD $commit $parent ||
git update-ref -m "$GIT_REFLOG_ACTION: $SUBJECT" HEAD $commit $parent ||
stop_here $this

if test -x "$GIT_DIR"/hooks/post-applypatch
Expand Down
34 changes: 17 additions & 17 deletions git-bisect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bisect_start() {
# Verify HEAD. If we were bisecting before this, reset to the
# top-of-line master first!
#
head=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD) ||
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref HEAD) ||
die "Bad HEAD - I need a symbolic ref"
case "$head" in
refs/heads/bisect)
Expand Down Expand Up @@ -99,7 +99,7 @@ bisect_start() {
break
;;
*)
rev=$(git-rev-parse --verify "$arg^{commit}" 2>/dev/null) || {
rev=$(git rev-parse --verify "$arg^{commit}" 2>/dev/null) || {
test $has_double_dash -eq 1 &&
die "'$arg' does not appear to be a valid revision"
break
Expand All @@ -124,9 +124,9 @@ bisect_bad() {
bisect_autostart
case "$#" in
0)
rev=$(git-rev-parse --verify HEAD) ;;
rev=$(git rev-parse --verify HEAD) ;;
1)
rev=$(git-rev-parse --verify "$1^{commit}") ;;
rev=$(git rev-parse --verify "$1^{commit}") ;;
*)
usage ;;
esac || exit
Expand All @@ -138,19 +138,19 @@ bisect_bad() {
bisect_write_bad() {
rev="$1"
echo "$rev" >"$GIT_DIR/refs/bisect/bad"
echo "# bad: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "# bad: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
}

bisect_good() {
bisect_autostart
case "$#" in
0) revs=$(git-rev-parse --verify HEAD) || exit ;;
*) revs=$(git-rev-parse --revs-only --no-flags "$@") &&
0) revs=$(git rev-parse --verify HEAD) || exit ;;
*) revs=$(git rev-parse --revs-only --no-flags "$@") &&
test '' != "$revs" || die "Bad rev input: $@" ;;
esac
for rev in $revs
do
rev=$(git-rev-parse --verify "$rev^{commit}") || exit
rev=$(git rev-parse --verify "$rev^{commit}") || exit
bisect_write_good "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"

Expand All @@ -161,7 +161,7 @@ bisect_good() {
bisect_write_good() {
rev="$1"
echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
echo "# good: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
}

bisect_next_check() {
Expand Down Expand Up @@ -211,10 +211,10 @@ bisect_next() {
bisect_autostart
bisect_next_check good

bad=$(git-rev-parse --verify refs/bisect/bad) &&
bad=$(git rev-parse --verify refs/bisect/bad) &&
good=$(git for-each-ref --format='^%(objectname)' \
"refs/bisect/good-*" | tr '[\012]' ' ') &&
eval="git-rev-list --bisect-vars $good $bad --" &&
eval="git rev-list --bisect-vars $good $bad --" &&
eval="$eval $(cat "$GIT_DIR/BISECT_NAMES")" &&
eval=$(eval "$eval") &&
eval "$eval" || exit
Expand All @@ -225,16 +225,16 @@ bisect_next() {
fi
if [ "$bisect_rev" = "$bad" ]; then
echo "$bisect_rev is first bad commit"
git-diff-tree --pretty $bisect_rev
git diff-tree --pretty $bisect_rev
exit 0
fi

echo "Bisecting: $bisect_nr revisions left to test after this"
echo "$bisect_rev" >"$GIT_DIR/refs/heads/new-bisect"
git checkout -q new-bisect || exit
mv "$GIT_DIR/refs/heads/new-bisect" "$GIT_DIR/refs/heads/bisect" &&
GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD refs/heads/bisect
git-show-branch "$bisect_rev"
GIT_DIR="$GIT_DIR" git symbolic-ref HEAD refs/heads/bisect
git show-branch "$bisect_rev"
}

bisect_visualize() {
Expand All @@ -250,7 +250,7 @@ bisect_reset() {
else
branch=master
fi ;;
1) git-show-ref --verify --quiet -- "refs/heads/$1" || {
1) git show-ref --verify --quiet -- "refs/heads/$1" || {
echo >&2 "$1 does not seem to be a valid branch"
exit 1
}
Expand Down Expand Up @@ -288,12 +288,12 @@ bisect_replay () {
;;
good)
echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
echo "# good: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
;;
bad)
echo "$rev" >"$GIT_DIR/refs/bisect/bad"
echo "# bad: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "# bad: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
;;
*)
Expand Down
Loading

0 comments on commit 5be6007

Please sign in to comment.