summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 37f638a)
raw | patch | inline | side by side (parent: 37f638a)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Mon, 13 Sep 2010 20:06:09 +0000 (20:06 +0000) | ||
committer | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Sat, 30 Oct 2010 07:58:21 +0000 (07:58 +0000) |
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
git-submodule.sh | patch | blob | history |
diff --git a/git-submodule.sh b/git-submodule.sh
index 086acdd5c00806756a2ea234619b9743519d9002..1b3132f81c449a88ddbb52635542399608593467 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
{
remote=$(get_default_remote)
remoteurl=$(git config "remote.$remote.url") ||
- die "remote ($remote) does not have a url defined in .git/config"
+ die "$(eval_gettext "remote (\$remote) does not have a url defined in .git/config")"
url="$1"
remoteurl=${remoteurl%/}
while test -n "$url"
name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
test -z "$name" &&
- die "No submodule mapping found in .gitmodules for path '$path'"
+ die "$(eval_gettext "No submodule mapping found in .gitmodules for path '\$path'")"
echo "$name"
}
if test -d "$path"
then
rmdir "$path" 2>/dev/null ||
- die "Directory '$path' exists, but is neither empty nor a git repository"
+ die "$(eval_gettext "Directory '\$path' exists, but is neither empty nor a git repository")"
fi
test -e "$path" &&
- die "A file already exist at path '$path'"
+ die "$(eval_gettext "A file already exist at path '\$path'")"
if test -n "$reference"
then
else
git-clone -n "$url" "$path"
fi ||
- die "Clone of '$url' into submodule path '$path' failed"
+ die "$(eval_gettext "Clone of '\$url' into submodule path '\$path' failed")"
}
#
realrepo=$repo
;;
*)
- die "repo URL: '$repo' must be absolute or begin with ./|../"
+ die "$(eval_gettext "repo URL: '\$repo' must be absolute or begin with ./|../")"
;;
esac
s|/*$||
')
git ls-files --error-unmatch "$path" > /dev/null 2>&1 &&
- die "'$path' already exists in the index"
+ die "$(eval_gettext "'\$path' already exists in the index")"
if test -z "$force" && ! git add --dry-run --ignore-missing "$path" > /dev/null 2>&1
then
then
echo "$(eval_gettext "Adding existing repo at '\$path' to the index")"
else
- die "'$path' already exists and is not a valid git repo"
+ die "$(eval_gettext "'\$path' already exists and is not a valid git repo")"
fi
case "$repo" in
'') git checkout -f -q ;;
?*) git checkout -f -q -b "$branch" "origin/$branch" ;;
esac
- ) || die "Unable to checkout submodule '$path'"
+ ) || die "$(eval_gettext "Unable to checkout submodule '\$path'")"
fi
git add $force "$path" ||
- die "Failed to add submodule '$path'"
+ die "$(eval_gettext "Failed to add submodule '\$path'")"
git config -f .gitmodules submodule."$path".path "$path" &&
git config -f .gitmodules submodule."$path".url "$repo" &&
git add --force .gitmodules ||
- die "Failed to register submodule '$path'"
+ die "$(eval_gettext "Failed to register submodule '\$path'")"
}
#
cmd_foreach "--recursive" "$@"
fi
) ||
- die "Stopping at '$path'; script returned non-zero status."
+ die "$(eval_gettext "Stopping at '\$path'; script returned non-zero status.")"
fi
done
}
url=$(git config -f .gitmodules submodule."$name".url)
test -z "$url" &&
- die "No url found for submodule path '$path' in .gitmodules"
+ die "$(eval_gettext "No url found for submodule path '\$path' in .gitmodules")"
# Possibly a url relative to parent
case "$url" in
esac
git config submodule."$name".url "$url" ||
- die "Failed to register url for submodule path '$path'"
+ die "$(eval_gettext "Failed to register url for submodule path '\$path'")"
upd="$(git config -f .gitmodules submodule."$name".update)"
test -z "$upd" ||
git config submodule."$name".update "$upd" ||
- die "Failed to register update mode for submodule path '$path'"
+ die "$(eval_gettext "Failed to register update mode for submodule path '\$path'")"
- say "Submodule '$name' ($url) registered for path '$path'"
+ say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$path'")"
done
}
else
subsha1=$(clear_local_git_env; cd "$path" &&
git rev-parse --verify HEAD) ||
- die "Unable to find current revision in submodule path '$path'"
+ die "$(eval_gettext "Unable to find current revision in submodule path '\$path'")"
fi
if ! test -z "$update"
then
(clear_local_git_env; cd "$path" &&
git-fetch) ||
- die "Unable to fetch in submodule path '$path'"
+ die "$(eval_gettext "Unable to fetch in submodule path '\$path'")"
fi
case "$update_module" in
if test -n "$recursive"
then
(clear_local_git_env; cd "$path" && cmd_update $orig_args) ||
- die "Failed to recurse into submodule path '$path'"
+ die "$(eval_gettext "Failed to recurse into submodule path '\$path'")"
fi
done
}
cd "$path" &&
cmd_status $orig_args
) ||
- die "Failed to recurse into submodule path '$path'"
+ die "$(eval_gettext "Failed to recurse into submodule path '\$path'")"
fi
done
}