Commit 38a689e2deae4d94c0ad81b3a4f3ebf95929a02c
1 parent
08bfa59a98
Exists in
master
libnetwork.lib.in: git sources: simple support for checking out at a specific co…
…mmit by supporting the syntax: --git-branch branch[@commit_id]
Showing 3 changed files with 18 additions and 4 deletions Side-by-side Diff
lib/libnetwork.lib.in
... | ... | @@ -947,6 +947,7 @@ |
947 | 947 | # see: http://bardofschool.blogspot.fr/2008/11/use-git-behind-proxy.html |
948 | 948 | local proxy proxy_user |
949 | 949 | local git_branch |
950 | + local git_commit | |
950 | 951 | local preserve_dot_git=0 |
951 | 952 | local pck_version |
952 | 953 | |
953 | 954 | |
... | ... | @@ -963,7 +964,14 @@ |
963 | 964 | ;; |
964 | 965 | --git-branch) |
965 | 966 | git_branch="$2"; shift |
967 | + if [ "${git_branch/@*}" != "${git_branch}" ]; then | |
968 | + git_commit="${git_branch/*@}" | |
969 | + git_branch="${git_branch/@*}" | |
970 | + fi | |
966 | 971 | notify.debug "$FUNCNAME: git_branch = \"$git_branch\"" |
972 | + if [ "${git_commit}" ]; then | |
973 | + notify.debug "$FUNCNAME: git_commit = \"$git_commit\"" | |
974 | + fi | |
967 | 975 | ;; |
968 | 976 | --preserve-dot-git) |
969 | 977 | preserve_dot_git="$2"; shift |
... | ... | @@ -1016,7 +1024,7 @@ |
1016 | 1024 | notify.note \ |
1017 | 1025 | "${NOTE}"$"cloning git repository""\ |
1018 | 1026 | <$git_repository> ${git_branch:+($git_branch)}${NORM}""..." |
1019 | - if [ "$preserve_dot_git" = "0" -a "${git_repository:0:4}" != "http" ]; then | |
1027 | + if [ "$preserve_dot_git" = "0" -a "${git_repository:0:4}" != "http" -a ! "${git_commit}" ]; then | |
1020 | 1028 | notify.debug "$FUNCNAME: git clone --recursive --depth=1 ${git_branch:+-b $git_branch} \"$git_repository\"" |
1021 | 1029 | git clone --recursive --depth=1 ${git_branch:+-b $git_branch} "$git_repository" |
1022 | 1030 | else |
... | ... | @@ -1029,6 +1037,12 @@ |
1029 | 1037 | notify.error $"cannot clone git repository"; } |
1030 | 1038 | |
1031 | 1039 | pck_tarball="$(find -mindepth 1 -maxdepth 1 -type d -printf "%f")" |
1040 | + | |
1041 | + if [ "${git_commit}" ]; then | |
1042 | + cd ${pck_tarball} | |
1043 | + git checkout ${git_commit} | |
1044 | + cd .. | |
1045 | + fi | |
1032 | 1046 | |
1033 | 1047 | if [ "$preserve_dot_git" = "0" ]; then |
1034 | 1048 | # remove git files |
plugins/spec-create.in
... | ... | @@ -124,7 +124,7 @@ |
124 | 124 | "$"Override packager full name"" |
125 | 125 | --packager-email |
126 | 126 | "$"Override packager email"" |
127 | - --git-branch "$"Specify a git branch"" | |
127 | + --git-branch "$"Specify a git branch or tag and (optionally) a commit by appending @commit_id"" | |
128 | 128 | --preserve-dot-git "$"Do not remove git files"" |
129 | 129 | --colors "$"Select the theme to be used for the colorized output"" |
130 | 130 | -C, --config "$"Use an alternate user configuration file"" <conf_file>"" |
po/it/autospec.po
... | ... | @@ -862,8 +862,8 @@ |
862 | 862 | msgid "Redirect the output to the file <outfile>" |
863 | 863 | msgstr "Redirige lo standard output sul file <outfile>" |
864 | 864 | |
865 | -msgid "Specify a git branch" | |
866 | -msgstr "Specifica un branch git" | |
865 | +msgid "Specify a git branch or tag and (optionally) a commit by appending @commit_id" | |
866 | +msgstr "Specifica un branch o un tag git e (opzionalmente) un commit aggiungendo @commit_id" | |
867 | 867 | |
868 | 868 | msgid "Do not remove git files" |
869 | 869 | msgstr "Non rimuove i file git" |