diff --git a/dependencies/Readme.md b/dependencies/Readme.md index 4ee8e2c30..47798412c 100644 --- a/dependencies/Readme.md +++ b/dependencies/Readme.md @@ -3,3 +3,7 @@ ## get-platformio.py It is not a direct copy from platformio. Had to add a custom pio installer base TMP directory. + +## git + +https://github.com/desktop/dugite-native/releases diff --git a/dependencies/darwin_amd64/git-2.29.2/bin/git b/dependencies/darwin_amd64/git-2.29.2/bin/git new file mode 100755 index 000000000..756640ae4 Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/bin/git differ diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git new file mode 100755 index 000000000..756640ae4 Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git differ diff --git a/dependencies/darwin_amd64/git/2.30.1/bin/git-receive-pack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-add similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/bin/git-receive-pack rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-add diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-add--interactive b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-add--interactive new file mode 100755 index 000000000..0994c2ced --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-add--interactive @@ -0,0 +1,4 @@ +#!/bin/sh + +echo >&2 "fatal: git was built without support for $(basename $0) (NO_PERL=1)." +exit 128 diff --git a/dependencies/darwin_amd64/git/2.30.1/bin/git-upload-archive b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-am similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/bin/git-upload-archive rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-am diff --git a/dependencies/darwin_amd64/git/2.30.1/bin/git-upload-pack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-annotate similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/bin/git-upload-pack rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-annotate diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-apply b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-apply new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-apply @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-archimport b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-archimport new file mode 100755 index 000000000..0994c2ced --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-archimport @@ -0,0 +1,4 @@ +#!/bin/sh + +echo >&2 "fatal: git was built without support for $(basename $0) (NO_PERL=1)." +exit 128 diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-archive b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-archive new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-archive @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bisect b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bisect new file mode 100755 index 000000000..ea7e684eb --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bisect @@ -0,0 +1,290 @@ +#!/bin/sh + +USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|view|replay|log|run]' +LONG_USAGE='git bisect help + print this long help message. +git bisect start [--term-{new,bad}= --term-{old,good}=] + [--no-checkout] [--first-parent] [ [...]] [--] [...] + reset bisect state and start bisection. +git bisect (bad|new) [] + mark a known-bad revision/ + a revision after change in a given property. +git bisect (good|old) [...] + mark ... known-good revisions/ + revisions before change in a given property. +git bisect terms [--term-good | --term-bad] + show the terms used for old and new commits (default: bad, good) +git bisect skip [(|)...] + mark ... untestable revisions. +git bisect next + find next bisection to test and check it out. +git bisect reset [] + finish bisection search and go back to commit. +git bisect (visualize|view) + show bisect status in gitk. +git bisect replay + replay bisection log. +git bisect log + show bisect log. +git bisect run ... + use ... to automatically bisect. + +Please use "git help bisect" to get the full man page.' + +OPTIONS_SPEC= +. git-sh-setup + +_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' +_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" +TERM_BAD=bad +TERM_GOOD=good + +bisect_head() +{ + if git rev-parse --verify -q BISECT_HEAD > /dev/null + then + echo BISECT_HEAD + else + echo HEAD + fi +} + +bisect_start() { + git bisect--helper --bisect-start $@ || exit + + # + # Change state. + # In case of mistaken revs or checkout error, or signals received, + # "bisect_auto_next" below may exit or misbehave. + # We have to trap this to be able to clean up using + # "bisect_clean_state". + # + trap 'git bisect--helper --bisect-clean-state' 0 + trap 'exit 255' 1 2 3 15 + + # + # Check if we can proceed to the next bisect state. + # + git bisect--helper --bisect-auto-next || exit + + trap '-' 0 +} + +bisect_skip() { + all='' + for arg in "$@" + do + case "$arg" in + *..*) + revs=$(git rev-list "$arg") || die "$(eval_gettext "Bad rev input: \$arg")" ;; + *) + revs=$(git rev-parse --sq-quote "$arg") ;; + esac + all="$all $revs" + done + eval bisect_state 'skip' $all +} + +bisect_state() { + git bisect--helper --bisect-autostart || exit + state=$1 + git bisect--helper --check-and-set-terms $state $TERM_GOOD $TERM_BAD || exit + get_terms + case "$#,$state" in + 0,*) + die "Please call 'bisect_state' with at least one argument." ;; + 1,"$TERM_BAD"|1,"$TERM_GOOD"|1,skip) + bisected_head=$(bisect_head) + rev=$(git rev-parse --verify "$bisected_head") || + die "$(eval_gettext "Bad rev input: \$bisected_head")" + git bisect--helper --bisect-write "$state" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit + git bisect--helper --check-expected-revs "$rev" ;; + 2,"$TERM_BAD"|*,"$TERM_GOOD"|*,skip) + shift + hash_list='' + for rev in "$@" + do + sha=$(git rev-parse --verify "$rev^{commit}") || + die "$(eval_gettext "Bad rev input: \$rev")" + hash_list="$hash_list $sha" + done + for rev in $hash_list + do + git bisect--helper --bisect-write "$state" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit + done + git bisect--helper --check-expected-revs $hash_list ;; + *,"$TERM_BAD") + die "$(eval_gettext "'git bisect \$TERM_BAD' can take only one argument.")" ;; + *) + usage ;; + esac + git bisect--helper --bisect-auto-next +} + +bisect_visualize() { + git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD fail || exit + + if test $# = 0 + then + if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" && + type gitk >/dev/null 2>&1 + then + set gitk + else + set git log + fi + else + case "$1" in + git*|tig) ;; + -*) set git log "$@" ;; + *) set git "$@" ;; + esac + fi + + eval '"$@"' --bisect -- $(cat "$GIT_DIR/BISECT_NAMES") +} + +bisect_replay () { + file="$1" + test "$#" -eq 1 || die "$(gettext "No logfile given")" + test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")" + git bisect--helper --bisect-reset || exit + oIFS="$IFS" IFS="$IFS$(printf '\015')" + while read git bisect command rev tail + do + test "$git $bisect" = "git bisect" || test "$git" = "git-bisect" || continue + if test "$git" = "git-bisect" + then + rev="$command" + command="$bisect" + fi + get_terms + git bisect--helper --check-and-set-terms "$command" "$TERM_GOOD" "$TERM_BAD" || exit + get_terms + case "$command" in + start) + cmd="bisect_start $rev $tail" + eval "$cmd" ;; + "$TERM_GOOD"|"$TERM_BAD"|skip) + git bisect--helper --bisect-write "$command" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit;; + terms) + git bisect--helper --bisect-terms $rev || exit;; + *) + die "$(gettext "?? what are you talking about?")" ;; + esac + done <"$file" + IFS="$oIFS" + git bisect--helper --bisect-auto-next || exit +} + +bisect_run () { + git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD fail || exit + + test -n "$*" || die "$(gettext "bisect run failed: no command provided.")" + + while true + do + command="$@" + eval_gettextln "running \$command" + "$@" + res=$? + + # Check for really bad run error. + if [ $res -lt 0 -o $res -ge 128 ] + then + eval_gettextln "bisect run failed: +exit code \$res from '\$command' is < 0 or >= 128" >&2 + exit $res + fi + + # Find current state depending on run success or failure. + # A special exit code of 125 means cannot test. + if [ $res -eq 125 ] + then + state='skip' + elif [ $res -gt 0 ] + then + state="$TERM_BAD" + else + state="$TERM_GOOD" + fi + + # We have to use a subshell because "bisect_state" can exit. + ( bisect_state $state >"$GIT_DIR/BISECT_RUN" ) + res=$? + + cat "$GIT_DIR/BISECT_RUN" + + if sane_grep "first $TERM_BAD commit could be any of" "$GIT_DIR/BISECT_RUN" \ + >/dev/null + then + gettextln "bisect run cannot continue any more" >&2 + exit $res + fi + + if [ $res -ne 0 ] + then + eval_gettextln "bisect run failed: +'bisect_state \$state' exited with error code \$res" >&2 + exit $res + fi + + if sane_grep "is the first $TERM_BAD commit" "$GIT_DIR/BISECT_RUN" >/dev/null + then + gettextln "bisect run success" + exit 0; + fi + + done +} + +bisect_log () { + test -s "$GIT_DIR/BISECT_LOG" || die "$(gettext "We are not bisecting.")" + cat "$GIT_DIR/BISECT_LOG" +} + +get_terms () { + if test -s "$GIT_DIR/BISECT_TERMS" + then + { + read TERM_BAD + read TERM_GOOD + } <"$GIT_DIR/BISECT_TERMS" + fi +} + +case "$#" in +0) + usage ;; +*) + cmd="$1" + get_terms + shift + case "$cmd" in + help) + git bisect -h ;; + start) + bisect_start "$@" ;; + bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD") + bisect_state "$cmd" "$@" ;; + skip) + bisect_skip "$@" ;; + next) + # Not sure we want "next" at the UI level anymore. + git bisect--helper --bisect-next "$@" || exit ;; + visualize|view) + bisect_visualize "$@" ;; + reset) + git bisect--helper --bisect-reset "$@" ;; + replay) + bisect_replay "$@" ;; + log) + bisect_log ;; + run) + bisect_run "$@" ;; + terms) + git bisect--helper --bisect-terms "$@" || exit;; + *) + usage ;; + esac +esac diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bisect--helper b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bisect--helper new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bisect--helper @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-blame b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-blame new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-blame @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-branch b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-branch new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-branch @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bugreport b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bugreport new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bugreport @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bundle b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bundle new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-bundle @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cat-file b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cat-file new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cat-file @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-attr b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-attr new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-attr @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-ignore b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-ignore new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-ignore @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-mailmap b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-mailmap new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-mailmap @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-ref-format b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-ref-format new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-check-ref-format @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-checkout b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-checkout new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-checkout @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-checkout-index b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-checkout-index new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-checkout-index @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cherry b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cherry new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cherry @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cherry-pick b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cherry-pick new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cherry-pick @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-clean b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-clean new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-clean @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-clone b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-clone new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-clone @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-column b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-column new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-column @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit-graph b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit-graph new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit-graph @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit-tree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit-tree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-commit-tree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-config b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-config new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-config @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-count-objects b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-count-objects new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-count-objects @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-cache b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-cache new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-cache @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-cache--daemon b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-cache--daemon new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-cache--daemon @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-store b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-store new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-credential-store @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsexportcommit b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsexportcommit new file mode 100755 index 000000000..0994c2ced --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsexportcommit @@ -0,0 +1,4 @@ +#!/bin/sh + +echo >&2 "fatal: git was built without support for $(basename $0) (NO_PERL=1)." +exit 128 diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsimport b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsimport new file mode 100755 index 000000000..0994c2ced --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsimport @@ -0,0 +1,4 @@ +#!/bin/sh + +echo >&2 "fatal: git was built without support for $(basename $0) (NO_PERL=1)." +exit 128 diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsserver b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsserver new file mode 100755 index 000000000..0994c2ced --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-cvsserver @@ -0,0 +1,4 @@ +#!/bin/sh + +echo >&2 "fatal: git was built without support for $(basename $0) (NO_PERL=1)." +exit 128 diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-daemon b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-daemon new file mode 100755 index 000000000..20d7ec81e Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-daemon differ diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-describe b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-describe new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-describe @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-files b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-files new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-files @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-index b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-index new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-index @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-tree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-tree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-diff-tree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-difftool b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-difftool new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-difftool @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-difftool--helper b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-difftool--helper similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-difftool--helper rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-difftool--helper diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-env--helper b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-env--helper new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-env--helper @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fast-export b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fast-export new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fast-export @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fast-import b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fast-import new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fast-import @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fetch b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fetch new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fetch @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fetch-pack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fetch-pack new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fetch-pack @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-filter-branch b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-filter-branch similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-filter-branch rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-filter-branch diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fmt-merge-msg b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fmt-merge-msg new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fmt-merge-msg @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-for-each-ref b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-for-each-ref new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-for-each-ref @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-format-patch b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-format-patch new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-format-patch @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fsck b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fsck new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fsck @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fsck-objects b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fsck-objects new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-fsck-objects @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-gc b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-gc new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-gc @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-get-tar-commit-id b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-get-tar-commit-id new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-get-tar-commit-id @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-grep b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-grep new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-grep @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-hash-object b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-hash-object new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-hash-object @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-help b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-help new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-help @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-backend b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-backend new file mode 100755 index 000000000..9fc2587f7 Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-backend differ diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-fetch b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-fetch new file mode 100755 index 000000000..c60f6cd65 Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-fetch differ diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-push b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-push new file mode 100755 index 000000000..b6a9ba4aa Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-http-push differ diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-imap-send b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-imap-send new file mode 100755 index 000000000..be1a9cfab Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-imap-send differ diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-index-pack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-index-pack new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-index-pack @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-init b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-init new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-init @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-init-db b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-init-db new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-init-db @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-instaweb b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-instaweb new file mode 100755 index 000000000..0994c2ced --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-instaweb @@ -0,0 +1,4 @@ +#!/bin/sh + +echo >&2 "fatal: git was built without support for $(basename $0) (NO_PERL=1)." +exit 128 diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-interpret-trailers b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-interpret-trailers new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-interpret-trailers @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-lfs b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-lfs new file mode 100755 index 000000000..ce4ba13d5 Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-lfs differ diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-log b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-log new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-log @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-files b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-files new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-files @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-remote b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-remote new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-remote @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-tree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-tree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-ls-tree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mailinfo b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mailinfo new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mailinfo @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mailsplit b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mailsplit new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mailsplit @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-base b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-base new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-base @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-file b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-file new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-file @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-index b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-index new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-index @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-merge-octopus b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-octopus similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-merge-octopus rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-octopus diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-merge-one-file b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-one-file similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-merge-one-file rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-one-file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-ours b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-ours new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-ours @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-recursive b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-recursive new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-recursive @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-merge-resolve b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-resolve similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-merge-resolve rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-resolve diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-subtree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-subtree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-subtree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-tree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-tree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-merge-tree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-mergetool b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mergetool similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-mergetool rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mergetool diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-mergetool--lib b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mergetool--lib similarity index 98% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-mergetool--lib rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mergetool--lib index 78f3647ed..2defef28c 100644 --- a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-mergetool--lib +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mergetool--lib @@ -46,11 +46,9 @@ show_tool_names () { while read scriptname do setup_tool "$scriptname" 2>/dev/null - # We need an actual line feed here - variants="$variants -$(list_tool_variants)" + variants="$variants$(list_tool_variants)\n" done - variants="$(echo "$variants" | sort -u)" + variants="$(echo "$variants" | sort | uniq)" for toolname in $variants do @@ -140,10 +138,6 @@ setup_user_tool () { merge_cmd () { ( eval $merge_tool_cmd ) } - - list_tool_variants () { - echo "$tool" - } } setup_tool () { diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mktag b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mktag new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mktag @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mktree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mktree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mktree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-multi-pack-index b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-multi-pack-index new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-multi-pack-index @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mv b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mv new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-mv @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-name-rev b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-name-rev new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-name-rev @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-notes b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-notes new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-notes @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-objects b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-objects new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-objects @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-redundant b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-redundant new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-redundant @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-refs b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-refs new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pack-refs @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-parse-remote b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-parse-remote new file mode 100644 index 000000000..d3c39980f --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-parse-remote @@ -0,0 +1,101 @@ +# This is a shell library to calculate the remote repository and +# upstream branch that should be pulled by "git pull" from the current +# branch. + +# git-ls-remote could be called from outside a git managed repository; +# this would fail in that case and would issue an error message. +GIT_DIR=$(git rev-parse -q --git-dir) || :; + +get_default_remote () { + curr_branch=$(git symbolic-ref -q HEAD) + curr_branch="${curr_branch#refs/heads/}" + origin=$(git config --get "branch.$curr_branch.remote") + echo ${origin:-origin} +} + +get_remote_merge_branch () { + case "$#" in + 0|1) + origin="$1" + default=$(get_default_remote) + test -z "$origin" && origin=$default + curr_branch=$(git symbolic-ref -q HEAD) && + [ "$origin" = "$default" ] && + echo $(git for-each-ref --format='%(upstream)' $curr_branch) + ;; + *) + repo=$1 + shift + ref=$1 + # FIXME: It should return the tracking branch + # Currently only works with the default mapping + case "$ref" in + +*) + ref=$(expr "z$ref" : 'z+\(.*\)') + ;; + esac + expr "z$ref" : 'z.*:' >/dev/null || ref="${ref}:" + remote=$(expr "z$ref" : 'z\([^:]*\):') + case "$remote" in + '' | HEAD ) remote=HEAD ;; + heads/*) remote=${remote#heads/} ;; + refs/heads/*) remote=${remote#refs/heads/} ;; + refs/* | tags/* | remotes/* ) remote= + esac + [ -n "$remote" ] && case "$repo" in + .) + echo "refs/heads/$remote" + ;; + *) + echo "refs/remotes/$repo/$remote" + ;; + esac + esac +} + +error_on_missing_default_upstream () { + cmd="$1" + op_type="$2" + op_prep="$3" # FIXME: op_prep is no longer used + example="$4" + branch_name=$(git symbolic-ref -q HEAD) + display_branch_name="${branch_name#refs/heads/}" + # If there's only one remote, use that in the suggestion + remote="$(gettext "")" + branch="$(gettext "")" + if test $(git remote | wc -l) = 1 + then + remote=$(git remote) + fi + + if test -z "$branch_name" + then + gettextln "You are not currently on a branch." + else + gettextln "There is no tracking information for the current branch." + fi + case "$op_type" in + rebase) + gettextln "Please specify which branch you want to rebase against." + ;; + merge) + gettextln "Please specify which branch you want to merge with." + ;; + *) + echo >&2 "BUG: unknown operation type: $op_type" + exit 1 + ;; + esac + eval_gettextln "See git-\${cmd}(1) for details." + echo + echo " $example" + echo + if test -n "$branch_name" + then + gettextln "If you wish to set tracking information for this branch you can do so with:" + echo + echo " git branch --set-upstream-to=$remote/$branch $display_branch_name" + echo + fi + exit 1 +} diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-patch-id b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-patch-id new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-patch-id @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-prune b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-prune new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-prune @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-prune-packed b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-prune-packed new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-prune-packed @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pull b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pull new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-pull @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-push b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-push new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-push @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-quiltimport b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-quiltimport similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-quiltimport rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-quiltimport diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-range-diff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-range-diff new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-range-diff @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-read-tree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-read-tree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-read-tree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rebase b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rebase new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rebase @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-rebase--preserve-merges b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rebase--preserve-merges similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-rebase--preserve-merges rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rebase--preserve-merges diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-receive-pack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-receive-pack new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-receive-pack @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-reflog b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-reflog new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-reflog @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-ext b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-ext new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-ext @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-fd b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-fd new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-fd @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-remote-ftp b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-ftp similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-remote-ftp rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-ftp diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-remote-ftps b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-ftps similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-remote-ftps rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-ftps diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-http b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-http new file mode 100755 index 000000000..028bebd1d Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-http differ diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-remote-https b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-https similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-remote-https rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-remote-https diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-repack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-repack new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-repack @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-replace b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-replace new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-replace @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-request-pull b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-request-pull similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-request-pull rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-request-pull diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rerere b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rerere new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rerere @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-reset b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-reset new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-reset @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-restore b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-restore new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-restore @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rev-list b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rev-list new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rev-list @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rev-parse b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rev-parse new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rev-parse @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-revert b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-revert new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-revert @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rm b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rm new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-rm @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-send-email b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-send-email new file mode 100755 index 000000000..0994c2ced --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-send-email @@ -0,0 +1,4 @@ +#!/bin/sh + +echo >&2 "fatal: git was built without support for $(basename $0) (NO_PERL=1)." +exit 128 diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-send-pack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-send-pack new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-send-pack @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-sh-i18n b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sh-i18n similarity index 95% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-sh-i18n rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sh-i18n index df5269635..d6f1ed600 100644 --- a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-sh-i18n +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sh-i18n @@ -9,7 +9,7 @@ TEXTDOMAIN=git export TEXTDOMAIN if test -z "$GIT_TEXTDOMAINDIR" then - TEXTDOMAINDIR="@@HOMEBREW_CELLAR@@/git/2.30.1/share/locale" + TEXTDOMAINDIR="//share/locale" else TEXTDOMAINDIR="$GIT_TEXTDOMAINDIR" fi @@ -22,9 +22,9 @@ if test -n "$GIT_TEST_GETTEXT_POISON" && GIT_TEST_GETTEXT_POISON then GIT_INTERNAL_GETTEXT_SH_SCHEME=poison -elif test -n "" +elif test -n "fallthrough" then - GIT_INTERNAL_GETTEXT_SH_SCHEME="" + GIT_INTERNAL_GETTEXT_SH_SCHEME="fallthrough" elif test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" then : no probing necessary diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sh-i18n--envsubst b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sh-i18n--envsubst new file mode 100755 index 000000000..ab6d0663d Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sh-i18n--envsubst differ diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-sh-setup b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sh-setup similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-sh-setup rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sh-setup diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-shell b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-shell new file mode 100755 index 000000000..444665745 Binary files /dev/null and b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-shell differ diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-shortlog b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-shortlog new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-shortlog @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-branch b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-branch new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-branch @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-index b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-index new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-index @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-ref b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-ref new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-show-ref @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sparse-checkout b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sparse-checkout new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-sparse-checkout @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stage b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stage new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stage @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stash b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stash new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stash @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-status b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-status new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-status @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stripspace b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stripspace new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-stripspace @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-submodule b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-submodule similarity index 98% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-submodule rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-submodule index eb90f1822..7ce52872b 100755 --- a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-submodule +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-submodule @@ -20,6 +20,7 @@ USAGE="[--quiet] [--cached] OPTIONS_SPEC= SUBDIRECTORY_OK=Yes . git-sh-setup +. git-parse-remote require_work_tree wt_prefix=$(git rev-parse --show-prefix) cd_to_toplevel @@ -412,18 +413,16 @@ is_tip_reachable () ( test -z "$rev" ) -# usage: fetch_in_submodule [] [] -# Because arguments are positional, use an empty string to omit -# but include . fetch_in_submodule () ( sanitize_submodule_env && cd "$1" && - if test $# -eq 3 - then - echo "$3" | git fetch --stdin ${2:+"$2"} - else - git fetch ${2:+"$2"} - fi + case "$2" in + '') + git fetch ;; + *) + shift + git fetch $(get_default_remote) "$@" ;; + esac ) # @@ -577,7 +576,7 @@ cmd_update() fetch_in_submodule "$sm_path" $depth || die "$(eval_gettext "Unable to fetch in submodule path '\$sm_path'")" fi - remote_name=$(sanitize_submodule_env; cd "$sm_path" && git submodule--helper print-default-remote) + remote_name=$(sanitize_submodule_env; cd "$sm_path" && get_default_remote) sha1=$(sanitize_submodule_env; cd "$sm_path" && git rev-parse --verify "${remote_name}/${branch}") || die "$(eval_gettext "Unable to find current \${remote_name}/\${branch} revision in submodule path '\$sm_path'")" @@ -603,7 +602,7 @@ cmd_update() # Now we tried the usual fetch, but $sha1 may # not be reachable from any of the refs is_tip_reachable "$sm_path" "$sha1" || - fetch_in_submodule "$sm_path" "$depth" "$sha1" || + fetch_in_submodule "$sm_path" $depth "$sha1" || die "$(eval_gettext "Fetched in submodule path '\$displaypath', but it did not contain \$sha1. Direct fetching of that commit failed.")" fi diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-submodule--helper b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-submodule--helper new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-submodule--helper @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-switch b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-switch new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-switch @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-symbolic-ref b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-symbolic-ref new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-symbolic-ref @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-tag b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-tag new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-tag @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-unpack-file b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-unpack-file new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-unpack-file @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-unpack-objects b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-unpack-objects new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-unpack-objects @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-index b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-index new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-index @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-ref b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-ref new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-ref @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-server-info b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-server-info new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-update-server-info @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-upload-archive b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-upload-archive new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-upload-archive @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-upload-pack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-upload-pack new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-upload-pack @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-var b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-var new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-var @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-commit b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-commit new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-commit @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-pack b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-pack new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-pack @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-tag b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-tag new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-verify-tag @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-web--browse b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-web--browse similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/git-web--browse rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-web--browse diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-whatchanged b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-whatchanged new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-whatchanged @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-worktree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-worktree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-worktree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-write-tree b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-write-tree new file mode 120000 index 000000000..0899c2993 --- /dev/null +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/git-write-tree @@ -0,0 +1 @@ +git \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/araxis b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/araxis similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/araxis rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/araxis diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/bc b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/bc similarity index 97% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/bc rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/bc index 26c19d46a..a89086ee7 100644 --- a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/bc +++ b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/bc @@ -25,5 +25,4 @@ translate_merge_tool_path() { list_tool_variants () { echo bc echo bc3 - echo bc4 } diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/codecompare b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/codecompare similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/codecompare rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/codecompare diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/deltawalker b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/deltawalker similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/deltawalker rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/deltawalker diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/diffmerge b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/diffmerge similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/diffmerge rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/diffmerge diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/diffuse b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/diffuse similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/diffuse rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/diffuse diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/ecmerge b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/ecmerge similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/ecmerge rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/ecmerge diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/emerge b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/emerge similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/emerge rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/emerge diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/examdiff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/examdiff similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/examdiff rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/examdiff diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/guiffy b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/guiffy similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/guiffy rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/guiffy diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/gvimdiff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/gvimdiff similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/gvimdiff rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/gvimdiff diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/kdiff3 b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/kdiff3 similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/kdiff3 rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/kdiff3 diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/kompare b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/kompare similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/kompare rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/kompare diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/meld b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/meld similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/meld rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/meld diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/nvimdiff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/nvimdiff similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/nvimdiff rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/nvimdiff diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/opendiff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/opendiff similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/opendiff rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/opendiff diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/p4merge b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/p4merge similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/p4merge rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/p4merge diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/smerge b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/smerge similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/smerge rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/smerge diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/tkdiff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/tkdiff similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/tkdiff rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/tkdiff diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/tortoisemerge b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/tortoisemerge similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/tortoisemerge rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/tortoisemerge diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/vimdiff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/vimdiff similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/vimdiff rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/vimdiff diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/winmerge b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/winmerge similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/winmerge rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/winmerge diff --git a/dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/xxdiff b/dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/xxdiff similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/libexec/git-core/mergetools/xxdiff rename to dependencies/darwin_amd64/git-2.29.2/libexec/git-core/mergetools/xxdiff diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/description b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/description similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/description rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/description diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/applypatch-msg.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/applypatch-msg.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/applypatch-msg.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/applypatch-msg.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/commit-msg.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/commit-msg.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/commit-msg.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/commit-msg.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/fsmonitor-watchman.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/fsmonitor-watchman.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/fsmonitor-watchman.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/fsmonitor-watchman.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/post-update.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/post-update.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/post-update.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/post-update.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-applypatch.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-applypatch.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-applypatch.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-applypatch.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-commit.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-commit.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-commit.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-commit.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-merge-commit.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-merge-commit.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-merge-commit.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-merge-commit.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-push.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-push.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-push.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-push.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-rebase.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-rebase.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-rebase.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-rebase.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-receive.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-receive.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/pre-receive.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/pre-receive.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/prepare-commit-msg.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/prepare-commit-msg.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/prepare-commit-msg.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/prepare-commit-msg.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/update.sample b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/update.sample similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/hooks/update.sample rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/hooks/update.sample diff --git a/dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/info/exclude b/dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/info/exclude similarity index 100% rename from dependencies/darwin_amd64/git/2.30.1/share/git-core/templates/info/exclude rename to dependencies/darwin_amd64/git-2.29.2/share/git-core/templates/info/exclude diff --git a/dependencies/darwin_amd64/git/2.30.1/.bottle/etc/gitconfig b/dependencies/darwin_amd64/git/2.30.1/.bottle/etc/gitconfig deleted file mode 100644 index 788266b3a..000000000 --- a/dependencies/darwin_amd64/git/2.30.1/.bottle/etc/gitconfig +++ /dev/null @@ -1,2 +0,0 @@ -[credential] - helper = osxkeychain diff --git a/dependencies/darwin_amd64/git/2.30.1/.brew/git.rb b/dependencies/darwin_amd64/git/2.30.1/.brew/git.rb deleted file mode 100644 index 26b7a8444..000000000 --- a/dependencies/darwin_amd64/git/2.30.1/.brew/git.rb +++ /dev/null @@ -1,171 +0,0 @@ -class Git < Formula - desc "Distributed revision control system" - homepage "https://git-scm.com" - # NOTE: Please keep these values in sync with git-gui.rb when updating. - url "https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.1.tar.xz" - sha256 "f988a8a095089978dab2932af4edb22b4d7d67d67b81aaa1986fa29ef45d9467" - license "GPL-2.0-only" - head "https://github.com/git/git.git", shallow: false - - livecheck do - url "https://www.kernel.org/pub/software/scm/git/" - regex(/href=.*?git[._-]v?(\d+(?:\.\d+)+)\.t/i) - end - - depends_on "gettext" - depends_on "pcre2" - - resource "html" do - url "https://mirrors.edge.kernel.org/pub/software/scm/git/git-htmldocs-2.30.1.tar.xz" - sha256 "e826d9dd63bef455f80cd785c69c9ee74ab4f8793e25477470474ef96db66315" - end - - resource "man" do - url "https://mirrors.edge.kernel.org/pub/software/scm/git/git-manpages-2.30.1.tar.xz" - sha256 "30fc7ecbd964bb19a2ca1a695fe7af430740e09bd1c134cd3730783abec5b904" - end - - resource "Net::SMTP::SSL" do - url "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Net-SMTP-SSL-1.04.tar.gz" - sha256 "7b29c45add19d3d5084b751f7ba89a8e40479a446ce21cfd9cc741e558332a00" - end - - def install - # If these things are installed, tell Git build system not to use them - ENV["NO_FINK"] = "1" - ENV["NO_DARWIN_PORTS"] = "1" - ENV["PYTHON_PATH"] = which("python") - ENV["PERL_PATH"] = which("perl") - ENV["USE_LIBPCRE2"] = "1" - ENV["INSTALL_SYMLINKS"] = "1" - ENV["LIBPCREDIR"] = Formula["pcre2"].opt_prefix - ENV["V"] = "1" # build verbosely - - perl_version = Utils.safe_popen_read("perl", "--version")[/v(\d+\.\d+)(?:\.\d+)?/, 1] - - ENV["PERLLIB_EXTRA"] = %W[ - #{MacOS.active_developer_dir} - /Library/Developer/CommandLineTools - /Applications/Xcode.app/Contents/Developer - ].uniq.map do |p| - "#{p}/Library/Perl/#{perl_version}/darwin-thread-multi-2level" - end.join(":") - - # Ensure we are using the correct system headers (for curl) to workaround - # mismatched Xcode/CLT versions: - # https://github.com/Homebrew/homebrew-core/issues/46466 - if MacOS.version == :mojave && MacOS::CLT.installed? && MacOS::CLT.provides_sdk? - ENV["HOMEBREW_SDKROOT"] = MacOS::CLT.sdk_path(MacOS.version) - end - - # The git-gui and gitk tools are installed by a separate formula (git-gui) - # to avoid a dependency on tcl-tk and to avoid using the broken system - # tcl-tk (see https://github.com/Homebrew/homebrew-core/issues/36390) - # This is done by setting the NO_TCLTK make variable. - args = %W[ - prefix=#{prefix} - sysconfdir=#{etc} - CC=#{ENV.cc} - CFLAGS=#{ENV.cflags} - LDFLAGS=#{ENV.ldflags} - NO_TCLTK=1 - NO_OPENSSL=1 - APPLE_COMMON_CRYPTO=1 - ] - - system "make", "install", *args - - git_core = libexec/"git-core" - - # Install the macOS keychain credential helper - cd "contrib/credential/osxkeychain" do - system "make", "CC=#{ENV.cc}", - "CFLAGS=#{ENV.cflags}", - "LDFLAGS=#{ENV.ldflags}" - git_core.install "git-credential-osxkeychain" - system "make", "clean" - end - - # Generate diff-highlight perl script executable - cd "contrib/diff-highlight" do - system "make" - end - - # Install the netrc credential helper - cd "contrib/credential/netrc" do - system "make", "test" - git_core.install "git-credential-netrc" - end - - # Install git-subtree - cd "contrib/subtree" do - system "make", "CC=#{ENV.cc}", - "CFLAGS=#{ENV.cflags}", - "LDFLAGS=#{ENV.ldflags}" - git_core.install "git-subtree" - end - - # install the completion script first because it is inside "contrib" - bash_completion.install "contrib/completion/git-completion.bash" - bash_completion.install "contrib/completion/git-prompt.sh" - zsh_completion.install "contrib/completion/git-completion.zsh" => "_git" - cp "#{bash_completion}/git-completion.bash", zsh_completion - - elisp.install Dir["contrib/emacs/*.el"] - (share/"git-core").install "contrib" - - # We could build the manpages ourselves, but the build process depends - # on many other packages, and is somewhat crazy, this way is easier. - man.install resource("man") - (share/"doc/git-doc").install resource("html") - - # Make html docs world-readable - chmod 0644, Dir["#{share}/doc/git-doc/**/*.{html,txt}"] - chmod 0755, Dir["#{share}/doc/git-doc/{RelNotes,howto,technical}"] - - # git-send-email needs Net::SMTP::SSL - resource("Net::SMTP::SSL").stage do - (share/"perl5").install "lib/Net" - end - - # This is only created when building against system Perl, but it isn't - # purged by Homebrew's post-install cleaner because that doesn't check - # "Library" directories. It is however pointless to keep around as it - # only contains the perllocal.pod installation file. - rm_rf prefix/"Library/Perl" - - # Set the macOS keychain credential helper by default - # (as Apple's CLT's git also does this). - (buildpath/"gitconfig").write <<~EOS - [credential] - \thelper = osxkeychain - EOS - etc.install "gitconfig" - end - - def caveats - <<~EOS - The Tcl/Tk GUIs (e.g. gitk, git-gui) are now in the `git-gui` formula. - EOS - end - - test do - system bin/"git", "init" - %w[haunted house].each { |f| touch testpath/f } - system bin/"git", "add", "haunted", "house" - system bin/"git", "config", "user.name", "'A U Thor'" - system bin/"git", "config", "user.email", "author@example.com" - system bin/"git", "commit", "-a", "-m", "Initial Commit" - assert_equal "haunted\nhouse", shell_output("#{bin}/git ls-files").strip - - # Check Net::SMTP::SSL was installed correctly. - %w[foo bar].each { |f| touch testpath/f } - system bin/"git", "add", "foo", "bar" - system bin/"git", "commit", "-a", "-m", "Second Commit" - assert_match "Authentication Required", pipe_output( - "#{bin}/git send-email --from=test@example.com --to=dev@null.com " \ - "--smtp-server=smtp.gmail.com --smtp-server-port=587 " \ - "--smtp-encryption=tls --confirm=never HEAD^ 2>&1", - ) - end -end diff --git a/dependencies/darwin_amd64/git/2.30.1/COPYING b/dependencies/darwin_amd64/git/2.30.1/COPYING deleted file mode 100644 index 536e55524..000000000 --- a/dependencies/darwin_amd64/git/2.30.1/COPYING +++ /dev/null @@ -1,360 +0,0 @@ - - Note that the only valid version of the GPL as far as this project - is concerned is _this_ particular version of the license (ie v2, not - v2.2 or v3.x or whatever), unless explicitly otherwise stated. - - HOWEVER, in order to allow a migration to GPLv3 if that seems like - a good idea, I also ask that people involved with the project make - their preferences known. In particular, if you trust me to make that - decision, you might note so in your copyright message, ie something - like - - This file is licensed under the GPL v2, or a later version - at the discretion of Linus. - - might avoid issues. But we can also just decide to synchronize and - contact all copyright holders on record if/when the occasion arises. - - Linus Torvalds - ----------------------------------------- - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/dependencies/darwin_amd64/git/2.30.1/INSTALL_RECEIPT.json b/dependencies/darwin_amd64/git/2.30.1/INSTALL_RECEIPT.json deleted file mode 100644 index 5c1f1d9c0..000000000 --- a/dependencies/darwin_amd64/git/2.30.1/INSTALL_RECEIPT.json +++ /dev/null @@ -1 +0,0 @@ -{"homebrew_version":"3.0.0-55-gc1bd17e","used_options":[],"unused_options":[],"built_as_bottle":true,"poured_from_bottle":false,"installed_as_dependency":false,"installed_on_request":true,"changed_files":["bin/git-cvsserver","libexec/git-core/git-add--interactive","libexec/git-core/git-archimport","libexec/git-core/git-cvsexportcommit","libexec/git-core/git-cvsimport","libexec/git-core/git-instaweb","libexec/git-core/git-send-email","libexec/git-core/git-svn","share/gitweb/gitweb.cgi","libexec/git-core/git-sh-i18n","share/git-core/contrib/contacts/Makefile","share/git-core/contrib/credential/wincred/Makefile","share/git-core/contrib/subtree/Makefile","share/man/man1/git-config.1","share/perl5/Git/I18N.pm"],"time":null,"source_modified_time":1612826455,"HEAD":null,"stdlib":null,"compiler":"clang","aliases":[],"runtime_dependencies":[{"full_name":"gettext","version":"0.21"},{"full_name":"pcre2","version":"10.36"}],"source":{"path":"/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb","tap":"homebrew/core","spec":"stable","versions":{"stable":"2.30.1","head":"HEAD","version_scheme":0}},"arch":"x86_64","built_on":{"os":"Macintosh","os_version":"macOS 11","cpu_family":"penryn","xcode":"12.4","clt":"12.4.0.0.1.1610135815"}} \ No newline at end of file diff --git a/dependencies/darwin_amd64/git/2.30.1/README.md b/dependencies/darwin_amd64/git/2.30.1/README.md deleted file mode 100644 index eb8115e6b..000000000 --- a/dependencies/darwin_amd64/git/2.30.1/README.md +++ /dev/null @@ -1,66 +0,0 @@ -[![Build status](https://github.com/git/git/workflows/CI/PR/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush) - -Git - fast, scalable, distributed revision control system -========================================================= - -Git is a fast, scalable, distributed revision control system with an -unusually rich command set that provides both high-level operations -and full access to internals. - -Git is an Open Source project covered by the GNU General Public -License version 2 (some parts of it are under different licenses, -compatible with the GPLv2). It was originally written by Linus -Torvalds with help of a group of hackers around the net. - -Please read the file [INSTALL][] for installation instructions. - -Many Git online resources are accessible from -including full documentation and Git related tools. - -See [Documentation/gittutorial.txt][] to get started, then see -[Documentation/giteveryday.txt][] for a useful minimum set of commands, and -`Documentation/git-.txt` for documentation of each command. -If git has been correctly installed, then the tutorial can also be -read with `man gittutorial` or `git help tutorial`, and the -documentation of each command with `man git-` or `git help -`. - -CVS users may also want to read [Documentation/gitcvs-migration.txt][] -(`man gitcvs-migration` or `git help cvs-migration` if git is -installed). - -The user discussion and development of Git take place on the Git -mailing list -- everyone is welcome to post bug reports, feature -requests, comments and patches to git@vger.kernel.org (read -[Documentation/SubmittingPatches][] for instructions on patch submission). -To subscribe to the list, send an email with just "subscribe git" in -the body to majordomo@vger.kernel.org. The mailing list archives are -available at , - and other archival sites. - -Issues which are security relevant should be disclosed privately to -the Git Security mailing list . - -The maintainer frequently sends the "What's cooking" reports that -list the current status of various development topics to the mailing -list. The discussion following them give a good reference for -project status, development direction and remaining tasks. - -The name "git" was given by Linus Torvalds when he wrote the very -first version. He described the tool as "the stupid content tracker" -and the name as (depending on your mood): - - - random three-letter combination that is pronounceable, and not - actually used by any common UNIX command. The fact that it is a - mispronunciation of "get" may or may not be relevant. - - stupid. contemptible and despicable. simple. Take your pick from the - dictionary of slang. - - "global information tracker": you're in a good mood, and it actually - works for you. Angels sing, and a light suddenly fills the room. - - "goddamn idiotic truckload of sh*t": when it breaks - -[INSTALL]: INSTALL -[Documentation/gittutorial.txt]: Documentation/gittutorial.txt -[Documentation/giteveryday.txt]: Documentation/giteveryday.txt -[Documentation/gitcvs-migration.txt]: Documentation/gitcvs-migration.txt -[Documentation/SubmittingPatches]: Documentation/SubmittingPatches diff --git a/dependencies/darwin_amd64/git/2.30.1/bin/git b/dependencies/darwin_amd64/git/2.30.1/bin/git deleted file mode 100755 index a78157fe3..000000000 Binary files a/dependencies/darwin_amd64/git/2.30.1/bin/git and /dev/null differ diff --git a/dependencies/darwin_amd64/git/2.30.1/bin/git-cvsserver b/dependencies/darwin_amd64/git/2.30.1/bin/git-cvsserver deleted file mode 100755 index 1d521948d..000000000 --- a/dependencies/darwin_amd64/git/2.30.1/bin/git-cvsserver +++ /dev/null @@ -1,5110 +0,0 @@ -#!/usr/bin/perl - -use lib (split(/:/, $ENV{GITPERLLIB} || '@@HOMEBREW_CELLAR@@/git/2.30.1/share/perl5:/Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level:/Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level')); - -#### -#### This application is a CVS emulation layer for git. -#### It is intended for clients to connect over SSH. -#### See the documentation for more details. -#### -#### Copyright The Open University UK - 2006. -#### -#### Authors: Martyn Smith -#### Martin Langhoff -#### -#### -#### Released under the GNU Public License, version 2. -#### -#### - -use 5.008; -use strict; -use warnings; -use bytes; - -use Fcntl; -use File::Temp qw/tempdir tempfile/; -use File::Path qw/rmtree/; -use File::Basename; -use Getopt::Long qw(:config require_order no_ignore_case); - -my $VERSION = '2.30.1'; - -my $log = GITCVS::log->new(); -my $cfg; - -my $DATE_LIST = { - Jan => "01", - Feb => "02", - Mar => "03", - Apr => "04", - May => "05", - Jun => "06", - Jul => "07", - Aug => "08", - Sep => "09", - Oct => "10", - Nov => "11", - Dec => "12", -}; - -# Enable autoflush for STDOUT (otherwise the whole thing falls apart) -$| = 1; - -#### Definition and mappings of functions #### - -# NOTE: Despite the existence of req_CATCHALL and req_EMPTY unimplemented -# requests, this list is incomplete. It is missing many rarer/optional -# requests. Perhaps some clients require a claim of support for -# these specific requests for main functionality to work? -my $methods = { - 'Root' => \&req_Root, - 'Valid-responses' => \&req_Validresponses, - 'valid-requests' => \&req_validrequests, - 'Directory' => \&req_Directory, - 'Sticky' => \&req_Sticky, - 'Entry' => \&req_Entry, - 'Modified' => \&req_Modified, - 'Unchanged' => \&req_Unchanged, - 'Questionable' => \&req_Questionable, - 'Argument' => \&req_Argument, - 'Argumentx' => \&req_Argument, - 'expand-modules' => \&req_expandmodules, - 'add' => \&req_add, - 'remove' => \&req_remove, - 'co' => \&req_co, - 'update' => \&req_update, - 'ci' => \&req_ci, - 'diff' => \&req_diff, - 'log' => \&req_log, - 'rlog' => \&req_log, - 'tag' => \&req_CATCHALL, - 'status' => \&req_status, - 'admin' => \&req_CATCHALL, - 'history' => \&req_CATCHALL, - 'watchers' => \&req_EMPTY, - 'editors' => \&req_EMPTY, - 'noop' => \&req_EMPTY, - 'annotate' => \&req_annotate, - 'Global_option' => \&req_Globaloption, -}; - -############################################## - - -# $state holds all the bits of information the clients sends us that could -# potentially be useful when it comes to actually _doing_ something. -my $state = { prependdir => '' }; - -# Work is for managing temporary working directory -my $work = - { - state => undef, # undef, 1 (empty), 2 (with stuff) - workDir => undef, - index => undef, - emptyDir => undef, - tmpDir => undef - }; - -$log->info("--------------- STARTING -----------------"); - -my $usage = - "usage: git cvsserver [options] [pserver|server] [ ...]\n". - " --base-path : Prepend to requested CVSROOT\n". - " Can be read from GIT_CVSSERVER_BASE_PATH\n". - " --strict-paths : Don't allow recursing into subdirectories\n". - " --export-all : Don't check for gitcvs.enabled in config\n". - " --version, -V : Print version information and exit\n". - " -h, -H : Print usage information and exit\n". - "\n". - " ... is a list of allowed directories. If no directories\n". - "are given, all are allowed. This is an additional restriction, gitcvs\n". - "access still needs to be enabled by the gitcvs.enabled config option.\n". - "Alternately, one directory may be specified in GIT_CVSSERVER_ROOT.\n"; - -my @opts = ( 'h|H', 'version|V', - 'base-path=s', 'strict-paths', 'export-all' ); -GetOptions( $state, @opts ) - or die $usage; - -if ($state->{version}) { - print "git-cvsserver version $VERSION\n"; - exit; -} -if ($state->{help}) { - print $usage; - exit; -} - -my $TEMP_DIR = tempdir( CLEANUP => 1 ); -$log->debug("Temporary directory is '$TEMP_DIR'"); - -$state->{method} = 'ext'; -if (@ARGV) { - if ($ARGV[0] eq 'pserver') { - $state->{method} = 'pserver'; - shift @ARGV; - } elsif ($ARGV[0] eq 'server') { - shift @ARGV; - } -} - -# everything else is a directory -$state->{allowed_roots} = [ @ARGV ]; - -# don't export the whole system unless the users requests it -if ($state->{'export-all'} && !@{$state->{allowed_roots}}) { - die "--export-all can only be used together with an explicit whitelist\n"; -} - -# Environment handling for running under git-shell -if (exists $ENV{GIT_CVSSERVER_BASE_PATH}) { - if ($state->{'base-path'}) { - die "Cannot specify base path both ways.\n"; - } - my $base_path = $ENV{GIT_CVSSERVER_BASE_PATH}; - $state->{'base-path'} = $base_path; - $log->debug("Picked up base path '$base_path' from environment.\n"); -} -if (exists $ENV{GIT_CVSSERVER_ROOT}) { - if (@{$state->{allowed_roots}}) { - die "Cannot specify roots both ways: @ARGV\n"; - } - my $allowed_root = $ENV{GIT_CVSSERVER_ROOT}; - $state->{allowed_roots} = [ $allowed_root ]; - $log->debug("Picked up allowed root '$allowed_root' from environment.\n"); -} - -# if we are called with a pserver argument, -# deal with the authentication cat before entering the -# main loop -if ($state->{method} eq 'pserver') { - my $line = ; chomp $line; - unless( $line =~ /^BEGIN (AUTH|VERIFICATION) REQUEST$/) { - die "E Do not understand $line - expecting BEGIN AUTH REQUEST\n"; - } - my $request = $1; - $line = ; chomp $line; - unless (req_Root('root', $line)) { # reuse Root - print "E Invalid root $line \n"; - exit 1; - } - $line = ; chomp $line; - my $user = $line; - $line = ; chomp $line; - my $password = $line; - - if ($user eq 'anonymous') { - # "A" will be 1 byte, use length instead in case the - # encryption method ever changes (yeah, right!) - if (length($password) > 1 ) { - print "E Don't supply a password for the `anonymous' user\n"; - print "I HATE YOU\n"; - exit 1; - } - - # Fall through to LOVE - } else { - # Trying to authenticate a user - if (not exists $cfg->{gitcvs}->{authdb}) { - print "E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\n"; - print "I HATE YOU\n"; - exit 1; - } - - my $authdb = $cfg->{gitcvs}->{authdb}; - - unless (-e $authdb) { - print "E The authentication database specified in [gitcvs.authdb] does not exist\n"; - print "I HATE YOU\n"; - exit 1; - } - - my $auth_ok; - open my $passwd, "<", $authdb or die $!; - while (<$passwd>) { - if (m{^\Q$user\E:(.*)}) { - if (crypt($user, descramble($password)) eq $1) { - $auth_ok = 1; - } - }; - } - close $passwd; - - unless ($auth_ok) { - print "I HATE YOU\n"; - exit 1; - } - - # Fall through to LOVE - } - - # For checking whether the user is anonymous on commit - $state->{user} = $user; - - $line = ; chomp $line; - unless ($line eq "END $request REQUEST") { - die "E Do not understand $line -- expecting END $request REQUEST\n"; - } - print "I LOVE YOU\n"; - exit if $request eq 'VERIFICATION'; # cvs login - # and now back to our regular programme... -} - -# Keep going until the client closes the connection -while () -{ - chomp; - - # Check to see if we've seen this method, and call appropriate function. - if ( /^([\w-]+)(?:\s+(.*))?$/ and defined($methods->{$1}) ) - { - # use the $methods hash to call the appropriate sub for this command - #$log->info("Method : $1"); - &{$methods->{$1}}($1,$2); - } else { - # log fatal because we don't understand this function. If this happens - # we're fairly screwed because we don't know if the client is expecting - # a response. If it is, the client will hang, we'll hang, and the whole - # thing will be custard. - $log->fatal("Don't understand command $_\n"); - die("Unknown command $_"); - } -} - -$log->debug("Processing time : user=" . (times)[0] . " system=" . (times)[1]); -$log->info("--------------- FINISH -----------------"); - -chdir '/'; -exit 0; - -# Magic catchall method. -# This is the method that will handle all commands we haven't yet -# implemented. It simply sends a warning to the log file indicating a -# command that hasn't been implemented has been invoked. -sub req_CATCHALL -{ - my ( $cmd, $data ) = @_; - $log->warn("Unhandled command : req_$cmd : $data"); -} - -# This method invariably succeeds with an empty response. -sub req_EMPTY -{ - print "ok\n"; -} - -# Root pathname \n -# Response expected: no. Tell the server which CVSROOT to use. Note that -# pathname is a local directory and not a fully qualified CVSROOT variable. -# pathname must already exist; if creating a new root, use the init -# request, not Root. pathname does not include the hostname of the server, -# how to access the server, etc.; by the time the CVS protocol is in use, -# connection, authentication, etc., are already taken care of. The Root -# request must be sent only once, and it must be sent before any requests -# other than Valid-responses, valid-requests, UseUnchanged, Set or init. -sub req_Root -{ - my ( $cmd, $data ) = @_; - $log->debug("req_Root : $data"); - - unless ($data =~ m#^/#) { - print "error 1 Root must be an absolute pathname\n"; - return 0; - } - - my $cvsroot = $state->{'base-path'} || ''; - $cvsroot =~ s#/+$##; - $cvsroot .= $data; - - if ($state->{CVSROOT} - && ($state->{CVSROOT} ne $cvsroot)) { - print "error 1 Conflicting roots specified\n"; - return 0; - } - - $state->{CVSROOT} = $cvsroot; - - $ENV{GIT_DIR} = $state->{CVSROOT} . "/"; - - if (@{$state->{allowed_roots}}) { - my $allowed = 0; - foreach my $dir (@{$state->{allowed_roots}}) { - next unless $dir =~ m#^/#; - $dir =~ s#/+$##; - if ($state->{'strict-paths'}) { - if ($ENV{GIT_DIR} =~ m#^\Q$dir\E/?$#) { - $allowed = 1; - last; - } - } elsif ($ENV{GIT_DIR} =~ m#^\Q$dir\E(/?$|/)#) { - $allowed = 1; - last; - } - } - - unless ($allowed) { - print "E $ENV{GIT_DIR} does not seem to be a valid GIT repository\n"; - print "E \n"; - print "error 1 $ENV{GIT_DIR} is not a valid repository\n"; - return 0; - } - } - - unless (-d $ENV{GIT_DIR} && -e $ENV{GIT_DIR}.'HEAD') { - print "E $ENV{GIT_DIR} does not seem to be a valid GIT repository\n"; - print "E \n"; - print "error 1 $ENV{GIT_DIR} is not a valid repository\n"; - return 0; - } - - my @gitvars = safe_pipe_capture(qw(git config -l)); - if ($?) { - print "E problems executing git-config on the server -- this is not a git repository or the PATH is not set correctly.\n"; - print "E \n"; - print "error 1 - problem executing git-config\n"; - return 0; - } - foreach my $line ( @gitvars ) - { - next unless ( $line =~ /^(gitcvs|extensions)\.(?:(ext|pserver)\.)?([\w-]+)=(.*)$/ ); - unless ($2) { - $cfg->{$1}{$3} = $4; - } else { - $cfg->{$1}{$2}{$3} = $4; - } - } - - my $enabled = ($cfg->{gitcvs}{$state->{method}}{enabled} - || $cfg->{gitcvs}{enabled}); - unless ($state->{'export-all'} || - ($enabled && $enabled =~ /^\s*(1|true|yes)\s*$/i)) { - print "E GITCVS emulation needs to be enabled on this repo\n"; - print "E the repo config file needs a [gitcvs] section added, and the parameter 'enabled' set to 1\n"; - print "E \n"; - print "error 1 GITCVS emulation disabled\n"; - return 0; - } - - my $logfile = $cfg->{gitcvs}{$state->{method}}{logfile} || $cfg->{gitcvs}{logfile}; - if ( $logfile ) - { - $log->setfile($logfile); - } else { - $log->nofile(); - } - - $state->{rawsz} = ($cfg->{'extensions'}{'objectformat'} || 'sha1') eq 'sha256' ? 32 : 20; - $state->{hexsz} = $state->{rawsz} * 2; - - return 1; -} - -# Global_option option \n -# Response expected: no. Transmit one of the global options `-q', `-Q', -# `-l', `-t', `-r', or `-n'. option must be one of those strings, no -# variations (such as combining of options) are allowed. For graceful -# handling of valid-requests, it is probably better to make new global -# options separate requests, rather than trying to add them to this -# request. -sub req_Globaloption -{ - my ( $cmd, $data ) = @_; - $log->debug("req_Globaloption : $data"); - $state->{globaloptions}{$data} = 1; -} - -# Valid-responses request-list \n -# Response expected: no. Tell the server what responses the client will -# accept. request-list is a space separated list of tokens. -sub req_Validresponses -{ - my ( $cmd, $data ) = @_; - $log->debug("req_Validresponses : $data"); - - # TODO : re-enable this, currently it's not particularly useful - #$state->{validresponses} = [ split /\s+/, $data ]; -} - -# valid-requests \n -# Response expected: yes. Ask the server to send back a Valid-requests -# response. -sub req_validrequests -{ - my ( $cmd, $data ) = @_; - - $log->debug("req_validrequests"); - - $log->debug("SEND : Valid-requests " . join(" ",sort keys %$methods)); - $log->debug("SEND : ok"); - - print "Valid-requests " . join(" ",sort keys %$methods) . "\n"; - print "ok\n"; -} - -# Directory local-directory \n -# Additional data: repository \n. Response expected: no. Tell the server -# what directory to use. The repository should be a directory name from a -# previous server response. Note that this both gives a default for Entry -# and Modified and also for ci and the other commands; normal usage is to -# send Directory for each directory in which there will be an Entry or -# Modified, and then a final Directory for the original directory, then the -# command. The local-directory is relative to the top level at which the -# command is occurring (i.e. the last Directory which is sent before the -# command); to indicate that top level, `.' should be sent for -# local-directory. -sub req_Directory -{ - my ( $cmd, $data ) = @_; - - my $repository = ; - chomp $repository; - - - $state->{localdir} = $data; - $state->{repository} = $repository; - $state->{path} = $repository; - $state->{path} =~ s/^\Q$state->{CVSROOT}\E\///; - $state->{module} = $1 if ($state->{path} =~ s/^(.*?)(\/|$)//); - $state->{path} .= "/" if ( $state->{path} =~ /\S/ ); - - $state->{directory} = $state->{localdir}; - $state->{directory} = "" if ( $state->{directory} eq "." ); - $state->{directory} .= "/" if ( $state->{directory} =~ /\S/ ); - - if ( (not defined($state->{prependdir}) or $state->{prependdir} eq '') and $state->{localdir} eq "." and $state->{path} =~ /\S/ ) - { - $log->info("Setting prepend to '$state->{path}'"); - $state->{prependdir} = $state->{path}; - my %entries; - foreach my $entry ( keys %{$state->{entries}} ) - { - $entries{$state->{prependdir} . $entry} = $state->{entries}{$entry}; - } - $state->{entries}=\%entries; - - my %dirMap; - foreach my $dir ( keys %{$state->{dirMap}} ) - { - $dirMap{$state->{prependdir} . $dir} = $state->{dirMap}{$dir}; - } - $state->{dirMap}=\%dirMap; - } - - if ( defined ( $state->{prependdir} ) ) - { - $log->debug("Prepending '$state->{prependdir}' to state|directory"); - $state->{directory} = $state->{prependdir} . $state->{directory} - } - - if ( ! defined($state->{dirMap}{$state->{directory}}) ) - { - $state->{dirMap}{$state->{directory}} = - { - 'names' => {} - #'tagspec' => undef - }; - } - - $log->debug("req_Directory : localdir=$data repository=$repository path=$state->{path} directory=$state->{directory} module=$state->{module}"); -} - -# Sticky tagspec \n -# Response expected: no. Tell the server that the directory most -# recently specified with Directory has a sticky tag or date -# tagspec. The first character of tagspec is T for a tag, D for -# a date, or some other character supplied by a Set-sticky -# response from a previous request to the server. The remainder -# of tagspec contains the actual tag or date, again as supplied -# by Set-sticky. -# The server should remember Static-directory and Sticky requests -# for a particular directory; the client need not resend them each -# time it sends a Directory request for a given directory. However, -# the server is not obliged to remember them beyond the context -# of a single command. -sub req_Sticky -{ - my ( $cmd, $tagspec ) = @_; - - my ( $stickyInfo ); - if($tagspec eq "") - { - # nothing - } - elsif($tagspec=~/^T([^ ]+)\s*$/) - { - $stickyInfo = { 'tag' => $1 }; - } - elsif($tagspec=~/^D([0-9.]+)\s*$/) - { - $stickyInfo= { 'date' => $1 }; - } - else - { - die "Unknown tag_or_date format\n"; - } - $state->{dirMap}{$state->{directory}}{stickyInfo}=$stickyInfo; - - $log->debug("req_Sticky : tagspec=$tagspec repository=$state->{repository}" - . " path=$state->{path} directory=$state->{directory}" - . " module=$state->{module}"); -} - -# Entry entry-line \n -# Response expected: no. Tell the server what version of a file is on the -# local machine. The name in entry-line is a name relative to the directory -# most recently specified with Directory. If the user is operating on only -# some files in a directory, Entry requests for only those files need be -# included. If an Entry request is sent without Modified, Is-modified, or -# Unchanged, it means the file is lost (does not exist in the working -# directory). If both Entry and one of Modified, Is-modified, or Unchanged -# are sent for the same file, Entry must be sent first. For a given file, -# one can send Modified, Is-modified, or Unchanged, but not more than one -# of these three. -sub req_Entry -{ - my ( $cmd, $data ) = @_; - - #$log->debug("req_Entry : $data"); - - my @data = split(/\//, $data, -1); - - $state->{entries}{$state->{directory}.$data[1]} = { - revision => $data[2], - conflict => $data[3], - options => $data[4], - tag_or_date => $data[5], - }; - - $state->{dirMap}{$state->{directory}}{names}{$data[1]} = 'F'; - - $log->info("Received entry line '$data' => '" . $state->{directory} . $data[1] . "'"); -} - -# Questionable filename \n -# Response expected: no. Additional data: no. Tell the server to check -# whether filename should be ignored, and if not, next time the server -# sends responses, send (in a M response) `?' followed by the directory and -# filename. filename must not contain `/'; it needs to be a file in the -# directory named by the most recent Directory request. -sub req_Questionable -{ - my ( $cmd, $data ) = @_; - - $log->debug("req_Questionable : $data"); - $state->{entries}{$state->{directory}.$data}{questionable} = 1; -} - -# add \n -# Response expected: yes. Add a file or directory. This uses any previous -# Argument, Directory, Entry, or Modified requests, if they have been sent. -# The last Directory sent specifies the working directory at the time of -# the operation. To add a directory, send the directory to be added using -# Directory and Argument requests. -sub req_add -{ - my ( $cmd, $data ) = @_; - - argsplit("add"); - - my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); - $updater->update(); - - my $addcount = 0; - - foreach my $filename ( @{$state->{args}} ) - { - $filename = filecleanup($filename); - - # no -r, -A, or -D with add - my $stickyInfo = resolveStickyInfo($filename); - - my $meta = $updater->getmeta($filename,$stickyInfo); - my $wrev = revparse($filename); - - if ($wrev && $meta && ($wrev=~/^-/)) - { - # previously removed file, add back - $log->info("added file $filename was previously removed, send $meta->{revision}"); - - print "MT +updated\n"; - print "MT text U \n"; - print "MT fname $filename\n"; - print "MT newline\n"; - print "MT -updated\n"; - - unless ( $state->{globaloptions}{-n} ) - { - my ( $filepart, $dirpart ) = filenamesplit($filename,1); - - print "Created $dirpart\n"; - print $state->{CVSROOT} . "/$state->{module}/$filename\n"; - - # this is an "entries" line - my $kopts = kopts_from_path($filename,"sha1",$meta->{filehash}); - my $entryLine = "/$filepart/$meta->{revision}//$kopts/"; - $entryLine .= getStickyTagOrDate($stickyInfo); - $log->debug($entryLine); - print "$entryLine\n"; - # permissions - $log->debug("SEND : u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}"); - print "u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}\n"; - # transmit file - transmitfile($meta->{filehash}); - } - - next; - } - - unless ( defined ( $state->{entries}{$filename}{modified_filename} ) ) - { - print "E cvs add: nothing known about `$filename'\n"; - next; - } - # TODO : check we're not squashing an already existing file - if ( defined ( $state->{entries}{$filename}{revision} ) ) - { - print "E cvs add: `$filename' has already been entered\n"; - next; - } - - my ( $filepart, $dirpart ) = filenamesplit($filename, 1); - - print "E cvs add: scheduling file `$filename' for addition\n"; - - print "Checked-in $dirpart\n"; - print "$filename\n"; - my $kopts = kopts_from_path($filename,"file", - $state->{entries}{$filename}{modified_filename}); - print "/$filepart/0//$kopts/" . - getStickyTagOrDate($stickyInfo) . "\n"; - - my $requestedKopts = $state->{opt}{k}; - if(defined($requestedKopts)) - { - $requestedKopts = "-k$requestedKopts"; - } - else - { - $requestedKopts = ""; - } - if( $kopts ne $requestedKopts ) - { - $log->warn("Ignoring requested -k='$requestedKopts'" - . " for '$filename'; detected -k='$kopts' instead"); - #TODO: Also have option to send warning to user? - } - - $addcount++; - } - - if ( $addcount == 1 ) - { - print "E cvs add: use `cvs commit' to add this file permanently\n"; - } - elsif ( $addcount > 1 ) - { - print "E cvs add: use `cvs commit' to add these files permanently\n"; - } - - print "ok\n"; -} - -# remove \n -# Response expected: yes. Remove a file. This uses any previous Argument, -# Directory, Entry, or Modified requests, if they have been sent. The last -# Directory sent specifies the working directory at the time of the -# operation. Note that this request does not actually do anything to the -# repository; the only effect of a successful remove request is to supply -# the client with a new entries line containing `-' to indicate a removed -# file. In fact, the client probably could perform this operation without -# contacting the server, although using remove may cause the server to -# perform a few more checks. The client sends a subsequent ci request to -# actually record the removal in the repository. -sub req_remove -{ - my ( $cmd, $data ) = @_; - - argsplit("remove"); - - # Grab a handle to the SQLite db and do any necessary updates - my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); - $updater->update(); - - #$log->debug("add state : " . Dumper($state)); - - my $rmcount = 0; - - foreach my $filename ( @{$state->{args}} ) - { - $filename = filecleanup($filename); - - if ( defined ( $state->{entries}{$filename}{unchanged} ) or defined ( $state->{entries}{$filename}{modified_filename} ) ) - { - print "E cvs remove: file `$filename' still in working directory\n"; - next; - } - - # only from entries - my $stickyInfo = resolveStickyInfo($filename); - - my $meta = $updater->getmeta($filename,$stickyInfo); - my $wrev = revparse($filename); - - unless ( defined ( $wrev ) ) - { - print "E cvs remove: nothing known about `$filename'\n"; - next; - } - - if ( defined($wrev) and ($wrev=~/^-/) ) - { - print "E cvs remove: file `$filename' already scheduled for removal\n"; - next; - } - - unless ( $wrev eq $meta->{revision} ) - { - # TODO : not sure if the format of this message is quite correct. - print "E cvs remove: Up to date check failed for `$filename'\n"; - next; - } - - - my ( $filepart, $dirpart ) = filenamesplit($filename, 1); - - print "E cvs remove: scheduling `$filename' for removal\n"; - - print "Checked-in $dirpart\n"; - print "$filename\n"; - my $kopts = kopts_from_path($filename,"sha1",$meta->{filehash}); - print "/$filepart/-$wrev//$kopts/" . getStickyTagOrDate($stickyInfo) . "\n"; - - $rmcount++; - } - - if ( $rmcount == 1 ) - { - print "E cvs remove: use `cvs commit' to remove this file permanently\n"; - } - elsif ( $rmcount > 1 ) - { - print "E cvs remove: use `cvs commit' to remove these files permanently\n"; - } - - print "ok\n"; -} - -# Modified filename \n -# Response expected: no. Additional data: mode, \n, file transmission. Send -# the server a copy of one locally modified file. filename is a file within -# the most recent directory sent with Directory; it must not contain `/'. -# If the user is operating on only some files in a directory, only those -# files need to be included. This can also be sent without Entry, if there -# is no entry for the file. -sub req_Modified -{ - my ( $cmd, $data ) = @_; - - my $mode = ; - defined $mode - or (print "E end of file reading mode for $data\n"), return; - chomp $mode; - my $size = ; - defined $size - or (print "E end of file reading size of $data\n"), return; - chomp $size; - - # Grab config information - my $blocksize = 8192; - my $bytesleft = $size; - my $tmp; - - # Get a filehandle/name to write it to - my ( $fh, $filename ) = tempfile( DIR => $TEMP_DIR ); - - # Loop over file data writing out to temporary file. - while ( $bytesleft ) - { - $blocksize = $bytesleft if ( $bytesleft < $blocksize ); - read STDIN, $tmp, $blocksize; - print $fh $tmp; - $bytesleft -= $blocksize; - } - - close $fh - or (print "E failed to write temporary, $filename: $!\n"), return; - - # Ensure we have something sensible for the file mode - if ( $mode =~ /u=(\w+)/ ) - { - $mode = $1; - } else { - $mode = "rw"; - } - - # Save the file data in $state - $state->{entries}{$state->{directory}.$data}{modified_filename} = $filename; - $state->{entries}{$state->{directory}.$data}{modified_mode} = $mode; - $state->{entries}{$state->{directory}.$data}{modified_hash} = safe_pipe_capture('git','hash-object',$filename); - $state->{entries}{$state->{directory}.$data}{modified_hash} =~ s/\s.*$//s; - - #$log->debug("req_Modified : file=$data mode=$mode size=$size"); -} - -# Unchanged filename \n -# Response expected: no. Tell the server that filename has not been -# modified in the checked out directory. The filename is a file within the -# most recent directory sent with Directory; it must not contain `/'. -sub req_Unchanged -{ - my ( $cmd, $data ) = @_; - - $state->{entries}{$state->{directory}.$data}{unchanged} = 1; - - #$log->debug("req_Unchanged : $data"); -} - -# Argument text \n -# Response expected: no. Save argument for use in a subsequent command. -# Arguments accumulate until an argument-using command is given, at which -# point they are forgotten. -# Argumentx text \n -# Response expected: no. Append \n followed by text to the current argument -# being saved. -sub req_Argument -{ - my ( $cmd, $data ) = @_; - - # Argumentx means: append to last Argument (with a newline in front) - - $log->debug("$cmd : $data"); - - if ( $cmd eq 'Argumentx') { - ${$state->{arguments}}[$#{$state->{arguments}}] .= "\n" . $data; - } else { - push @{$state->{arguments}}, $data; - } -} - -# expand-modules \n -# Response expected: yes. Expand the modules which are specified in the -# arguments. Returns the data in Module-expansion responses. Note that the -# server can assume that this is checkout or export, not rtag or rdiff; the -# latter do not access the working directory and thus have no need to -# expand modules on the client side. Expand may not be the best word for -# what this request does. It does not necessarily tell you all the files -# contained in a module, for example. Basically it is a way of telling you -# which working directories the server needs to know about in order to -# handle a checkout of the specified modules. For example, suppose that the -# server has a module defined by -# aliasmodule -a 1dir -# That is, one can check out aliasmodule and it will take 1dir in the -# repository and check it out to 1dir in the working directory. Now suppose -# the client already has this module checked out and is planning on using -# the co request to update it. Without using expand-modules, the client -# would have two bad choices: it could either send information about all -# working directories under the current directory, which could be -# unnecessarily slow, or it could be ignorant of the fact that aliasmodule -# stands for 1dir, and neglect to send information for 1dir, which would -# lead to incorrect operation. With expand-modules, the client would first -# ask for the module to be expanded: -sub req_expandmodules -{ - my ( $cmd, $data ) = @_; - - argsplit(); - - $log->debug("req_expandmodules : " . ( defined($data) ? $data : "[NULL]" ) ); - - unless ( ref $state->{arguments} eq "ARRAY" ) - { - print "ok\n"; - return; - } - - foreach my $module ( @{$state->{arguments}} ) - { - $log->debug("SEND : Module-expansion $module"); - print "Module-expansion $module\n"; - } - - print "ok\n"; - statecleanup(); -} - -# co \n -# Response expected: yes. Get files from the repository. This uses any -# previous Argument, Directory, Entry, or Modified requests, if they have -# been sent. Arguments to this command are module names; the client cannot -# know what directories they correspond to except by (1) just sending the -# co request, and then seeing what directory names the server sends back in -# its responses, and (2) the expand-modules request. -sub req_co -{ - my ( $cmd, $data ) = @_; - - argsplit("co"); - - # Provide list of modules, if -c was used. - if (exists $state->{opt}{c}) { - my $showref = safe_pipe_capture(qw(git show-ref --heads)); - for my $line (split '\n', $showref) { - if ( $line =~ m% refs/heads/(.*)$% ) { - print "M $1\t$1\n"; - } - } - print "ok\n"; - return 1; - } - - my $stickyInfo = { 'tag' => $state->{opt}{r}, - 'date' => $state->{opt}{D} }; - - my $module = $state->{args}[0]; - $state->{module} = $module; - my $checkout_path = $module; - - # use the user specified directory if we're given it - $checkout_path = $state->{opt}{d} if ( exists ( $state->{opt}{d} ) ); - - $log->debug("req_co : " . ( defined($data) ? $data : "[NULL]" ) ); - - $log->info("Checking out module '$module' ($state->{CVSROOT}) to '$checkout_path'"); - - $ENV{GIT_DIR} = $state->{CVSROOT} . "/"; - - # Grab a handle to the SQLite db and do any necessary updates - my $updater = GITCVS::updater->new($state->{CVSROOT}, $module, $log); - $updater->update(); - - my $headHash; - if( defined($stickyInfo) && defined($stickyInfo->{tag}) ) - { - $headHash = $updater->lookupCommitRef($stickyInfo->{tag}); - if( !defined($headHash) ) - { - print "error 1 no such tag `$stickyInfo->{tag}'\n"; - cleanupWorkTree(); - exit; - } - } - - $checkout_path =~ s|/$||; # get rid of trailing slashes - - my %seendirs = (); - my $lastdir =''; - - prepDirForOutput( - ".", - $state->{CVSROOT} . "/$module", - $checkout_path, - \%seendirs, - 'checkout', - $state->{dirArgs} ); - - foreach my $git ( @{$updater->getAnyHead($headHash)} ) - { - # Don't want to check out deleted files - next if ( $git->{filehash} eq "deleted" ); - - my $fullName = $git->{name}; - ( $git->{name}, $git->{dir} ) = filenamesplit($git->{name}); - - unless (exists($seendirs{$git->{dir}})) { - prepDirForOutput($git->{dir}, $state->{CVSROOT} . "/$module/", - $checkout_path, \%seendirs, 'checkout', - $state->{dirArgs} ); - $lastdir = $git->{dir}; - $seendirs{$git->{dir}} = 1; - } - - # modification time of this file - print "Mod-time $git->{modified}\n"; - - # print some information to the client - if ( defined ( $git->{dir} ) and $git->{dir} ne "./" ) - { - print "M U $checkout_path/$git->{dir}$git->{name}\n"; - } else { - print "M U $checkout_path/$git->{name}\n"; - } - - # instruct client we're sending a file to put in this path - print "Created $checkout_path/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "\n"; - - print $state->{CVSROOT} . "/$module/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "$git->{name}\n"; - - # this is an "entries" line - my $kopts = kopts_from_path($fullName,"sha1",$git->{filehash}); - print "/$git->{name}/$git->{revision}//$kopts/" . - getStickyTagOrDate($stickyInfo) . "\n"; - # permissions - print "u=$git->{mode},g=$git->{mode},o=$git->{mode}\n"; - - # transmit file - transmitfile($git->{filehash}); - } - - print "ok\n"; - - statecleanup(); -} - -# used by req_co and req_update to set up directories for files -# recursively handles parents -sub prepDirForOutput -{ - my ($dir, $repodir, $remotedir, $seendirs, $request, $dirArgs) = @_; - - my $parent = dirname($dir); - $dir =~ s|/+$||; - $repodir =~ s|/+$||; - $remotedir =~ s|/+$||; - $parent =~ s|/+$||; - - if ($parent eq '.' || $parent eq './') - { - $parent = ''; - } - # recurse to announce unseen parents first - if( length($parent) && - !exists($seendirs->{$parent}) && - ( $request eq "checkout" || - exists($dirArgs->{$parent}) ) ) - { - prepDirForOutput($parent, $repodir, $remotedir, - $seendirs, $request, $dirArgs); - } - # Announce that we are going to modify at the parent level - if ($dir eq '.' || $dir eq './') - { - $dir = ''; - } - if(exists($seendirs->{$dir})) - { - return; - } - $log->debug("announcedir $dir, $repodir, $remotedir" ); - my($thisRemoteDir,$thisRepoDir); - if ($dir ne "") - { - $thisRepoDir="$repodir/$dir"; - if($remotedir eq ".") - { - $thisRemoteDir=$dir; - } - else - { - $thisRemoteDir="$remotedir/$dir"; - } - } - else - { - $thisRepoDir=$repodir; - $thisRemoteDir=$remotedir; - } - unless ( $state->{globaloptions}{-Q} || $state->{globaloptions}{-q} ) - { - print "E cvs $request: Updating $thisRemoteDir\n"; - } - - my ($opt_r)=$state->{opt}{r}; - my $stickyInfo; - if(exists($state->{opt}{A})) - { - # $stickyInfo=undef; - } - elsif( defined($opt_r) && $opt_r ne "" ) - # || ( defined($state->{opt}{D}) && $state->{opt}{D} ne "" ) # TODO - { - $stickyInfo={ 'tag' => (defined($opt_r)?$opt_r:undef) }; - - # TODO: Convert -D value into the form 2011.04.10.04.46.57, - # similar to an entry line's sticky date, without the D prefix. - # It sometimes (always?) arrives as something more like - # '10 Apr 2011 04:46:57 -0000'... - # $stickyInfo={ 'date' => (defined($stickyDate)?$stickyDate:undef) }; - } - else - { - $stickyInfo=getDirStickyInfo($state->{prependdir} . $dir); - } - - my $stickyResponse; - if(defined($stickyInfo)) - { - $stickyResponse = "Set-sticky $thisRemoteDir/\n" . - "$thisRepoDir/\n" . - getStickyTagOrDate($stickyInfo) . "\n"; - } - else - { - $stickyResponse = "Clear-sticky $thisRemoteDir/\n" . - "$thisRepoDir/\n"; - } - - unless ( $state->{globaloptions}{-n} ) - { - print $stickyResponse; - - print "Clear-static-directory $thisRemoteDir/\n"; - print "$thisRepoDir/\n"; - print $stickyResponse; # yes, twice - print "Template $thisRemoteDir/\n"; - print "$thisRepoDir/\n"; - print "0\n"; - } - - $seendirs->{$dir} = 1; - - # FUTURE: This would more accurately emulate CVS by sending - # another copy of sticky after processing the files in that - # directory. Or intermediate: perhaps send all sticky's for - # $seendirs after processing all files. -} - -# update \n -# Response expected: yes. Actually do a cvs update command. This uses any -# previous Argument, Directory, Entry, or Modified requests, if they have -# been sent. The last Directory sent specifies the working directory at the -# time of the operation. The -I option is not used--files which the client -# can decide whether to ignore are not mentioned and the client sends the -# Questionable request for others. -sub req_update -{ - my ( $cmd, $data ) = @_; - - $log->debug("req_update : " . ( defined($data) ? $data : "[NULL]" )); - - argsplit("update"); - - # - # It may just be a client exploring the available heads/modules - # in that case, list them as top level directories and leave it - # at that. Eclipse uses this technique to offer you a list of - # projects (heads in this case) to checkout. - # - if ($state->{module} eq '') { - my $showref = safe_pipe_capture(qw(git show-ref --heads)); - print "E cvs update: Updating .\n"; - for my $line (split '\n', $showref) { - if ( $line =~ m% refs/heads/(.*)$% ) { - print "E cvs update: New directory `$1'\n"; - } - } - print "ok\n"; - return 1; - } - - - # Grab a handle to the SQLite db and do any necessary updates - my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); - - $updater->update(); - - argsfromdir($updater); - - #$log->debug("update state : " . Dumper($state)); - - my($repoDir); - $repoDir=$state->{CVSROOT} . "/$state->{module}/$state->{prependdir}"; - - my %seendirs = (); - - # foreach file specified on the command line ... - foreach my $argsFilename ( @{$state->{args}} ) - { - my $filename; - $filename = filecleanup($argsFilename); - - $log->debug("Processing file $filename"); - - # if we have a -C we should pretend we never saw modified stuff - if ( exists ( $state->{opt}{C} ) ) - { - delete $state->{entries}{$filename}{modified_hash}; - delete $state->{entries}{$filename}{modified_filename}; - $state->{entries}{$filename}{unchanged} = 1; - } - - my $stickyInfo = resolveStickyInfo($filename, - $state->{opt}{r}, - $state->{opt}{D}, - exists($state->{opt}{A})); - my $meta = $updater->getmeta($filename, $stickyInfo); - - # If -p was given, "print" the contents of the requested revision. - if ( exists ( $state->{opt}{p} ) ) { - if ( defined ( $meta->{revision} ) ) { - $log->info("Printing '$filename' revision " . $meta->{revision}); - - transmitfile($meta->{filehash}, { print => 1 }); - } - - next; - } - - # Directories: - prepDirForOutput( - dirname($argsFilename), - $repoDir, - ".", - \%seendirs, - "update", - $state->{dirArgs} ); - - my $wrev = revparse($filename); - - if ( ! defined $meta ) - { - $meta = { - name => $filename, - revision => '0', - filehash => 'added' - }; - if($wrev ne "0") - { - $meta->{filehash}='deleted'; - } - } - - my $oldmeta = $meta; - - # If the working copy is an old revision, lets get that version too for comparison. - my $oldWrev=$wrev; - if(defined($oldWrev)) - { - $oldWrev=~s/^-//; - if($oldWrev ne $meta->{revision}) - { - $oldmeta = $updater->getmeta($filename, $oldWrev); - } - } - - #$log->debug("Target revision is $meta->{revision}, current working revision is $wrev"); - - # Files are up to date if the working copy and repo copy have the same revision, - # and the working copy is unmodified _and_ the user hasn't specified -C - next if ( defined ( $wrev ) - and defined($meta->{revision}) - and $wrev eq $meta->{revision} - and $state->{entries}{$filename}{unchanged} - and not exists ( $state->{opt}{C} ) ); - - # If the working copy and repo copy have the same revision, - # but the working copy is modified, tell the client it's modified - if ( defined ( $wrev ) - and defined($meta->{revision}) - and $wrev eq $meta->{revision} - and $wrev ne "0" - and defined($state->{entries}{$filename}{modified_hash}) - and not exists ( $state->{opt}{C} ) ) - { - $log->info("Tell the client the file is modified"); - print "MT text M \n"; - print "MT fname $filename\n"; - print "MT newline\n"; - next; - } - - if ( $meta->{filehash} eq "deleted" && $wrev ne "0" ) - { - # TODO: If it has been modified in the sandbox, error out - # with the appropriate message, rather than deleting a modified - # file. - - my ( $filepart, $dirpart ) = filenamesplit($filename,1); - - $log->info("Removing '$filename' from working copy (no longer in the repo)"); - - print "E cvs update: `$filename' is no longer in the repository\n"; - # Don't want to actually _DO_ the update if -n specified - unless ( $state->{globaloptions}{-n} ) { - print "Removed $dirpart\n"; - print "$filepart\n"; - } - } - elsif ( not defined ( $state->{entries}{$filename}{modified_hash} ) - or $state->{entries}{$filename}{modified_hash} eq $oldmeta->{filehash} - or $meta->{filehash} eq 'added' ) - { - # normal update, just send the new revision (either U=Update, - # or A=Add, or R=Remove) - if ( defined($wrev) && ($wrev=~/^-/) ) - { - $log->info("Tell the client the file is scheduled for removal"); - print "MT text R \n"; - print "MT fname $filename\n"; - print "MT newline\n"; - next; - } - elsif ( (!defined($wrev) || $wrev eq '0') && - (!defined($meta->{revision}) || $meta->{revision} eq '0') ) - { - $log->info("Tell the client the file is scheduled for addition"); - print "MT text A \n"; - print "MT fname $filename\n"; - print "MT newline\n"; - next; - - } - else { - $log->info("UpdatingX3 '$filename' to ".$meta->{revision}); - print "MT +updated\n"; - print "MT text U \n"; - print "MT fname $filename\n"; - print "MT newline\n"; - print "MT -updated\n"; - } - - my ( $filepart, $dirpart ) = filenamesplit($filename,1); - - # Don't want to actually _DO_ the update if -n specified - unless ( $state->{globaloptions}{-n} ) - { - if ( defined ( $wrev ) ) - { - # instruct client we're sending a file to put in this path as a replacement - print "Update-existing $dirpart\n"; - $log->debug("Updating existing file 'Update-existing $dirpart'"); - } else { - # instruct client we're sending a file to put in this path as a new file - - $log->debug("Creating new file 'Created $dirpart'"); - print "Created $dirpart\n"; - } - print $state->{CVSROOT} . "/$state->{module}/$filename\n"; - - # this is an "entries" line - my $kopts = kopts_from_path($filename,"sha1",$meta->{filehash}); - my $entriesLine = "/$filepart/$meta->{revision}//$kopts/"; - $entriesLine .= getStickyTagOrDate($stickyInfo); - $log->debug($entriesLine); - print "$entriesLine\n"; - - # permissions - $log->debug("SEND : u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}"); - print "u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}\n"; - - # transmit file - transmitfile($meta->{filehash}); - } - } else { - my ( $filepart, $dirpart ) = filenamesplit($meta->{name},1); - - my $mergeDir = setupTmpDir(); - - my $file_local = $filepart . ".mine"; - my $mergedFile = "$mergeDir/$file_local"; - system("ln","-s",$state->{entries}{$filename}{modified_filename}, $file_local); - my $file_old = $filepart . "." . $oldmeta->{revision}; - transmitfile($oldmeta->{filehash}, { targetfile => $file_old }); - my $file_new = $filepart . "." . $meta->{revision}; - transmitfile($meta->{filehash}, { targetfile => $file_new }); - - # we need to merge with the local changes ( M=successful merge, C=conflict merge ) - $log->info("Merging $file_local, $file_old, $file_new"); - print "M Merging differences between $oldmeta->{revision} and $meta->{revision} into $filename\n"; - - $log->debug("Temporary directory for merge is $mergeDir"); - - my $return = system("git", "merge-file", $file_local, $file_old, $file_new); - $return >>= 8; - - cleanupTmpDir(); - - if ( $return == 0 ) - { - $log->info("Merged successfully"); - print "M M $filename\n"; - $log->debug("Merged $dirpart"); - - # Don't want to actually _DO_ the update if -n specified - unless ( $state->{globaloptions}{-n} ) - { - print "Merged $dirpart\n"; - $log->debug($state->{CVSROOT} . "/$state->{module}/$filename"); - print $state->{CVSROOT} . "/$state->{module}/$filename\n"; - my $kopts = kopts_from_path("$dirpart/$filepart", - "file",$mergedFile); - $log->debug("/$filepart/$meta->{revision}//$kopts/"); - my $entriesLine="/$filepart/$meta->{revision}//$kopts/"; - $entriesLine .= getStickyTagOrDate($stickyInfo); - print "$entriesLine\n"; - } - } - elsif ( $return == 1 ) - { - $log->info("Merged with conflicts"); - print "E cvs update: conflicts found in $filename\n"; - print "M C $filename\n"; - - # Don't want to actually _DO_ the update if -n specified - unless ( $state->{globaloptions}{-n} ) - { - print "Merged $dirpart\n"; - print $state->{CVSROOT} . "/$state->{module}/$filename\n"; - my $kopts = kopts_from_path("$dirpart/$filepart", - "file",$mergedFile); - my $entriesLine = "/$filepart/$meta->{revision}/+/$kopts/"; - $entriesLine .= getStickyTagOrDate($stickyInfo); - print "$entriesLine\n"; - } - } - else - { - $log->warn("Merge failed"); - next; - } - - # Don't want to actually _DO_ the update if -n specified - unless ( $state->{globaloptions}{-n} ) - { - # permissions - $log->debug("SEND : u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}"); - print "u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}\n"; - - # transmit file, format is single integer on a line by itself (file - # size) followed by the file contents - # TODO : we should copy files in blocks - my $data = safe_pipe_capture('cat', $mergedFile); - $log->debug("File size : " . length($data)); - print length($data) . "\n"; - print $data; - } - } - - } - - # prepDirForOutput() any other existing directories unless they already - # have the right sticky tag: - unless ( $state->{globaloptions}{n} ) - { - my $dir; - foreach $dir (keys(%{$state->{dirMap}})) - { - if( ! $seendirs{$dir} && - exists($state->{dirArgs}{$dir}) ) - { - my($oldTag); - $oldTag=$state->{dirMap}{$dir}{tagspec}; - - unless( ( exists($state->{opt}{A}) && - defined($oldTag) ) || - ( defined($state->{opt}{r}) && - ( !defined($oldTag) || - $state->{opt}{r} ne $oldTag ) ) ) - # TODO?: OR sticky dir is different... - { - next; - } - - prepDirForOutput( - $dir, - $repoDir, - ".", - \%seendirs, - 'update', - $state->{dirArgs} ); - } - - # TODO?: Consider sending a final duplicate Sticky response - # to more closely mimic real CVS. - } - } - - print "ok\n"; -} - -sub req_ci -{ - my ( $cmd, $data ) = @_; - - argsplit("ci"); - - #$log->debug("State : " . Dumper($state)); - - $log->info("req_ci : " . ( defined($data) ? $data : "[NULL]" )); - - if ( $state->{method} eq 'pserver' and $state->{user} eq 'anonymous' ) - { - print "error 1 anonymous user cannot commit via pserver\n"; - cleanupWorkTree(); - exit; - } - - if ( -e $state->{CVSROOT} . "/index" ) - { - $log->warn("file 'index' already exists in the git repository"); - print "error 1 Index already exists in git repo\n"; - cleanupWorkTree(); - exit; - } - - # Grab a handle to the SQLite db and do any necessary updates - my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); - $updater->update(); - - my @committedfiles = (); - my %oldmeta; - my $stickyInfo; - my $branchRef; - my $parenthash; - - # foreach file specified on the command line ... - foreach my $filename ( @{$state->{args}} ) - { - my $committedfile = $filename; - $filename = filecleanup($filename); - - next unless ( exists $state->{entries}{$filename}{modified_filename} or not $state->{entries}{$filename}{unchanged} ); - - ##### - # Figure out which branch and parenthash we are committing - # to, and setup worktree: - - # should always come from entries: - my $fileStickyInfo = resolveStickyInfo($filename); - if( !defined($branchRef) ) - { - $stickyInfo = $fileStickyInfo; - if( defined($stickyInfo) && - ( defined($stickyInfo->{date}) || - !defined($stickyInfo->{tag}) ) ) - { - print "error 1 cannot commit with sticky date for file `$filename'\n"; - cleanupWorkTree(); - exit; - } - - $branchRef = "refs/heads/$state->{module}"; - if ( defined($stickyInfo) && defined($stickyInfo->{tag}) ) - { - $branchRef = "refs/heads/$stickyInfo->{tag}"; - } - - $parenthash = safe_pipe_capture('git', 'show-ref', '-s', $branchRef); - chomp $parenthash; - if ($parenthash !~ /^[0-9a-f]{$state->{hexsz}}$/) - { - if ( defined($stickyInfo) && defined($stickyInfo->{tag}) ) - { - print "error 1 sticky tag `$stickyInfo->{tag}' for file `$filename' is not a branch\n"; - } - else - { - print "error 1 pserver cannot find the current HEAD of module"; - } - cleanupWorkTree(); - exit; - } - - setupWorkTree($parenthash); - - $log->info("Lockless commit start, basing commit on '$work->{workDir}', index file is '$work->{index}'"); - - $log->info("Created index '$work->{index}' for head $state->{module} - exit status $?"); - } - elsif( !refHashEqual($stickyInfo,$fileStickyInfo) ) - { - #TODO: We could split the cvs commit into multiple - # git commits by distinct stickyTag values, but that - # is lowish priority. - print "error 1 Committing different files to different" - . " branches is not currently supported\n"; - cleanupWorkTree(); - exit; - } - - ##### - # Process this file: - - my $meta = $updater->getmeta($filename,$stickyInfo); - $oldmeta{$filename} = $meta; - - my $wrev = revparse($filename); - - my ( $filepart, $dirpart ) = filenamesplit($filename); - - # do a checkout of the file if it is part of this tree - if ($wrev) { - system('git', 'checkout-index', '-f', '-u', $filename); - unless ($? == 0) { - die "Error running git-checkout-index -f -u $filename : $!"; - } - } - - my $addflag = 0; - my $rmflag = 0; - $rmflag = 1 if ( defined($wrev) and ($wrev=~/^-/) ); - $addflag = 1 unless ( -e $filename ); - - # Do up to date checking - unless ( $addflag or $wrev eq $meta->{revision} or - ( $rmflag and $wrev eq "-$meta->{revision}" ) ) - { - # fail everything if an up to date check fails - print "error 1 Up to date check failed for $filename\n"; - cleanupWorkTree(); - exit; - } - - push @committedfiles, $committedfile; - $log->info("Committing $filename"); - - system("mkdir","-p",$dirpart) unless ( -d $dirpart ); - - unless ( $rmflag ) - { - $log->debug("rename $state->{entries}{$filename}{modified_filename} $filename"); - rename $state->{entries}{$filename}{modified_filename},$filename; - - # Calculate modes to remove - my $invmode = ""; - foreach ( qw (r w x) ) { $invmode .= $_ unless ( $state->{entries}{$filename}{modified_mode} =~ /$_/ ); } - - $log->debug("chmod u+" . $state->{entries}{$filename}{modified_mode} . "-" . $invmode . " $filename"); - system("chmod","u+" . $state->{entries}{$filename}{modified_mode} . "-" . $invmode, $filename); - } - - if ( $rmflag ) - { - $log->info("Removing file '$filename'"); - unlink($filename); - system("git", "update-index", "--remove", $filename); - } - elsif ( $addflag ) - { - $log->info("Adding file '$filename'"); - system("git", "update-index", "--add", $filename); - } else { - $log->info("UpdatingX2 file '$filename'"); - system("git", "update-index", $filename); - } - } - - unless ( scalar(@committedfiles) > 0 ) - { - print "E No files to commit\n"; - print "ok\n"; - cleanupWorkTree(); - return; - } - - my $treehash = safe_pipe_capture(qw(git write-tree)); - chomp $treehash; - - $log->debug("Treehash : $treehash, Parenthash : $parenthash"); - - # write our commit message out if we have one ... - my ( $msg_fh, $msg_filename ) = tempfile( DIR => $TEMP_DIR ); - print $msg_fh $state->{opt}{m};# if ( exists ( $state->{opt}{m} ) ); - if ( defined ( $cfg->{gitcvs}{commitmsgannotation} ) ) { - if ($cfg->{gitcvs}{commitmsgannotation} !~ /^\s*$/ ) { - print $msg_fh "\n\n".$cfg->{gitcvs}{commitmsgannotation}."\n" - } - } else { - print $msg_fh "\n\nvia git-CVS emulator\n"; - } - close $msg_fh; - - my $commithash = safe_pipe_capture('git', 'commit-tree', $treehash, '-p', $parenthash, '-F', $msg_filename); - chomp($commithash); - $log->info("Commit hash : $commithash"); - - unless ( $commithash =~ /[a-zA-Z0-9]{$state->{hexsz}}/ ) - { - $log->warn("Commit failed (Invalid commit hash)"); - print "error 1 Commit failed (unknown reason)\n"; - cleanupWorkTree(); - exit; - } - - ### Emulate git-receive-pack by running hooks/update - my @hook = ( $ENV{GIT_DIR}.'hooks/update', $branchRef, - $parenthash, $commithash ); - if( -x $hook[0] ) { - unless( system( @hook ) == 0 ) - { - $log->warn("Commit failed (update hook declined to update ref)"); - print "error 1 Commit failed (update hook declined)\n"; - cleanupWorkTree(); - exit; - } - } - - ### Update the ref - if (system(qw(git update-ref -m), "cvsserver ci", - $branchRef, $commithash, $parenthash)) { - $log->warn("update-ref for $state->{module} failed."); - print "error 1 Cannot commit -- update first\n"; - cleanupWorkTree(); - exit; - } - - ### Emulate git-receive-pack by running hooks/post-receive - my $hook = $ENV{GIT_DIR}.'hooks/post-receive'; - if( -x $hook ) { - open(my $pipe, "| $hook") || die "can't fork $!"; - - local $SIG{PIPE} = sub { die 'pipe broke' }; - - print $pipe "$parenthash $commithash $branchRef\n"; - - close $pipe || die "bad pipe: $! $?"; - } - - $updater->update(); - - ### Then hooks/post-update - $hook = $ENV{GIT_DIR}.'hooks/post-update'; - if (-x $hook) { - system($hook, $branchRef); - } - - # foreach file specified on the command line ... - foreach my $filename ( @committedfiles ) - { - $filename = filecleanup($filename); - - my $meta = $updater->getmeta($filename,$stickyInfo); - unless (defined $meta->{revision}) { - $meta->{revision} = "1.1"; - } - - my ( $filepart, $dirpart ) = filenamesplit($filename, 1); - - $log->debug("Checked-in $dirpart : $filename"); - - print "M $state->{CVSROOT}/$state->{module}/$filename,v <-- $dirpart$filepart\n"; - if ( defined $meta->{filehash} && $meta->{filehash} eq "deleted" ) - { - print "M new revision: delete; previous revision: $oldmeta{$filename}{revision}\n"; - print "Remove-entry $dirpart\n"; - print "$filename\n"; - } else { - if ($meta->{revision} eq "1.1") { - print "M initial revision: 1.1\n"; - } else { - print "M new revision: $meta->{revision}; previous revision: $oldmeta{$filename}{revision}\n"; - } - print "Checked-in $dirpart\n"; - print "$filename\n"; - my $kopts = kopts_from_path($filename,"sha1",$meta->{filehash}); - print "/$filepart/$meta->{revision}//$kopts/" . - getStickyTagOrDate($stickyInfo) . "\n"; - } - } - - cleanupWorkTree(); - print "ok\n"; -} - -sub req_status -{ - my ( $cmd, $data ) = @_; - - argsplit("status"); - - $log->info("req_status : " . ( defined($data) ? $data : "[NULL]" )); - #$log->debug("status state : " . Dumper($state)); - - # Grab a handle to the SQLite db and do any necessary updates - my $updater; - $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); - $updater->update(); - - # if no files were specified, we need to work out what files we should - # be providing status on ... - argsfromdir($updater); - - # foreach file specified on the command line ... - foreach my $filename ( @{$state->{args}} ) - { - $filename = filecleanup($filename); - - if ( exists($state->{opt}{l}) && - index($filename, '/', length($state->{prependdir})) >= 0 ) - { - next; - } - - my $wrev = revparse($filename); - - my $stickyInfo = resolveStickyInfo($filename); - my $meta = $updater->getmeta($filename,$stickyInfo); - my $oldmeta = $meta; - - # If the working copy is an old revision, lets get that - # version too for comparison. - if ( defined($wrev) and $wrev ne $meta->{revision} ) - { - my($rmRev)=$wrev; - $rmRev=~s/^-//; - $oldmeta = $updater->getmeta($filename, $rmRev); - } - - # TODO : All possible statuses aren't yet implemented - my $status; - # Files are up to date if the working copy and repo copy have - # the same revision, and the working copy is unmodified - if ( defined ( $wrev ) and defined($meta->{revision}) and - $wrev eq $meta->{revision} and - ( ( $state->{entries}{$filename}{unchanged} and - ( not defined ( $state->{entries}{$filename}{conflict} ) or - $state->{entries}{$filename}{conflict} !~ /^\+=/ ) ) or - ( defined($state->{entries}{$filename}{modified_hash}) and - $state->{entries}{$filename}{modified_hash} eq - $meta->{filehash} ) ) ) - { - $status = "Up-to-date" - } - - # Need checkout if the working copy has a different (usually - # older) revision than the repo copy, and the working copy is - # unmodified - if ( defined ( $wrev ) and defined ( $meta->{revision} ) and - $meta->{revision} ne $wrev and - ( $state->{entries}{$filename}{unchanged} or - ( defined($state->{entries}{$filename}{modified_hash}) and - $state->{entries}{$filename}{modified_hash} eq - $oldmeta->{filehash} ) ) ) - { - $status ||= "Needs Checkout"; - } - - # Need checkout if it exists in the repo but doesn't have a working - # copy - if ( not defined ( $wrev ) and defined ( $meta->{revision} ) ) - { - $status ||= "Needs Checkout"; - } - - # Locally modified if working copy and repo copy have the - # same revision but there are local changes - if ( defined ( $wrev ) and defined($meta->{revision}) and - $wrev eq $meta->{revision} and - $wrev ne "0" and - $state->{entries}{$filename}{modified_filename} ) - { - $status ||= "Locally Modified"; - } - - # Needs Merge if working copy revision is different - # (usually older) than repo copy and there are local changes - if ( defined ( $wrev ) and defined ( $meta->{revision} ) and - $meta->{revision} ne $wrev and - $state->{entries}{$filename}{modified_filename} ) - { - $status ||= "Needs Merge"; - } - - if ( defined ( $state->{entries}{$filename}{revision} ) and - ( !defined($meta->{revision}) || - $meta->{revision} eq "0" ) ) - { - $status ||= "Locally Added"; - } - if ( defined ( $wrev ) and defined ( $meta->{revision} ) and - $wrev eq "-$meta->{revision}" ) - { - $status ||= "Locally Removed"; - } - if ( defined ( $state->{entries}{$filename}{conflict} ) and - $state->{entries}{$filename}{conflict} =~ /^\+=/ ) - { - $status ||= "Unresolved Conflict"; - } - if ( 0 ) - { - $status ||= "File had conflicts on merge"; - } - - $status ||= "Unknown"; - - my ($filepart) = filenamesplit($filename); - - print "M =======" . ( "=" x 60 ) . "\n"; - print "M File: $filepart\tStatus: $status\n"; - if ( defined($state->{entries}{$filename}{revision}) ) - { - print "M Working revision:\t" . - $state->{entries}{$filename}{revision} . "\n"; - } else { - print "M Working revision:\tNo entry for $filename\n"; - } - if ( defined($meta->{revision}) ) - { - print "M Repository revision:\t" . - $meta->{revision} . - "\t$state->{CVSROOT}/$state->{module}/$filename,v\n"; - my($tagOrDate)=$state->{entries}{$filename}{tag_or_date}; - my($tag)=($tagOrDate=~m/^T(.+)$/); - if( !defined($tag) ) - { - $tag="(none)"; - } - print "M Sticky Tag:\t\t$tag\n"; - my($date)=($tagOrDate=~m/^D(.+)$/); - if( !defined($date) ) - { - $date="(none)"; - } - print "M Sticky Date:\t\t$date\n"; - my($options)=$state->{entries}{$filename}{options}; - if( $options eq "" ) - { - $options="(none)"; - } - print "M Sticky Options:\t\t$options\n"; - } else { - print "M Repository revision:\tNo revision control file\n"; - } - print "M\n"; - } - - print "ok\n"; -} - -sub req_diff -{ - my ( $cmd, $data ) = @_; - - argsplit("diff"); - - $log->debug("req_diff : " . ( defined($data) ? $data : "[NULL]" )); - #$log->debug("status state : " . Dumper($state)); - - my ($revision1, $revision2); - if ( defined ( $state->{opt}{r} ) and ref $state->{opt}{r} eq "ARRAY" ) - { - $revision1 = $state->{opt}{r}[0]; - $revision2 = $state->{opt}{r}[1]; - } else { - $revision1 = $state->{opt}{r}; - } - - $log->debug("Diffing revisions " . - ( defined($revision1) ? $revision1 : "[NULL]" ) . - " and " . ( defined($revision2) ? $revision2 : "[NULL]" ) ); - - # Grab a handle to the SQLite db and do any necessary updates - my $updater; - $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); - $updater->update(); - - # if no files were specified, we need to work out what files we should - # be providing status on ... - argsfromdir($updater); - - my($foundDiff); - - # foreach file specified on the command line ... - foreach my $argFilename ( @{$state->{args}} ) - { - my($filename) = filecleanup($argFilename); - - my ( $fh, $file1, $file2, $meta1, $meta2, $filediff ); - - my $wrev = revparse($filename); - - # Priority for revision1: - # 1. First -r (missing file: check -N) - # 2. wrev from client's Entry line - # - missing line/file: check -N - # - "0": added file not committed (empty contents for rev1) - # - Prefixed with dash (to be removed): check -N - - if ( defined ( $revision1 ) ) - { - $meta1 = $updater->getmeta($filename, $revision1); - } - elsif( defined($wrev) && $wrev ne "0" ) - { - my($rmRev)=$wrev; - $rmRev=~s/^-//; - $meta1 = $updater->getmeta($filename, $rmRev); - } - if ( !defined($meta1) || - $meta1->{filehash} eq "deleted" ) - { - if( !exists($state->{opt}{N}) ) - { - if(!defined($revision1)) - { - print "E File $filename at revision $revision1 doesn't exist\n"; - } - next; - } - elsif( !defined($meta1) ) - { - $meta1 = { - name => $filename, - revision => '0', - filehash => 'deleted' - }; - } - } - - # Priority for revision2: - # 1. Second -r (missing file: check -N) - # 2. Modified file contents from client - # 3. wrev from client's Entry line - # - missing line/file: check -N - # - Prefixed with dash (to be removed): check -N - - # if we have a second -r switch, use it too - if ( defined ( $revision2 ) ) - { - $meta2 = $updater->getmeta($filename, $revision2); - } - elsif(defined($state->{entries}{$filename}{modified_filename})) - { - $file2 = $state->{entries}{$filename}{modified_filename}; - $meta2 = { - name => $filename, - revision => '0', - filehash => 'modified' - }; - } - elsif( defined($wrev) && ($wrev!~/^-/) ) - { - if(!defined($revision1)) # no revision and no modifications: - { - next; - } - $meta2 = $updater->getmeta($filename, $wrev); - } - if(!defined($file2)) - { - if ( !defined($meta2) || - $meta2->{filehash} eq "deleted" ) - { - if( !exists($state->{opt}{N}) ) - { - if(!defined($revision2)) - { - print "E File $filename at revision $revision2 doesn't exist\n"; - } - next; - } - elsif( !defined($meta2) ) - { - $meta2 = { - name => $filename, - revision => '0', - filehash => 'deleted' - }; - } - } - } - - if( $meta1->{filehash} eq $meta2->{filehash} ) - { - $log->info("unchanged $filename"); - next; - } - - # Retrieve revision contents: - ( undef, $file1 ) = tempfile( DIR => $TEMP_DIR, OPEN => 0 ); - transmitfile($meta1->{filehash}, { targetfile => $file1 }); - - if(!defined($file2)) - { - ( undef, $file2 ) = tempfile( DIR => $TEMP_DIR, OPEN => 0 ); - transmitfile($meta2->{filehash}, { targetfile => $file2 }); - } - - # Generate the actual diff: - print "M Index: $argFilename\n"; - print "M =======" . ( "=" x 60 ) . "\n"; - print "M RCS file: $state->{CVSROOT}/$state->{module}/$filename,v\n"; - if ( defined ( $meta1 ) && $meta1->{revision} ne "0" ) - { - print "M retrieving revision $meta1->{revision}\n" - } - if ( defined ( $meta2 ) && $meta2->{revision} ne "0" ) - { - print "M retrieving revision $meta2->{revision}\n" - } - print "M diff "; - foreach my $opt ( sort keys %{$state->{opt}} ) - { - if ( ref $state->{opt}{$opt} eq "ARRAY" ) - { - foreach my $value ( @{$state->{opt}{$opt}} ) - { - print "-$opt $value "; - } - } else { - print "-$opt "; - if ( defined ( $state->{opt}{$opt} ) ) - { - print "$state->{opt}{$opt} " - } - } - } - print "$argFilename\n"; - - $log->info("Diffing $filename -r $meta1->{revision} -r " . - ( $meta2->{revision} or "workingcopy" )); - - # TODO: Use --label instead of -L because -L is no longer - # documented and may go away someday. Not sure if there there are - # versions that only support -L, which would make this change risky? - # http://osdir.com/ml/bug-gnu-utils-gnu/2010-12/msg00060.html - # ("man diff" should actually document the best migration strategy, - # [current behavior, future changes, old compatibility issues - # or lack thereof, etc], not just stop mentioning the option...) - # TODO: Real CVS seems to include a date in the label, before - # the revision part, without the keyword "revision". The following - # has minimal changes compared to original versions of - # git-cvsserver.perl. (Mostly tab vs space after filename.) - - my (@diffCmd) = ( 'diff' ); - if ( exists($state->{opt}{N}) ) - { - push @diffCmd,"-N"; - } - if ( exists $state->{opt}{u} ) - { - push @diffCmd,("-u","-L"); - if( $meta1->{filehash} eq "deleted" ) - { - push @diffCmd,"/dev/null"; - } else { - push @diffCmd,("$argFilename\trevision $meta1->{revision}"); - } - - if( defined($meta2->{filehash}) ) - { - if( $meta2->{filehash} eq "deleted" ) - { - push @diffCmd,("-L","/dev/null"); - } else { - push @diffCmd,("-L", - "$argFilename\trevision $meta2->{revision}"); - } - } else { - push @diffCmd,("-L","$argFilename\tworking copy"); - } - } - push @diffCmd,($file1,$file2); - if(!open(DIFF,"-|",@diffCmd)) - { - $log->warn("Unable to run diff: $!"); - } - my($diffLine); - while(defined($diffLine=)) - { - print "M $diffLine"; - $foundDiff=1; - } - close(DIFF); - } - - if($foundDiff) - { - print "error \n"; - } - else - { - print "ok\n"; - } -} - -sub req_log -{ - my ( $cmd, $data ) = @_; - - argsplit("log"); - - $log->debug("req_log : " . ( defined($data) ? $data : "[NULL]" )); - #$log->debug("log state : " . Dumper($state)); - - my ( $revFilter ); - if ( defined ( $state->{opt}{r} ) ) - { - $revFilter = $state->{opt}{r}; - } - - # Grab a handle to the SQLite db and do any necessary updates - my $updater; - $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); - $updater->update(); - - # if no files were specified, we need to work out what files we - # should be providing status on ... - argsfromdir($updater); - - # foreach file specified on the command line ... - foreach my $filename ( @{$state->{args}} ) - { - $filename = filecleanup($filename); - - my $headmeta = $updater->getmeta($filename); - - my ($revisions,$totalrevisions) = $updater->getlog($filename, - $revFilter); - - next unless ( scalar(@$revisions) ); - - print "M \n"; - print "M RCS file: $state->{CVSROOT}/$state->{module}/$filename,v\n"; - print "M Working file: $filename\n"; - print "M head: $headmeta->{revision}\n"; - print "M branch:\n"; - print "M locks: strict\n"; - print "M access list:\n"; - print "M symbolic names:\n"; - print "M keyword substitution: kv\n"; - print "M total revisions: $totalrevisions;\tselected revisions: " . - scalar(@$revisions) . "\n"; - print "M description:\n"; - - foreach my $revision ( @$revisions ) - { - print "M ----------------------------\n"; - print "M revision $revision->{revision}\n"; - # reformat the date for log output - if ( $revision->{modified} =~ /(\d+)\s+(\w+)\s+(\d+)\s+(\S+)/ and - defined($DATE_LIST->{$2}) ) - { - $revision->{modified} = sprintf('%04d/%02d/%02d %s', - $3, $DATE_LIST->{$2}, $1, $4 ); - } - $revision->{author} = cvs_author($revision->{author}); - print "M date: $revision->{modified};" . - " author: $revision->{author}; state: " . - ( $revision->{filehash} eq "deleted" ? "dead" : "Exp" ) . - "; lines: +2 -3\n"; - my $commitmessage; - $commitmessage = $updater->commitmessage($revision->{commithash}); - $commitmessage =~ s/^/M /mg; - print $commitmessage . "\n"; - } - print "M =======" . ( "=" x 70 ) . "\n"; - } - - print "ok\n"; -} - -sub req_annotate -{ - my ( $cmd, $data ) = @_; - - argsplit("annotate"); - - $log->info("req_annotate : " . ( defined($data) ? $data : "[NULL]" )); - #$log->debug("status state : " . Dumper($state)); - - # Grab a handle to the SQLite db and do any necessary updates - my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); - $updater->update(); - - # if no files were specified, we need to work out what files we should be providing annotate on ... - argsfromdir($updater); - - # we'll need a temporary checkout dir - setupWorkTree(); - - $log->info("Temp checkoutdir creation successful, basing annotate session work on '$work->{workDir}', index file is '$ENV{GIT_INDEX_FILE}'"); - - # foreach file specified on the command line ... - foreach my $filename ( @{$state->{args}} ) - { - $filename = filecleanup($filename); - - my $meta = $updater->getmeta($filename); - - next unless ( $meta->{revision} ); - - # get all the commits that this file was in - # in dense format -- aka skip dead revisions - my $revisions = $updater->gethistorydense($filename); - my $lastseenin = $revisions->[0][2]; - - # populate the temporary index based on the latest commit were we saw - # the file -- but do it cheaply without checking out any files - # TODO: if we got a revision from the client, use that instead - # to look up the commithash in sqlite (still good to default to - # the current head as we do now) - system("git", "read-tree", $lastseenin); - unless ($? == 0) - { - print "E error running git-read-tree $lastseenin $ENV{GIT_INDEX_FILE} $!\n"; - return; - } - $log->info("Created index '$ENV{GIT_INDEX_FILE}' with commit $lastseenin - exit status $?"); - - # do a checkout of the file - system('git', 'checkout-index', '-f', '-u', $filename); - unless ($? == 0) { - print "E error running git-checkout-index -f -u $filename : $!\n"; - return; - } - - $log->info("Annotate $filename"); - - # Prepare a file with the commits from the linearized - # history that annotate should know about. This prevents - # git-jsannotate telling us about commits we are hiding - # from the client. - - my $a_hints = "$work->{workDir}/.annotate_hints"; - if (!open(ANNOTATEHINTS, '>', $a_hints)) { - print "E failed to open '$a_hints' for writing: $!\n"; - return; - } - for (my $i=0; $i < @$revisions; $i++) - { - print ANNOTATEHINTS $revisions->[$i][2]; - if ($i+1 < @$revisions) { # have we got a parent? - print ANNOTATEHINTS ' ' . $revisions->[$i+1][2]; - } - print ANNOTATEHINTS "\n"; - } - - print ANNOTATEHINTS "\n"; - close ANNOTATEHINTS - or (print "E failed to write $a_hints: $!\n"), return; - - my @cmd = (qw(git annotate -l -S), $a_hints, $filename); - if (!open(ANNOTATE, "-|", @cmd)) { - print "E error invoking ". join(' ',@cmd) .": $!\n"; - return; - } - my $metadata = {}; - print "E Annotations for $filename\n"; - print "E ***************\n"; - while ( ) - { - if (m/^([a-zA-Z0-9]{$state->{hexsz}})\t\([^\)]*\)(.*)$/i) - { - my $commithash = $1; - my $data = $2; - unless ( defined ( $metadata->{$commithash} ) ) - { - $metadata->{$commithash} = $updater->getmeta($filename, $commithash); - $metadata->{$commithash}{author} = cvs_author($metadata->{$commithash}{author}); - $metadata->{$commithash}{modified} = sprintf("%02d-%s-%02d", $1, $2, $3) if ( $metadata->{$commithash}{modified} =~ /^(\d+)\s(\w+)\s\d\d(\d\d)/ ); - } - printf("M %-7s (%-8s %10s): %s\n", - $metadata->{$commithash}{revision}, - $metadata->{$commithash}{author}, - $metadata->{$commithash}{modified}, - $data - ); - } else { - $log->warn("Error in annotate output! LINE: $_"); - print "E Annotate error \n"; - next; - } - } - close ANNOTATE; - } - - # done; get out of the tempdir - cleanupWorkTree(); - - print "ok\n"; - -} - -# This method takes the state->{arguments} array and produces two new arrays. -# The first is $state->{args} which is everything before the '--' argument, and -# the second is $state->{files} which is everything after it. -sub argsplit -{ - $state->{args} = []; - $state->{files} = []; - $state->{opt} = {}; - - return unless( defined($state->{arguments}) and ref $state->{arguments} eq "ARRAY" ); - - my $type = shift; - - if ( defined($type) ) - { - my $opt = {}; - $opt = { A => 0, N => 0, P => 0, R => 0, c => 0, f => 0, l => 0, n => 0, p => 0, s => 0, r => 1, D => 1, d => 1, k => 1, j => 1, } if ( $type eq "co" ); - $opt = { v => 0, l => 0, R => 0 } if ( $type eq "status" ); - $opt = { A => 0, P => 0, C => 0, d => 0, f => 0, l => 0, R => 0, p => 0, k => 1, r => 1, D => 1, j => 1, I => 1, W => 1 } if ( $type eq "update" ); - $opt = { l => 0, R => 0, k => 1, D => 1, D => 1, r => 2, N => 0 } if ( $type eq "diff" ); - $opt = { c => 0, R => 0, l => 0, f => 0, F => 1, m => 1, r => 1 } if ( $type eq "ci" ); - $opt = { k => 1, m => 1 } if ( $type eq "add" ); - $opt = { f => 0, l => 0, R => 0 } if ( $type eq "remove" ); - $opt = { l => 0, b => 0, h => 0, R => 0, t => 0, N => 0, S => 0, r => 1, d => 1, s => 1, w => 1 } if ( $type eq "log" ); - - - while ( scalar ( @{$state->{arguments}} ) > 0 ) - { - my $arg = shift @{$state->{arguments}}; - - next if ( $arg eq "--" ); - next unless ( $arg =~ /\S/ ); - - # if the argument looks like a switch - if ( $arg =~ /^-(\w)(.*)/ ) - { - # if it's a switch that takes an argument - if ( $opt->{$1} ) - { - # If this switch has already been provided - if ( $opt->{$1} > 1 and exists ( $state->{opt}{$1} ) ) - { - $state->{opt}{$1} = [ $state->{opt}{$1} ]; - if ( length($2) > 0 ) - { - push @{$state->{opt}{$1}},$2; - } else { - push @{$state->{opt}{$1}}, shift @{$state->{arguments}}; - } - } else { - # if there's extra data in the arg, use that as the argument for the switch - if ( length($2) > 0 ) - { - $state->{opt}{$1} = $2; - } else { - $state->{opt}{$1} = shift @{$state->{arguments}}; - } - } - } else { - $state->{opt}{$1} = undef; - } - } - else - { - push @{$state->{args}}, $arg; - } - } - } - else - { - my $mode = 0; - - foreach my $value ( @{$state->{arguments}} ) - { - if ( $value eq "--" ) - { - $mode++; - next; - } - push @{$state->{args}}, $value if ( $mode == 0 ); - push @{$state->{files}}, $value if ( $mode == 1 ); - } - } -} - -# Used by argsfromdir -sub expandArg -{ - my ($updater,$outNameMap,$outDirMap,$path,$isDir) = @_; - - my $fullPath = filecleanup($path); - - # Is it a directory? - if( defined($state->{dirMap}{$fullPath}) || - defined($state->{dirMap}{"$fullPath/"}) ) - { - # It is a directory in the user's sandbox. - $isDir=1; - - if(defined($state->{entries}{$fullPath})) - { - $log->fatal("Inconsistent file/dir type"); - die "Inconsistent file/dir type"; - } - } - elsif(defined($state->{entries}{$fullPath})) - { - # It is a file in the user's sandbox. - $isDir=0; - } - my($revDirMap,$otherRevDirMap); - if(!defined($isDir) || $isDir) - { - # Resolve version tree for sticky tag: - # (for now we only want list of files for the version, not - # particular versions of those files: assume it is a directory - # for the moment; ignore Entry's stick tag) - - # Order of precedence of sticky tags: - # -A [head] - # -r /tag/ - # [file entry sticky tag, but that is only relevant to files] - # [the tag specified in dir req_Sticky] - # [the tag specified in a parent dir req_Sticky] - # [head] - # Also, -r may appear twice (for diff). - # - # FUTURE: When/if -j (merges) are supported, we also - # need to add relevant files from one or two - # versions specified with -j. - - if(exists($state->{opt}{A})) - { - $revDirMap=$updater->getRevisionDirMap(); - } - elsif( defined($state->{opt}{r}) and - ref $state->{opt}{r} eq "ARRAY" ) - { - $revDirMap=$updater->getRevisionDirMap($state->{opt}{r}[0]); - $otherRevDirMap=$updater->getRevisionDirMap($state->{opt}{r}[1]); - } - elsif(defined($state->{opt}{r})) - { - $revDirMap=$updater->getRevisionDirMap($state->{opt}{r}); - } - else - { - my($sticky)=getDirStickyInfo($fullPath); - $revDirMap=$updater->getRevisionDirMap($sticky->{tag}); - } - - # Is it a directory? - if( defined($revDirMap->{$fullPath}) || - defined($otherRevDirMap->{$fullPath}) ) - { - $isDir=1; - } - } - - # What to do with it? - if(!$isDir) - { - $outNameMap->{$fullPath}=1; - } - else - { - $outDirMap->{$fullPath}=1; - - if(defined($revDirMap->{$fullPath})) - { - addDirMapFiles($updater,$outNameMap,$outDirMap, - $revDirMap->{$fullPath}); - } - if( defined($otherRevDirMap) && - defined($otherRevDirMap->{$fullPath}) ) - { - addDirMapFiles($updater,$outNameMap,$outDirMap, - $otherRevDirMap->{$fullPath}); - } - } -} - -# Used by argsfromdir -# Add entries from dirMap to outNameMap. Also recurse into entries -# that are subdirectories. -sub addDirMapFiles -{ - my($updater,$outNameMap,$outDirMap,$dirMap)=@_; - - my($fullName); - foreach $fullName (keys(%$dirMap)) - { - my $cleanName=$fullName; - if(defined($state->{prependdir})) - { - if(!($cleanName=~s/^\Q$state->{prependdir}\E//)) - { - $log->fatal("internal error stripping prependdir"); - die "internal error stripping prependdir"; - } - } - - if($dirMap->{$fullName} eq "F") - { - $outNameMap->{$cleanName}=1; - } - elsif($dirMap->{$fullName} eq "D") - { - if(!$state->{opt}{l}) - { - expandArg($updater,$outNameMap,$outDirMap,$cleanName,1); - } - } - else - { - $log->fatal("internal error in addDirMapFiles"); - die "internal error in addDirMapFiles"; - } - } -} - -# This method replaces $state->{args} with a directory-expanded -# list of all relevant filenames (recursively unless -d), based -# on $state->{entries}, and the "current" list of files in -# each directory. "Current" files as determined by -# either the requested (-r/-A) or "req_Sticky" version of -# that directory. -# Both the input args and the new output args are relative -# to the cvs-client's CWD, although some of the internal -# computations are relative to the top of the project. -sub argsfromdir -{ - my $updater = shift; - - # Notes about requirements for specific callers: - # update # "standard" case (entries; a single -r/-A/default; -l) - # # Special case: -d for create missing directories. - # diff # 0 or 1 -r's: "standard" case. - # # 2 -r's: We could ignore entries (just use the two -r's), - # # but it doesn't really matter. - # annotate # "standard" case - # log # Punting: log -r has a more complex non-"standard" - # # meaning, and we don't currently try to support log'ing - # # branches at all (need a lot of work to - # # support CVS-consistent branch relative version - # # numbering). -#HERE: But we still want to expand directories. Maybe we should -# essentially force "-A". - # status # "standard", except that -r/-A/default are not possible. - # # Mostly only used to expand entries only) - # - # Don't use argsfromdir at all: - # add # Explicit arguments required. Directory args imply add - # # the directory itself, not the files in it. - # co # Obtain list directly. - # remove # HERE: TEST: MAYBE client does the recursion for us, - # # since it only makes sense to remove stuff already in - # # the sandbox? - # ci # HERE: Similar to remove... - # # Don't try to implement the confusing/weird - # # ci -r bug er.."feature". - - if(scalar(@{$state->{args}})==0) - { - $state->{args} = [ "." ]; - } - my %allArgs; - my %allDirs; - for my $file (@{$state->{args}}) - { - expandArg($updater,\%allArgs,\%allDirs,$file); - } - - # Include any entries from sandbox. Generally client won't - # send entries that shouldn't be used. - foreach my $file (keys %{$state->{entries}}) - { - $allArgs{remove_prependdir($file)} = 1; - } - - $state->{dirArgs} = \%allDirs; - $state->{args} = [ - sort { - # Sort priority: by directory depth, then actual file name: - my @piecesA=split('/',$a); - my @piecesB=split('/',$b); - - my $count=scalar(@piecesA); - my $tmp=scalar(@piecesB); - return $count<=>$tmp if($count!=$tmp); - - for($tmp=0;$tmp<$count;$tmp++) - { - if($piecesA[$tmp] ne $piecesB[$tmp]) - { - return $piecesA[$tmp] cmp $piecesB[$tmp] - } - } - return 0; - } keys(%allArgs) ]; -} - -## look up directory sticky tag, of either fullPath or a parent: -sub getDirStickyInfo -{ - my($fullPath)=@_; - - $fullPath=~s%/+$%%; - while($fullPath ne "" && !defined($state->{dirMap}{"$fullPath/"})) - { - $fullPath=~s%/?[^/]*$%%; - } - - if( !defined($state->{dirMap}{"$fullPath/"}) && - ( $fullPath eq "" || - $fullPath eq "." ) ) - { - return $state->{dirMap}{""}{stickyInfo}; - } - else - { - return $state->{dirMap}{"$fullPath/"}{stickyInfo}; - } -} - -# Resolve precedence of various ways of specifying which version of -# a file you want. Returns undef (for default head), or a ref to a hash -# that contains "tag" and/or "date" keys. -sub resolveStickyInfo -{ - my($filename,$stickyTag,$stickyDate,$reset) = @_; - - # Order of precedence of sticky tags: - # -A [head] - # -r /tag/ - # [file entry sticky tag] - # [the tag specified in dir req_Sticky] - # [the tag specified in a parent dir req_Sticky] - # [head] - - my $result; - if($reset) - { - # $result=undef; - } - elsif( defined($stickyTag) && $stickyTag ne "" ) - # || ( defined($stickyDate) && $stickyDate ne "" ) # TODO - { - $result={ 'tag' => (defined($stickyTag)?$stickyTag:undef) }; - - # TODO: Convert -D value into the form 2011.04.10.04.46.57, - # similar to an entry line's sticky date, without the D prefix. - # It sometimes (always?) arrives as something more like - # '10 Apr 2011 04:46:57 -0000'... - # $result={ 'date' => (defined($stickyDate)?$stickyDate:undef) }; - } - elsif( defined($state->{entries}{$filename}) && - defined($state->{entries}{$filename}{tag_or_date}) && - $state->{entries}{$filename}{tag_or_date} ne "" ) - { - my($tagOrDate)=$state->{entries}{$filename}{tag_or_date}; - if($tagOrDate=~/^T([^ ]+)\s*$/) - { - $result = { 'tag' => $1 }; - } - elsif($tagOrDate=~/^D([0-9.]+)\s*$/) - { - $result= { 'date' => $1 }; - } - else - { - die "Unknown tag_or_date format\n"; - } - } - else - { - $result=getDirStickyInfo($filename); - } - - return $result; -} - -# Convert a stickyInfo (ref to a hash) as returned by resolveStickyInfo into -# a form appropriate for the sticky tag field of an Entries -# line (field index 5, 0-based). -sub getStickyTagOrDate -{ - my($stickyInfo)=@_; - - my $result; - if(defined($stickyInfo) && defined($stickyInfo->{tag})) - { - $result="T$stickyInfo->{tag}"; - } - # TODO: When/if we actually pick versions by {date} properly, - # also handle it here: - # "D$stickyInfo->{date}" (example: "D2011.04.13.20.37.07"). - else - { - $result=""; - } - - return $result; -} - -# This method cleans up the $state variable after a command that uses arguments has run -sub statecleanup -{ - $state->{files} = []; - $state->{dirArgs} = {}; - $state->{args} = []; - $state->{arguments} = []; - $state->{entries} = {}; - $state->{dirMap} = {}; -} - -# Return working directory CVS revision "1.X" out -# of the working directory "entries" state, for the given filename. -# This is prefixed with a dash if the file is scheduled for removal -# when it is committed. -sub revparse -{ - my $filename = shift; - - return $state->{entries}{$filename}{revision}; -} - -# This method takes a file hash and does a CVS "file transfer". Its -# exact behaviour depends on a second, optional hash table argument: -# - If $options->{targetfile}, dump the contents to that file; -# - If $options->{print}, use M/MT to transmit the contents one line -# at a time; -# - Otherwise, transmit the size of the file, followed by the file -# contents. -sub transmitfile -{ - my $filehash = shift; - my $options = shift; - - if ( defined ( $filehash ) and $filehash eq "deleted" ) - { - $log->warn("filehash is 'deleted'"); - return; - } - - die "Need filehash" unless ( defined ( $filehash ) and $filehash =~ /^[a-zA-Z0-9]{$state->{hexsz}}$/ ); - - my $type = safe_pipe_capture('git', 'cat-file', '-t', $filehash); - chomp $type; - - die ( "Invalid type '$type' (expected 'blob')" ) unless ( defined ( $type ) and $type eq "blob" ); - - my $size = safe_pipe_capture('git', 'cat-file', '-s', $filehash); - chomp $size; - - $log->debug("transmitfile($filehash) size=$size, type=$type"); - - if ( open my $fh, '-|', "git", "cat-file", "blob", $filehash ) - { - if ( defined ( $options->{targetfile} ) ) - { - my $targetfile = $options->{targetfile}; - open NEWFILE, ">", $targetfile or die("Couldn't open '$targetfile' for writing : $!"); - print NEWFILE $_ while ( <$fh> ); - close NEWFILE or die("Failed to write '$targetfile': $!"); - } elsif ( defined ( $options->{print} ) && $options->{print} ) { - while ( <$fh> ) { - if( /\n\z/ ) { - print 'M ', $_; - } else { - print 'MT text ', $_, "\n"; - } - } - } else { - print "$size\n"; - print while ( <$fh> ); - } - close $fh or die ("Couldn't close filehandle for transmitfile(): $!"); - } else { - die("Couldn't execute git-cat-file"); - } -} - -# This method takes a file name, and returns ( $dirpart, $filepart ) which -# refers to the directory portion and the file portion of the filename -# respectively -sub filenamesplit -{ - my $filename = shift; - my $fixforlocaldir = shift; - - my ( $filepart, $dirpart ) = ( $filename, "." ); - ( $filepart, $dirpart ) = ( $2, $1 ) if ( $filename =~ /(.*)\/(.*)/ ); - $dirpart .= "/"; - - if ( $fixforlocaldir ) - { - $dirpart =~ s/^$state->{prependdir}//; - } - - return ( $filepart, $dirpart ); -} - -# Cleanup various junk in filename (try to canonicalize it), and -# add prependdir to accommodate running CVS client from a -# subdirectory (so the output is relative to top directory of the project). -sub filecleanup -{ - my $filename = shift; - - return undef unless(defined($filename)); - if ( $filename =~ /^\// ) - { - print "E absolute filenames '$filename' not supported by server\n"; - return undef; - } - - if($filename eq ".") - { - $filename=""; - } - $filename =~ s/^\.\///g; - $filename =~ s%/+%/%g; - $filename = $state->{prependdir} . $filename; - $filename =~ s%/$%%; - return $filename; -} - -# Remove prependdir from the path, so that it is relative to the directory -# the CVS client was started from, rather than the top of the project. -# Essentially the inverse of filecleanup(). -sub remove_prependdir -{ - my($path) = @_; - if(defined($state->{prependdir}) && $state->{prependdir} ne "") - { - my($pre)=$state->{prependdir}; - $pre=~s%/$%%; - if(!($path=~s%^\Q$pre\E/?%%)) - { - $log->fatal("internal error missing prependdir"); - die("internal error missing prependdir"); - } - } - return $path; -} - -sub validateGitDir -{ - if( !defined($state->{CVSROOT}) ) - { - print "error 1 CVSROOT not specified\n"; - cleanupWorkTree(); - exit; - } - if( $ENV{GIT_DIR} ne ($state->{CVSROOT} . '/') ) - { - print "error 1 Internally inconsistent CVSROOT\n"; - cleanupWorkTree(); - exit; - } -} - -# Setup working directory in a work tree with the requested version -# loaded in the index. -sub setupWorkTree -{ - my ($ver) = @_; - - validateGitDir(); - - if( ( defined($work->{state}) && $work->{state} != 1 ) || - defined($work->{tmpDir}) ) - { - $log->warn("Bad work tree state management"); - print "error 1 Internal setup multiple work trees without cleanup\n"; - cleanupWorkTree(); - exit; - } - - $work->{workDir} = tempdir ( DIR => $TEMP_DIR ); - - if( !defined($work->{index}) ) - { - (undef, $work->{index}) = tempfile ( DIR => $TEMP_DIR, OPEN => 0 ); - } - - chdir $work->{workDir} or - die "Unable to chdir to $work->{workDir}\n"; - - $log->info("Setting up GIT_WORK_TREE as '.' in '$work->{workDir}', index file is '$work->{index}'"); - - $ENV{GIT_WORK_TREE} = "."; - $ENV{GIT_INDEX_FILE} = $work->{index}; - $work->{state} = 2; - - if($ver) - { - system("git","read-tree",$ver); - unless ($? == 0) - { - $log->warn("Error running git-read-tree"); - die "Error running git-read-tree $ver in $work->{workDir} $!\n"; - } - } - # else # req_annotate reads tree for each file -} - -# Ensure current directory is in some kind of working directory, -# with a recent version loaded in the index. -sub ensureWorkTree -{ - if( defined($work->{tmpDir}) ) - { - $log->warn("Bad work tree state management [ensureWorkTree()]"); - print "error 1 Internal setup multiple dirs without cleanup\n"; - cleanupWorkTree(); - exit; - } - if( $work->{state} ) - { - return; - } - - validateGitDir(); - - if( !defined($work->{emptyDir}) ) - { - $work->{emptyDir} = tempdir ( DIR => $TEMP_DIR, OPEN => 0); - } - chdir $work->{emptyDir} or - die "Unable to chdir to $work->{emptyDir}\n"; - - my $ver = safe_pipe_capture('git', 'show-ref', '-s', "refs/heads/$state->{module}"); - chomp $ver; - if ($ver !~ /^[0-9a-f]{$state->{hexsz}}$/) - { - $log->warn("Error from git show-ref -s refs/head$state->{module}"); - print "error 1 cannot find the current HEAD of module"; - cleanupWorkTree(); - exit; - } - - if( !defined($work->{index}) ) - { - (undef, $work->{index}) = tempfile ( DIR => $TEMP_DIR, OPEN => 0 ); - } - - $ENV{GIT_WORK_TREE} = "."; - $ENV{GIT_INDEX_FILE} = $work->{index}; - $work->{state} = 1; - - system("git","read-tree",$ver); - unless ($? == 0) - { - die "Error running git-read-tree $ver $!\n"; - } -} - -# Cleanup working directory that is not needed any longer. -sub cleanupWorkTree -{ - if( ! $work->{state} ) - { - return; - } - - chdir "/" or die "Unable to chdir '/'\n"; - - if( defined($work->{workDir}) ) - { - rmtree( $work->{workDir} ); - undef $work->{workDir}; - } - undef $work->{state}; -} - -# Setup a temporary directory (not a working tree), typically for -# merging dirty state as in req_update. -sub setupTmpDir -{ - $work->{tmpDir} = tempdir ( DIR => $TEMP_DIR ); - chdir $work->{tmpDir} or die "Unable to chdir $work->{tmpDir}\n"; - - return $work->{tmpDir}; -} - -# Clean up a previously setupTmpDir. Restore previous work tree if -# appropriate. -sub cleanupTmpDir -{ - if ( !defined($work->{tmpDir}) ) - { - $log->warn("cleanup tmpdir that has not been setup"); - die "Cleanup tmpDir that has not been setup\n"; - } - if( defined($work->{state}) ) - { - if( $work->{state} == 1 ) - { - chdir $work->{emptyDir} or - die "Unable to chdir to $work->{emptyDir}\n"; - } - elsif( $work->{state} == 2 ) - { - chdir $work->{workDir} or - die "Unable to chdir to $work->{emptyDir}\n"; - } - else - { - $log->warn("Inconsistent work dir state"); - die "Inconsistent work dir state\n"; - } - } - else - { - chdir "/" or die "Unable to chdir '/'\n"; - } -} - -# Given a path, this function returns a string containing the kopts -# that should go into that path's Entries line. For example, a binary -# file should get -kb. -sub kopts_from_path -{ - my ($path, $srcType, $name) = @_; - - if ( defined ( $cfg->{gitcvs}{usecrlfattr} ) and - $cfg->{gitcvs}{usecrlfattr} =~ /\s*(1|true|yes)\s*$/i ) - { - my ($val) = check_attr( "text", $path ); - if ( $val eq "unspecified" ) - { - $val = check_attr( "crlf", $path ); - } - if ( $val eq "unset" ) - { - return "-kb" - } - elsif ( check_attr( "eol", $path ) ne "unspecified" || - $val eq "set" || $val eq "input" ) - { - return ""; - } - else - { - $log->info("Unrecognized check_attr crlf $path : $val"); - } - } - - if ( defined ( $cfg->{gitcvs}{allbinary} ) ) - { - if( ($cfg->{gitcvs}{allbinary} =~ /^\s*(1|true|yes)\s*$/i) ) - { - return "-kb"; - } - elsif( ($cfg->{gitcvs}{allbinary} =~ /^\s*guess\s*$/i) ) - { - if( is_binary($srcType,$name) ) - { - $log->debug("... as binary"); - return "-kb"; - } - else - { - $log->debug("... as text"); - } - } - } - # Return "" to give no special treatment to any path - return ""; -} - -sub check_attr -{ - my ($attr,$path) = @_; - ensureWorkTree(); - if ( open my $fh, '-|', "git", "check-attr", $attr, "--", $path ) - { - my $val = <$fh>; - close $fh; - $val =~ s/.*: ([^:\r\n]*)\s*$/$1/; - return $val; - } - else - { - return undef; - } -} - -# This should have the same heuristics as convert.c:is_binary() and related. -# Note that the bare CR test is done by callers in convert.c. -sub is_binary -{ - my ($srcType,$name) = @_; - $log->debug("is_binary($srcType,$name)"); - - # Minimize amount of interpreted code run in the inner per-character - # loop for large files, by totalling each character value and - # then analyzing the totals. - my @counts; - my $i; - for($i=0;$i<256;$i++) - { - $counts[$i]=0; - } - - my $fh = open_blob_or_die($srcType,$name); - my $line; - while( defined($line=<$fh>) ) - { - # Any '\0' and bare CR are considered binary. - if( $line =~ /\0|(\r[^\n])/ ) - { - close($fh); - return 1; - } - - # Count up each character in the line: - my $len=length($line); - for($i=0;$i<$len;$i++) - { - $counts[ord(substr($line,$i,1))]++; - } - } - close $fh; - - # Don't count CR and LF as either printable/nonprintable - $counts[ord("\n")]=0; - $counts[ord("\r")]=0; - - # Categorize individual character count into printable and nonprintable: - my $printable=0; - my $nonprintable=0; - for($i=0;$i<256;$i++) - { - if( $i < 32 && - $i != ord("\b") && - $i != ord("\t") && - $i != 033 && # ESC - $i != 014 ) # FF - { - $nonprintable+=$counts[$i]; - } - elsif( $i==127 ) # DEL - { - $nonprintable+=$counts[$i]; - } - else - { - $printable+=$counts[$i]; - } - } - - return ($printable >> 7) < $nonprintable; -} - -# Returns open file handle. Possible invocations: -# - open_blob_or_die("file",$filename); -# - open_blob_or_die("sha1",$filehash); -sub open_blob_or_die -{ - my ($srcType,$name) = @_; - my ($fh); - if( $srcType eq "file" ) - { - if( !open $fh,"<",$name ) - { - $log->warn("Unable to open file $name: $!"); - die "Unable to open file $name: $!\n"; - } - } - elsif( $srcType eq "sha1" ) - { - unless ( defined ( $name ) and $name =~ /^[a-zA-Z0-9]{$state->{hexsz}}$/ ) - { - $log->warn("Need filehash"); - die "Need filehash\n"; - } - - my $type = safe_pipe_capture('git', 'cat-file', '-t', $name); - chomp $type; - - unless ( defined ( $type ) and $type eq "blob" ) - { - $log->warn("Invalid type '$type' for '$name'"); - die ( "Invalid type '$type' (expected 'blob')" ) - } - - my $size = safe_pipe_capture('git', 'cat-file', '-s', $name); - chomp $size; - - $log->debug("open_blob_or_die($name) size=$size, type=$type"); - - unless( open $fh, '-|', "git", "cat-file", "blob", $name ) - { - $log->warn("Unable to open sha1 $name"); - die "Unable to open sha1 $name\n"; - } - } - else - { - $log->warn("Unknown type of blob source: $srcType"); - die "Unknown type of blob source: $srcType\n"; - } - return $fh; -} - -# Generate a CVS author name from Git author information, by taking the local -# part of the email address and replacing characters not in the Portable -# Filename Character Set (see IEEE Std 1003.1-2001, 3.276) by underscores. CVS -# Login names are Unix login names, which should be restricted to this -# character set. -sub cvs_author -{ - my $author_line = shift; - (my $author) = $author_line =~ /<([^@>]*)/; - - $author =~ s/[^-a-zA-Z0-9_.]/_/g; - $author =~ s/^-/_/; - - $author; -} - - -sub descramble -{ - # This table is from src/scramble.c in the CVS source - my @SHIFTS = ( - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 114,120, 53, 79, 96,109, 72,108, 70, 64, 76, 67,116, 74, 68, 87, - 111, 52, 75,119, 49, 34, 82, 81, 95, 65,112, 86,118,110,122,105, - 41, 57, 83, 43, 46,102, 40, 89, 38,103, 45, 50, 42,123, 91, 35, - 125, 55, 54, 66,124,126, 59, 47, 92, 71,115, 78, 88,107,106, 56, - 36,121,117,104,101,100, 69, 73, 99, 63, 94, 93, 39, 37, 61, 48, - 58,113, 32, 90, 44, 98, 60, 51, 33, 97, 62, 77, 84, 80, 85,223, - 225,216,187,166,229,189,222,188,141,249,148,200,184,136,248,190, - 199,170,181,204,138,232,218,183,255,234,220,247,213,203,226,193, - 174,172,228,252,217,201,131,230,197,211,145,238,161,179,160,212, - 207,221,254,173,202,146,224,151,140,196,205,130,135,133,143,246, - 192,159,244,239,185,168,215,144,139,165,180,157,147,186,214,176, - 227,231,219,169,175,156,206,198,129,164,150,210,154,177,134,127, - 182,128,158,208,162,132,167,209,149,241,153,251,237,236,171,195, - 243,233,253,240,194,250,191,155,142,137,245,235,163,242,178,152 - ); - my ($str) = @_; - - # This should never happen, the same password format (A) has been - # used by CVS since the beginning of time - { - my $fmt = substr($str, 0, 1); - die "invalid password format `$fmt'" unless $fmt eq 'A'; - } - - my @str = unpack "C*", substr($str, 1); - my $ret = join '', map { chr $SHIFTS[$_] } @str; - return $ret; -} - -# Test if the (deep) values of two references to a hash are the same. -sub refHashEqual -{ - my($v1,$v2) = @_; - - my $out; - if(!defined($v1)) - { - if(!defined($v2)) - { - $out=1; - } - } - elsif( !defined($v2) || - scalar(keys(%{$v1})) != scalar(keys(%{$v2})) ) - { - # $out=undef; - } - else - { - $out=1; - - my $key; - foreach $key (keys(%{$v1})) - { - if( !exists($v2->{$key}) || - defined($v1->{$key}) ne defined($v2->{$key}) || - ( defined($v1->{$key}) && - $v1->{$key} ne $v2->{$key} ) ) - { - $out=undef; - last; - } - } - } - - return $out; -} - -# an alternative to `command` that allows input to be passed as an array -# to work around shell problems with weird characters in arguments - -sub safe_pipe_capture { - - my @output; - - if (my $pid = open my $child, '-|') { - @output = (<$child>); - close $child or die join(' ',@_).": $! $?"; - } else { - exec(@_) or die "$! $?"; # exec() can fail the executable can't be found - } - return wantarray ? @output : join('',@output); -} - - -package GITCVS::log; - -#### -#### Copyright The Open University UK - 2006. -#### -#### Authors: Martyn Smith -#### Martin Langhoff -#### -#### - -use strict; -use warnings; - -=head1 NAME - -GITCVS::log - -=head1 DESCRIPTION - -This module provides very crude logging with a similar interface to -Log::Log4perl - -=head1 METHODS - -=cut - -=head2 new - -Creates a new log object, optionally you can specify a filename here to -indicate the file to log to. If no log file is specified, you can specify one -later with method setfile, or indicate you no longer want logging with method -nofile. - -Until one of these methods is called, all log calls will buffer messages ready -to write out. - -=cut -sub new -{ - my $class = shift; - my $filename = shift; - - my $self = {}; - - bless $self, $class; - - if ( defined ( $filename ) ) - { - open $self->{fh}, ">>", $filename or die("Couldn't open '$filename' for writing : $!"); - } - - return $self; -} - -=head2 setfile - -This methods takes a filename, and attempts to open that file as the log file. -If successful, all buffered data is written out to the file, and any further -logging is written directly to the file. - -=cut -sub setfile -{ - my $self = shift; - my $filename = shift; - - if ( defined ( $filename ) ) - { - open $self->{fh}, ">>", $filename or die("Couldn't open '$filename' for writing : $!"); - } - - return unless ( defined ( $self->{buffer} ) and ref $self->{buffer} eq "ARRAY" ); - - while ( my $line = shift @{$self->{buffer}} ) - { - print {$self->{fh}} $line; - } -} - -=head2 nofile - -This method indicates no logging is going to be used. It flushes any entries in -the internal buffer, and sets a flag to ensure no further data is put there. - -=cut -sub nofile -{ - my $self = shift; - - $self->{nolog} = 1; - - return unless ( defined ( $self->{buffer} ) and ref $self->{buffer} eq "ARRAY" ); - - $self->{buffer} = []; -} - -=head2 _logopen - -Internal method. Returns true if the log file is open, false otherwise. - -=cut -sub _logopen -{ - my $self = shift; - - return 1 if ( defined ( $self->{fh} ) and ref $self->{fh} eq "GLOB" ); - return 0; -} - -=head2 debug info warn fatal - -These four methods are wrappers to _log. They provide the actual interface for -logging data. - -=cut -sub debug { my $self = shift; $self->_log("debug", @_); } -sub info { my $self = shift; $self->_log("info" , @_); } -sub warn { my $self = shift; $self->_log("warn" , @_); } -sub fatal { my $self = shift; $self->_log("fatal", @_); } - -=head2 _log - -This is an internal method called by the logging functions. It generates a -timestamp and pushes the logged line either to file, or internal buffer. - -=cut -sub _log -{ - my $self = shift; - my $level = shift; - - return if ( $self->{nolog} ); - - my @time = localtime; - my $timestring = sprintf("%4d-%02d-%02d %02d:%02d:%02d : %-5s", - $time[5] + 1900, - $time[4] + 1, - $time[3], - $time[2], - $time[1], - $time[0], - uc $level, - ); - - if ( $self->_logopen ) - { - print {$self->{fh}} $timestring . " - " . join(" ",@_) . "\n"; - } else { - push @{$self->{buffer}}, $timestring . " - " . join(" ",@_) . "\n"; - } -} - -=head2 DESTROY - -This method simply closes the file handle if one is open - -=cut -sub DESTROY -{ - my $self = shift; - - if ( $self->_logopen ) - { - close $self->{fh}; - } -} - -package GITCVS::updater; - -#### -#### Copyright The Open University UK - 2006. -#### -#### Authors: Martyn Smith -#### Martin Langhoff -#### -#### - -use strict; -use warnings; -use DBI; - -=head1 METHODS - -=cut - -=head2 new - -=cut -sub new -{ - my $class = shift; - my $config = shift; - my $module = shift; - my $log = shift; - - die "Need to specify a git repository" unless ( defined($config) and -d $config ); - die "Need to specify a module" unless ( defined($module) ); - - $class = ref($class) || $class; - - my $self = {}; - - bless $self, $class; - - $self->{valid_tables} = {'revision' => 1, - 'revision_ix1' => 1, - 'revision_ix2' => 1, - 'head' => 1, - 'head_ix1' => 1, - 'properties' => 1, - 'commitmsgs' => 1}; - - $self->{module} = $module; - $self->{git_path} = $config . "/"; - - $self->{log} = $log; - - die "Git repo '$self->{git_path}' doesn't exist" unless ( -d $self->{git_path} ); - - # Stores full sha1's for various branch/tag names, abbreviations, etc: - $self->{commitRefCache} = {}; - - $self->{dbdriver} = $cfg->{gitcvs}{$state->{method}}{dbdriver} || - $cfg->{gitcvs}{dbdriver} || "SQLite"; - $self->{dbname} = $cfg->{gitcvs}{$state->{method}}{dbname} || - $cfg->{gitcvs}{dbname} || "%Ggitcvs.%m.sqlite"; - $self->{dbuser} = $cfg->{gitcvs}{$state->{method}}{dbuser} || - $cfg->{gitcvs}{dbuser} || ""; - $self->{dbpass} = $cfg->{gitcvs}{$state->{method}}{dbpass} || - $cfg->{gitcvs}{dbpass} || ""; - $self->{dbtablenameprefix} = $cfg->{gitcvs}{$state->{method}}{dbtablenameprefix} || - $cfg->{gitcvs}{dbtablenameprefix} || ""; - my %mapping = ( m => $module, - a => $state->{method}, - u => getlogin || getpwuid($<) || $<, - G => $self->{git_path}, - g => mangle_dirname($self->{git_path}), - ); - $self->{dbname} =~ s/%([mauGg])/$mapping{$1}/eg; - $self->{dbuser} =~ s/%([mauGg])/$mapping{$1}/eg; - $self->{dbtablenameprefix} =~ s/%([mauGg])/$mapping{$1}/eg; - $self->{dbtablenameprefix} = mangle_tablename($self->{dbtablenameprefix}); - - die "Invalid char ':' in dbdriver" if $self->{dbdriver} =~ /:/; - die "Invalid char ';' in dbname" if $self->{dbname} =~ /;/; - $self->{dbh} = DBI->connect("dbi:$self->{dbdriver}:dbname=$self->{dbname}", - $self->{dbuser}, - $self->{dbpass}); - die "Error connecting to database\n" unless defined $self->{dbh}; - - $self->{tables} = {}; - foreach my $table ( keys %{$self->{dbh}->table_info(undef,undef,undef,'TABLE')->fetchall_hashref('TABLE_NAME')} ) - { - $self->{tables}{$table} = 1; - } - - # Construct the revision table if required - # The revision table stores an entry for each file, each time that file - # changes. - # numberOfRecords = O( numCommits * averageNumChangedFilesPerCommit ) - # This is not sufficient to support "-r {commithash}" for any - # files except files that were modified by that commit (also, - # some places in the code ignore/effectively strip out -r in - # some cases, before it gets passed to getmeta()). - # The "filehash" field typically has a git blob hash, but can also - # be set to "dead" to indicate that the given version of the file - # should not exist in the sandbox. - unless ( $self->{tables}{$self->tablename("revision")} ) - { - my $tablename = $self->tablename("revision"); - my $ix1name = $self->tablename("revision_ix1"); - my $ix2name = $self->tablename("revision_ix2"); - $self->{dbh}->do(" - CREATE TABLE $tablename ( - name TEXT NOT NULL, - revision INTEGER NOT NULL, - filehash TEXT NOT NULL, - commithash TEXT NOT NULL, - author TEXT NOT NULL, - modified TEXT NOT NULL, - mode TEXT NOT NULL - ) - "); - $self->{dbh}->do(" - CREATE INDEX $ix1name - ON $tablename (name,revision) - "); - $self->{dbh}->do(" - CREATE INDEX $ix2name - ON $tablename (name,commithash) - "); - } - - # Construct the head table if required - # The head table (along with the "last_commit" entry in the property - # table) is the persisted working state of the "sub update" subroutine. - # All of it's data is read entirely first, and completely recreated - # last, every time "sub update" runs. - # This is also used by "sub getmeta" when it is asked for the latest - # version of a file (as opposed to some specific version). - # Another way of thinking about it is as a single slice out of - # "revisions", giving just the most recent revision information for - # each file. - unless ( $self->{tables}{$self->tablename("head")} ) - { - my $tablename = $self->tablename("head"); - my $ix1name = $self->tablename("head_ix1"); - $self->{dbh}->do(" - CREATE TABLE $tablename ( - name TEXT NOT NULL, - revision INTEGER NOT NULL, - filehash TEXT NOT NULL, - commithash TEXT NOT NULL, - author TEXT NOT NULL, - modified TEXT NOT NULL, - mode TEXT NOT NULL - ) - "); - $self->{dbh}->do(" - CREATE INDEX $ix1name - ON $tablename (name) - "); - } - - # Construct the properties table if required - # - "last_commit" - Used by "sub update". - unless ( $self->{tables}{$self->tablename("properties")} ) - { - my $tablename = $self->tablename("properties"); - $self->{dbh}->do(" - CREATE TABLE $tablename ( - key TEXT NOT NULL PRIMARY KEY, - value TEXT - ) - "); - } - - # Construct the commitmsgs table if required - # The commitmsgs table is only used for merge commits, since - # "sub update" will only keep one branch of parents. Shortlogs - # for ignored commits (i.e. not on the chosen branch) will be used - # to construct a replacement "collapsed" merge commit message, - # which will be stored in this table. See also "sub commitmessage". - unless ( $self->{tables}{$self->tablename("commitmsgs")} ) - { - my $tablename = $self->tablename("commitmsgs"); - $self->{dbh}->do(" - CREATE TABLE $tablename ( - key TEXT NOT NULL PRIMARY KEY, - value TEXT - ) - "); - } - - return $self; -} - -=head2 tablename - -=cut -sub tablename -{ - my $self = shift; - my $name = shift; - - if (exists $self->{valid_tables}{$name}) { - return $self->{dbtablenameprefix} . $name; - } else { - return undef; - } -} - -=head2 update - -Bring the database up to date with the latest changes from -the git repository. - -Internal working state is read out of the "head" table and the -"last_commit" property, then it updates "revisions" based on that, and -finally it writes the new internal state back to the "head" table -so it can be used as a starting point the next time update is called. - -=cut -sub update -{ - my $self = shift; - - # first lets get the commit list - $ENV{GIT_DIR} = $self->{git_path}; - - my $commitsha1 = ::safe_pipe_capture('git', 'rev-parse', $self->{module}); - chomp $commitsha1; - - my $commitinfo = ::safe_pipe_capture('git', 'cat-file', 'commit', $self->{module}); - unless ( $commitinfo =~ /tree\s+[a-zA-Z0-9]{$state->{hexsz}}/ ) - { - die("Invalid module '$self->{module}'"); - } - - - my $git_log; - my $lastcommit = $self->_get_prop("last_commit"); - - if (defined $lastcommit && $lastcommit eq $commitsha1) { # up-to-date - # invalidate the gethead cache - $self->clearCommitRefCaches(); - return 1; - } - - # Start exclusive lock here... - $self->{dbh}->begin_work() or die "Cannot lock database for BEGIN"; - - # TODO: log processing is memory bound - # if we can parse into a 2nd file that is in reverse order - # we can probably do something really efficient - my @git_log_params = ('--pretty', '--parents', '--topo-order'); - - if (defined $lastcommit) { - push @git_log_params, "$lastcommit..$self->{module}"; - } else { - push @git_log_params, $self->{module}; - } - # git-rev-list is the backend / plumbing version of git-log - open(my $gitLogPipe, '-|', 'git', 'rev-list', @git_log_params) - or die "Cannot call git-rev-list: $!"; - my @commits=readCommits($gitLogPipe); - close $gitLogPipe; - - # Now all the commits are in the @commits bucket - # ordered by time DESC. for each commit that needs processing, - # determine whether it's following the last head we've seen or if - # it's on its own branch, grab a file list, and add whatever's changed - # NOTE: $lastcommit refers to the last commit from previous run - # $lastpicked is the last commit we picked in this run - my $lastpicked; - my $head = {}; - if (defined $lastcommit) { - $lastpicked = $lastcommit; - } - - my $committotal = scalar(@commits); - my $commitcount = 0; - - # Load the head table into $head (for cached lookups during the update process) - foreach my $file ( @{$self->gethead(1)} ) - { - $head->{$file->{name}} = $file; - } - - foreach my $commit ( @commits ) - { - $self->{log}->debug("GITCVS::updater - Processing commit $commit->{hash} (" . (++$commitcount) . " of $committotal)"); - if (defined $lastpicked) - { - if (!in_array($lastpicked, @{$commit->{parents}})) - { - # skip, we'll see this delta - # as part of a merge later - # warn "skipping off-track $commit->{hash}\n"; - next; - } elsif (@{$commit->{parents}} > 1) { - # it is a merge commit, for each parent that is - # not $lastpicked (not given a CVS revision number), - # see if we can get a log - # from the merge-base to that parent to put it - # in the message as a merge summary. - my @parents = @{$commit->{parents}}; - foreach my $parent (@parents) { - if ($parent eq $lastpicked) { - next; - } - # git-merge-base can potentially (but rarely) throw - # several candidate merge bases. let's assume - # that the first one is the best one. - my $base = eval { - ::safe_pipe_capture('git', 'merge-base', - $lastpicked, $parent); - }; - # The two branches may not be related at all, - # in which case merge base simply fails to find - # any, but that's Ok. - next if ($@); - - chomp $base; - if ($base) { - my @merged; - # print "want to log between $base $parent \n"; - open(GITLOG, '-|', 'git', 'log', '--pretty=medium', "$base..$parent") - or die "Cannot call git-log: $!"; - my $mergedhash; - while () { - chomp; - if (!defined $mergedhash) { - if (m/^commit\s+(.+)$/) { - $mergedhash = $1; - } else { - next; - } - } else { - # grab the first line that looks non-rfc822 - # aka has content after leading space - if (m/^\s+(\S.*)$/) { - my $title = $1; - $title = substr($title,0,100); # truncate - unshift @merged, "$mergedhash $title"; - undef $mergedhash; - } - } - } - close GITLOG; - if (@merged) { - $commit->{mergemsg} = $commit->{message}; - $commit->{mergemsg} .= "\nSummary of merged commits:\n\n"; - foreach my $summary (@merged) { - $commit->{mergemsg} .= "\t$summary\n"; - } - $commit->{mergemsg} .= "\n\n"; - # print "Message for $commit->{hash} \n$commit->{mergemsg}"; - } - } - } - } - } - - # convert the date to CVS-happy format - my $cvsDate = convertToCvsDate($commit->{date}); - - if ( defined ( $lastpicked ) ) - { - my $filepipe = open(FILELIST, '-|', 'git', 'diff-tree', '-z', '-r', $lastpicked, $commit->{hash}) or die("Cannot call git-diff-tree : $!"); - local ($/) = "\0"; - while ( ) - { - chomp; - unless ( /^:\d{6}\s+([0-7]{6})\s+[a-f0-9]{$state->{hexsz}}\s+([a-f0-9]{$state->{hexsz}})\s+(\w)$/o ) - { - die("Couldn't process git-diff-tree line : $_"); - } - my ($mode, $hash, $change) = ($1, $2, $3); - my $name = ; - chomp($name); - - # $log->debug("File mode=$mode, hash=$hash, change=$change, name=$name"); - - my $dbMode = convertToDbMode($mode); - - if ( $change eq "D" ) - { - #$log->debug("DELETE $name"); - $head->{$name} = { - name => $name, - revision => $head->{$name}{revision} + 1, - filehash => "deleted", - commithash => $commit->{hash}, - modified => $cvsDate, - author => $commit->{author}, - mode => $dbMode, - }; - $self->insert_rev($name, $head->{$name}{revision}, $hash, $commit->{hash}, $cvsDate, $commit->{author}, $dbMode); - } - elsif ( $change eq "M" || $change eq "T" ) - { - #$log->debug("MODIFIED $name"); - $head->{$name} = { - name => $name, - revision => $head->{$name}{revision} + 1, - filehash => $hash, - commithash => $commit->{hash}, - modified => $cvsDate, - author => $commit->{author}, - mode => $dbMode, - }; - $self->insert_rev($name, $head->{$name}{revision}, $hash, $commit->{hash}, $cvsDate, $commit->{author}, $dbMode); - } - elsif ( $change eq "A" ) - { - #$log->debug("ADDED $name"); - $head->{$name} = { - name => $name, - revision => $head->{$name}{revision} ? $head->{$name}{revision}+1 : 1, - filehash => $hash, - commithash => $commit->{hash}, - modified => $cvsDate, - author => $commit->{author}, - mode => $dbMode, - }; - $self->insert_rev($name, $head->{$name}{revision}, $hash, $commit->{hash}, $cvsDate, $commit->{author}, $dbMode); - } - else - { - $log->warn("UNKNOWN FILE CHANGE mode=$mode, hash=$hash, change=$change, name=$name"); - die; - } - } - close FILELIST; - } else { - # this is used to detect files removed from the repo - my $seen_files = {}; - - my $filepipe = open(FILELIST, '-|', 'git', 'ls-tree', '-z', '-r', $commit->{hash}) or die("Cannot call git-ls-tree : $!"); - local $/ = "\0"; - while ( ) - { - chomp; - unless ( /^(\d+)\s+(\w+)\s+([a-zA-Z0-9]+)\t(.*)$/o ) - { - die("Couldn't process git-ls-tree line : $_"); - } - - my ( $mode, $git_type, $git_hash, $git_filename ) = ( $1, $2, $3, $4 ); - - $seen_files->{$git_filename} = 1; - - my ( $oldhash, $oldrevision, $oldmode ) = ( - $head->{$git_filename}{filehash}, - $head->{$git_filename}{revision}, - $head->{$git_filename}{mode} - ); - - my $dbMode = convertToDbMode($mode); - - # unless the file exists with the same hash, we need to update it ... - unless ( defined($oldhash) and $oldhash eq $git_hash and defined($oldmode) and $oldmode eq $dbMode ) - { - my $newrevision = ( $oldrevision or 0 ) + 1; - - $head->{$git_filename} = { - name => $git_filename, - revision => $newrevision, - filehash => $git_hash, - commithash => $commit->{hash}, - modified => $cvsDate, - author => $commit->{author}, - mode => $dbMode, - }; - - - $self->insert_rev($git_filename, $newrevision, $git_hash, $commit->{hash}, $cvsDate, $commit->{author}, $dbMode); - } - } - close FILELIST; - - # Detect deleted files - foreach my $file ( sort keys %$head ) - { - unless ( exists $seen_files->{$file} or $head->{$file}{filehash} eq "deleted" ) - { - $head->{$file}{revision}++; - $head->{$file}{filehash} = "deleted"; - $head->{$file}{commithash} = $commit->{hash}; - $head->{$file}{modified} = $cvsDate; - $head->{$file}{author} = $commit->{author}; - - $self->insert_rev($file, $head->{$file}{revision}, $head->{$file}{filehash}, $commit->{hash}, $cvsDate, $commit->{author}, $head->{$file}{mode}); - } - } - # END : "Detect deleted files" - } - - - if (exists $commit->{mergemsg}) - { - $self->insert_mergelog($commit->{hash}, $commit->{mergemsg}); - } - - $lastpicked = $commit->{hash}; - - $self->_set_prop("last_commit", $commit->{hash}); - } - - $self->delete_head(); - foreach my $file ( sort keys %$head ) - { - $self->insert_head( - $file, - $head->{$file}{revision}, - $head->{$file}{filehash}, - $head->{$file}{commithash}, - $head->{$file}{modified}, - $head->{$file}{author}, - $head->{$file}{mode}, - ); - } - # invalidate the gethead cache - $self->clearCommitRefCaches(); - - - # Ending exclusive lock here - $self->{dbh}->commit() or die "Failed to commit changes to SQLite"; -} - -sub readCommits -{ - my $pipeHandle = shift; - my @commits; - - my %commit = (); - - while ( <$pipeHandle> ) - { - chomp; - if (m/^commit\s+(.*)$/) { - # on ^commit lines put the just seen commit in the stack - # and prime things for the next one - if (keys %commit) { - my %copy = %commit; - unshift @commits, \%copy; - %commit = (); - } - my @parents = split(m/\s+/, $1); - $commit{hash} = shift @parents; - $commit{parents} = \@parents; - } elsif (m/^(\w+?):\s+(.*)$/ && !exists($commit{message})) { - # on rfc822-like lines seen before we see any message, - # lowercase the entry and put it in the hash as key-value - $commit{lc($1)} = $2; - } else { - # message lines - skip initial empty line - # and trim whitespace - if (!exists($commit{message}) && m/^\s*$/) { - # define it to mark the end of headers - $commit{message} = ''; - next; - } - s/^\s+//; s/\s+$//; # trim ws - $commit{message} .= $_ . "\n"; - } - } - - unshift @commits, \%commit if ( keys %commit ); - - return @commits; -} - -sub convertToCvsDate -{ - my $date = shift; - # Convert from: "git rev-list --pretty" formatted date - # Convert to: "the format specified by RFC822 as modified by RFC1123." - # Example: 26 May 1997 13:01:40 -0400 - if( $date =~ /^\w+\s+(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+(\d+)\s+([+-]\d+)$/ ) - { - $date = "$2 $1 $4 $3 $5"; - } - - return $date; -} - -sub convertToDbMode -{ - my $mode = shift; - - # NOTE: The CVS protocol uses a string similar "u=rw,g=rw,o=rw", - # but the database "mode" column historically (and currently) - # only stores the "rw" (for user) part of the string. - # FUTURE: It might make more sense to persist the raw - # octal mode (or perhaps the final full CVS form) instead of - # this half-converted form, but it isn't currently worth the - # backwards compatibility headaches. - - $mode=~/^\d{3}(\d)\d\d$/; - my $userBits=$1; - - my $dbMode = ""; - $dbMode .= "r" if ( $userBits & 4 ); - $dbMode .= "w" if ( $userBits & 2 ); - $dbMode .= "x" if ( $userBits & 1 ); - $dbMode = "rw" if ( $dbMode eq "" ); - - return $dbMode; -} - -sub insert_rev -{ - my $self = shift; - my $name = shift; - my $revision = shift; - my $filehash = shift; - my $commithash = shift; - my $modified = shift; - my $author = shift; - my $mode = shift; - my $tablename = $self->tablename("revision"); - - my $insert_rev = $self->{dbh}->prepare_cached("INSERT INTO $tablename (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1); - $insert_rev->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode); -} - -sub insert_mergelog -{ - my $self = shift; - my $key = shift; - my $value = shift; - my $tablename = $self->tablename("commitmsgs"); - - my $insert_mergelog = $self->{dbh}->prepare_cached("INSERT INTO $tablename (key, value) VALUES (?,?)",{},1); - $insert_mergelog->execute($key, $value); -} - -sub delete_head -{ - my $self = shift; - my $tablename = $self->tablename("head"); - - my $delete_head = $self->{dbh}->prepare_cached("DELETE FROM $tablename",{},1); - $delete_head->execute(); -} - -sub insert_head -{ - my $self = shift; - my $name = shift; - my $revision = shift; - my $filehash = shift; - my $commithash = shift; - my $modified = shift; - my $author = shift; - my $mode = shift; - my $tablename = $self->tablename("head"); - - my $insert_head = $self->{dbh}->prepare_cached("INSERT INTO $tablename (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1); - $insert_head->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode); -} - -sub _get_prop -{ - my $self = shift; - my $key = shift; - my $tablename = $self->tablename("properties"); - - my $db_query = $self->{dbh}->prepare_cached("SELECT value FROM $tablename WHERE key=?",{},1); - $db_query->execute($key); - my ( $value ) = $db_query->fetchrow_array; - - return $value; -} - -sub _set_prop -{ - my $self = shift; - my $key = shift; - my $value = shift; - my $tablename = $self->tablename("properties"); - - my $db_query = $self->{dbh}->prepare_cached("UPDATE $tablename SET value=? WHERE key=?",{},1); - $db_query->execute($value, $key); - - unless ( $db_query->rows ) - { - $db_query = $self->{dbh}->prepare_cached("INSERT INTO $tablename (key, value) VALUES (?,?)",{},1); - $db_query->execute($key, $value); - } - - return $value; -} - -=head2 gethead - -=cut - -sub gethead -{ - my $self = shift; - my $intRev = shift; - my $tablename = $self->tablename("head"); - - return $self->{gethead_cache} if ( defined ( $self->{gethead_cache} ) ); - - my $db_query = $self->{dbh}->prepare_cached("SELECT name, filehash, mode, revision, modified, commithash, author FROM $tablename ORDER BY name ASC",{},1); - $db_query->execute(); - - my $tree = []; - while ( my $file = $db_query->fetchrow_hashref ) - { - if(!$intRev) - { - $file->{revision} = "1.$file->{revision}" - } - push @$tree, $file; - } - - $self->{gethead_cache} = $tree; - - return $tree; -} - -=head2 getAnyHead - -Returns a reference to an array of getmeta structures, one -per file in the specified tree hash. - -=cut - -sub getAnyHead -{ - my ($self,$hash) = @_; - - if(!defined($hash)) - { - return $self->gethead(); - } - - my @files; - { - open(my $filePipe, '-|', 'git', 'ls-tree', '-z', '-r', $hash) - or die("Cannot call git-ls-tree : $!"); - local $/ = "\0"; - @files=<$filePipe>; - close $filePipe; - } - - my $tree=[]; - my($line); - foreach $line (@files) - { - $line=~s/\0$//; - unless ( $line=~/^(\d+)\s+(\w+)\s+([a-zA-Z0-9]+)\t(.*)$/o ) - { - die("Couldn't process git-ls-tree line : $_"); - } - - my($mode, $git_type, $git_hash, $git_filename) = ($1, $2, $3, $4); - push @$tree, $self->getMetaFromCommithash($git_filename,$hash); - } - - return $tree; -} - -=head2 getRevisionDirMap - -A "revision dir map" contains all the plain-file filenames associated -with a particular revision (tree-ish), organized by directory: - - $type = $out->{$dir}{$fullName} - -The type of each is "F" (for ordinary file) or "D" (for directory, -for which the map $out->{$fullName} will also exist). - -=cut - -sub getRevisionDirMap -{ - my ($self,$ver)=@_; - - if(!defined($self->{revisionDirMapCache})) - { - $self->{revisionDirMapCache}={}; - } - - # Get file list (previously cached results are dependent on HEAD, - # but are early in each case): - my $cacheKey; - my (@fileList); - if( !defined($ver) || $ver eq "" ) - { - $cacheKey=""; - if( defined($self->{revisionDirMapCache}{$cacheKey}) ) - { - return $self->{revisionDirMapCache}{$cacheKey}; - } - - my @head = @{$self->gethead()}; - foreach my $file ( @head ) - { - next if ( $file->{filehash} eq "deleted" ); - - push @fileList,$file->{name}; - } - } - else - { - my ($hash)=$self->lookupCommitRef($ver); - if( !defined($hash) ) - { - return undef; - } - - $cacheKey=$hash; - if( defined($self->{revisionDirMapCache}{$cacheKey}) ) - { - return $self->{revisionDirMapCache}{$cacheKey}; - } - - open(my $filePipe, '-|', 'git', 'ls-tree', '-z', '-r', $hash) - or die("Cannot call git-ls-tree : $!"); - local $/ = "\0"; - while ( <$filePipe> ) - { - chomp; - unless ( /^(\d+)\s+(\w+)\s+([a-zA-Z0-9]+)\t(.*)$/o ) - { - die("Couldn't process git-ls-tree line : $_"); - } - - my($mode, $git_type, $git_hash, $git_filename) = ($1, $2, $3, $4); - - push @fileList, $git_filename; - } - close $filePipe; - } - - # Convert to normalized form: - my %revMap; - my $file; - foreach $file (@fileList) - { - my($dir) = ($file=~m%^(?:(.*)/)?([^/]*)$%); - $dir='' if(!defined($dir)); - - # parent directories: - # ... create empty dir maps for parent dirs: - my($td)=$dir; - while(!defined($revMap{$td})) - { - $revMap{$td}={}; - - my($tp)=($td=~m%^(?:(.*)/)?([^/]*)$%); - $tp='' if(!defined($tp)); - $td=$tp; - } - # ... add children to parent maps (now that they exist): - $td=$dir; - while($td ne "") - { - my($tp)=($td=~m%^(?:(.*)/)?([^/]*)$%); - $tp='' if(!defined($tp)); - - if(defined($revMap{$tp}{$td})) - { - if($revMap{$tp}{$td} ne 'D') - { - die "Weird file/directory inconsistency in $cacheKey"; - } - last; # loop exit - } - $revMap{$tp}{$td}='D'; - - $td=$tp; - } - - # file - $revMap{$dir}{$file}='F'; - } - - # Save in cache: - $self->{revisionDirMapCache}{$cacheKey}=\%revMap; - return $self->{revisionDirMapCache}{$cacheKey}; -} - -=head2 getlog - -See also gethistorydense(). - -=cut - -sub getlog -{ - my $self = shift; - my $filename = shift; - my $revFilter = shift; - - my $tablename = $self->tablename("revision"); - - # Filters: - # TODO: date, state, or by specific logins filters? - # TODO: Handle comma-separated list of revFilter items, each item - # can be a range [only case currently handled] or individual - # rev or branch or "branch.". - # TODO: Adjust $db_query WHERE clause based on revFilter, instead of - # manually filtering the results of the query? - my ( $minrev, $maxrev ); - if( defined($revFilter) and - $state->{opt}{r} =~ /^(1.(\d+))?(::?)(1.(\d.+))?$/ ) - { - my $control = $3; - $minrev = $2; - $maxrev = $5; - $minrev++ if ( defined($minrev) and $control eq "::" ); - } - - my $db_query = $self->{dbh}->prepare_cached("SELECT name, filehash, author, mode, revision, modified, commithash FROM $tablename WHERE name=? ORDER BY revision DESC",{},1); - $db_query->execute($filename); - - my $totalRevs=0; - my $tree = []; - while ( my $file = $db_query->fetchrow_hashref ) - { - $totalRevs++; - if( defined($minrev) and $file->{revision} < $minrev ) - { - next; - } - if( defined($maxrev) and $file->{revision} > $maxrev ) - { - next; - } - - $file->{revision} = "1." . $file->{revision}; - push @$tree, $file; - } - - return ($tree,$totalRevs); -} - -=head2 getmeta - -This function takes a filename (with path) argument and returns a hashref of -metadata for that file. - -There are several ways $revision can be specified: - - - A reference to hash that contains a "tag" that is the - actual revision (one of the below). TODO: Also allow it to - specify a "date" in the hash. - - undef, to refer to the latest version on the main branch. - - Full CVS client revision number (mapped to integer in DB, without the - "1." prefix), - - Complex CVS-compatible "special" revision number for - non-linear history (see comment below) - - git commit sha1 hash - - branch or tag name - -=cut - -sub getmeta -{ - my $self = shift; - my $filename = shift; - my $revision = shift; - my $tablename_rev = $self->tablename("revision"); - my $tablename_head = $self->tablename("head"); - - if ( ref($revision) eq "HASH" ) - { - $revision = $revision->{tag}; - } - - # Overview of CVS revision numbers: - # - # General CVS numbering scheme: - # - Basic mainline branch numbers: "1.1", "1.2", "1.3", etc. - # - Result of "cvs checkin -r" (possible, but not really - # recommended): "2.1", "2.2", etc - # - Branch tag: "1.2.0.n", where "1.2" is revision it was branched - # from, "0" is a magic placeholder that identifies it as a - # branch tag instead of a version tag, and n is 2 times the - # branch number off of "1.2", starting with "2". - # - Version on a branch: "1.2.n.x", where "1.2" is branch-from, "n" - # is branch number off of "1.2" (like n above), and "x" is - # the version number on the branch. - # - Branches can branch off of branches: "1.3.2.7.4.1" (even number - # of components). - # - Odd "n"s are used by "vendor branches" that result - # from "cvs import". Vendor branches have additional - # strangeness in the sense that the main rcs "head" of the main - # branch will (temporarily until first normal commit) point - # to the version on the vendor branch, rather than the actual - # main branch. (FUTURE: This may provide an opportunity - # to use "strange" revision numbers for fast-forward-merged - # branch tip when CVS client is asking for the main branch.) - # - # git-cvsserver CVS-compatible special numbering schemes: - # - Currently git-cvsserver only tries to be identical to CVS for - # simple "1.x" numbers on the "main" branch (as identified - # by the module name that was originally cvs checkout'ed). - # - The database only stores the "x" part, for historical reasons. - # But most of the rest of the cvsserver preserves - # and thinks using the full revision number. - # - To handle non-linear history, it uses a version of the form - # "2.1.1.2000.b.b.b."..., where the 2.1.1.2000 is to help uniquely - # identify this as a special revision number, and there are - # 20 b's that together encode the sha1 git commit from which - # this version of this file originated. Each b is - # the numerical value of the corresponding byte plus - # 100. - # - "plus 100" avoids "0"s, and also reduces the - # likelihood of a collision in the case that someone someday - # writes an import tool that tries to preserve original - # CVS revision numbers, and the original CVS data had done - # lots of branches off of branches and other strangeness to - # end up with a real version number that just happens to look - # like this special revision number form. Also, if needed - # there are several ways to extend/identify alternative encodings - # within the "2.1.1.2000" part if necessary. - # - Unlike real CVS revisions, you can't really reconstruct what - # relation a revision of this form has to other revisions. - # - FUTURE: TODO: Rework database somehow to make up and remember - # fully-CVS-compatible branches and branch version numbers. - - my $meta; - if ( defined($revision) ) - { - if ( $revision =~ /^1\.(\d+)$/ ) - { - my ($intRev) = $1; - my $db_query; - $db_query = $self->{dbh}->prepare_cached( - "SELECT * FROM $tablename_rev WHERE name=? AND revision=?", - {},1); - $db_query->execute($filename, $intRev); - $meta = $db_query->fetchrow_hashref; - } - elsif ( $revision =~ /^2\.1\.1\.2000(\.[1-3][0-9][0-9]){$state->{rawsz}}$/ ) - { - my ($commitHash)=($revision=~/^2\.1\.1\.2000(.*)$/); - $commitHash=~s/\.([0-9]+)/sprintf("%02x",$1-100)/eg; - if($commitHash=~/^[0-9a-f]{$state->{hexsz}}$/) - { - return $self->getMetaFromCommithash($filename,$commitHash); - } - - # error recovery: fall back on head version below - print "E Failed to find $filename version=$revision or commit=$commitHash\n"; - $log->warning("failed get $revision with commithash=$commitHash"); - undef $revision; - } - elsif ( $revision =~ /^[0-9a-f]{$state->{hexsz}}$/ ) - { - # Try DB first. This is mostly only useful for req_annotate(), - # which only calls this for stuff that should already be in - # the DB. It is fairly likely to be a waste of time - # in most other cases [unless the file happened to be - # modified in $revision specifically], but - # it is probably in the noise compared to how long - # getMetaFromCommithash() will take. - my $db_query; - $db_query = $self->{dbh}->prepare_cached( - "SELECT * FROM $tablename_rev WHERE name=? AND commithash=?", - {},1); - $db_query->execute($filename, $revision); - $meta = $db_query->fetchrow_hashref; - - if(! $meta) - { - my($revCommit)=$self->lookupCommitRef($revision); - if($revCommit=~/^[0-9a-f]{$state->{hexsz}}$/) - { - return $self->getMetaFromCommithash($filename,$revCommit); - } - - # error recovery: nothing found: - print "E Failed to find $filename version=$revision\n"; - $log->warning("failed get $revision"); - return $meta; - } - } - else - { - my($revCommit)=$self->lookupCommitRef($revision); - if($revCommit=~/^[0-9a-f]{$state->{hexsz}}$/) - { - return $self->getMetaFromCommithash($filename,$revCommit); - } - - # error recovery: fall back on head version below - print "E Failed to find $filename version=$revision\n"; - $log->warning("failed get $revision"); - undef $revision; # Allow fallback - } - } - - if(!defined($revision)) - { - my $db_query; - $db_query = $self->{dbh}->prepare_cached( - "SELECT * FROM $tablename_head WHERE name=?",{},1); - $db_query->execute($filename); - $meta = $db_query->fetchrow_hashref; - } - - if($meta) - { - $meta->{revision} = "1.$meta->{revision}"; - } - return $meta; -} - -sub getMetaFromCommithash -{ - my $self = shift; - my $filename = shift; - my $revCommit = shift; - - # NOTE: This function doesn't scale well (lots of forks), especially - # if you have many files that have not been modified for many commits - # (each git-rev-parse redoes a lot of work for each file - # that theoretically could be done in parallel by smarter - # graph traversal). - # - # TODO: Possible optimization strategies: - # - Solve the issue of assigning and remembering "real" CVS - # revision numbers for branches, and ensure the - # data structure can do this efficiently. Perhaps something - # similar to "git notes", and carefully structured to take - # advantage same-sha1-is-same-contents, to roll the same - # unmodified subdirectory data onto multiple commits? - # - Write and use a C tool that is like git-blame, but - # operates on multiple files with file granularity, instead - # of one file with line granularity. Cache - # most-recently-modified in $self->{commitRefCache}{$revCommit}. - # Try to be intelligent about how many files we do with - # one fork (perhaps one directory at a time, without recursion, - # and/or include directory as one line item, recurse from here - # instead of in C tool?). - # - Perhaps we could ask the DB for (filename,fileHash), - # and just guess that it is correct (that the file hadn't - # changed between $revCommit and the found commit, then - # changed back, confusing anything trying to interpret - # history). Probably need to add another index to revisions - # DB table for this. - # - NOTE: Trying to store all (commit,file) keys in DB [to - # find "lastModfiedCommit] (instead of - # just files that changed in each commit as we do now) is - # probably not practical from a disk space perspective. - - # Does the file exist in $revCommit? - # TODO: Include file hash in dirmap cache. - my($dirMap)=$self->getRevisionDirMap($revCommit); - my($dir,$file)=($filename=~m%^(?:(.*)/)?([^/]*$)%); - if(!defined($dir)) - { - $dir=""; - } - if( !defined($dirMap->{$dir}) || - !defined($dirMap->{$dir}{$filename}) ) - { - my($fileHash)="deleted"; - - my($retVal)={}; - $retVal->{name}=$filename; - $retVal->{filehash}=$fileHash; - - # not needed and difficult to compute: - $retVal->{revision}="0"; # $revision; - $retVal->{commithash}=$revCommit; - #$retVal->{author}=$commit->{author}; - #$retVal->{modified}=convertToCvsDate($commit->{date}); - #$retVal->{mode}=convertToDbMode($mode); - - return $retVal; - } - - my($fileHash) = ::safe_pipe_capture("git","rev-parse","$revCommit:$filename"); - chomp $fileHash; - if(!($fileHash=~/^[0-9a-f]{$state->{hexsz}}$/)) - { - die "Invalid fileHash '$fileHash' looking up" - ." '$revCommit:$filename'\n"; - } - - # information about most recent commit to modify $filename: - open(my $gitLogPipe, '-|', 'git', 'rev-list', - '--max-count=1', '--pretty', '--parents', - $revCommit, '--', $filename) - or die "Cannot call git-rev-list: $!"; - my @commits=readCommits($gitLogPipe); - close $gitLogPipe; - if(scalar(@commits)!=1) - { - die "Can't find most recent commit changing $filename\n"; - } - my($commit)=$commits[0]; - if( !defined($commit) || !defined($commit->{hash}) ) - { - return undef; - } - - # does this (commit,file) have a real assigned CVS revision number? - my $tablename_rev = $self->tablename("revision"); - my $db_query; - $db_query = $self->{dbh}->prepare_cached( - "SELECT * FROM $tablename_rev WHERE name=? AND commithash=?", - {},1); - $db_query->execute($filename, $commit->{hash}); - my($meta)=$db_query->fetchrow_hashref; - if($meta) - { - $meta->{revision} = "1.$meta->{revision}"; - return $meta; - } - - # fall back on special revision number - my($revision)=$commit->{hash}; - $revision=~s/(..)/'.' . (hex($1)+100)/eg; - $revision="2.1.1.2000$revision"; - - # meta data about $filename: - open(my $filePipe, '-|', 'git', 'ls-tree', '-z', - $commit->{hash}, '--', $filename) - or die("Cannot call git-ls-tree : $!"); - local $/ = "\0"; - my $line; - $line=<$filePipe>; - if(defined(<$filePipe>)) - { - die "Expected only a single file for git-ls-tree $filename\n"; - } - close $filePipe; - - chomp $line; - unless ( $line=~m/^(\d+)\s+(\w+)\s+([a-zA-Z0-9]+)\t(.*)$/o ) - { - die("Couldn't process git-ls-tree line : $line\n"); - } - my ( $mode, $git_type, $git_hash, $git_filename ) = ( $1, $2, $3, $4 ); - - # save result: - my($retVal)={}; - $retVal->{name}=$filename; - $retVal->{revision}=$revision; - $retVal->{filehash}=$fileHash; - $retVal->{commithash}=$revCommit; - $retVal->{author}=$commit->{author}; - $retVal->{modified}=convertToCvsDate($commit->{date}); - $retVal->{mode}=convertToDbMode($mode); - - return $retVal; -} - -=head2 lookupCommitRef - -Convert tag/branch/abbreviation/etc into a commit sha1 hash. Caches -the result so looking it up again is fast. - -=cut - -sub lookupCommitRef -{ - my $self = shift; - my $ref = shift; - - my $commitHash = $self->{commitRefCache}{$ref}; - if(defined($commitHash)) - { - return $commitHash; - } - - $commitHash = ::safe_pipe_capture("git","rev-parse","--verify","--quiet", - $self->unescapeRefName($ref)); - $commitHash=~s/\s*$//; - if(!($commitHash=~/^[0-9a-f]{$state->{hexsz}}$/)) - { - $commitHash=undef; - } - - if( defined($commitHash) ) - { - my $type = ::safe_pipe_capture("git","cat-file","-t",$commitHash); - if( ! ($type=~/^commit\s*$/ ) ) - { - $commitHash=undef; - } - } - if(defined($commitHash)) - { - $self->{commitRefCache}{$ref}=$commitHash; - } - return $commitHash; -} - -=head2 clearCommitRefCaches - -Clears cached commit cache (sha1's for various tags/abbeviations/etc), -and related caches. - -=cut - -sub clearCommitRefCaches -{ - my $self = shift; - $self->{commitRefCache} = {}; - $self->{revisionDirMapCache} = undef; - $self->{gethead_cache} = undef; -} - -=head2 commitmessage - -this function takes a commithash and returns the commit message for that commit - -=cut -sub commitmessage -{ - my $self = shift; - my $commithash = shift; - my $tablename = $self->tablename("commitmsgs"); - - die("Need commithash") unless ( defined($commithash) and $commithash =~ /^[a-zA-Z0-9]{$state->{hexsz}}$/ ); - - my $db_query; - $db_query = $self->{dbh}->prepare_cached("SELECT value FROM $tablename WHERE key=?",{},1); - $db_query->execute($commithash); - - my ( $message ) = $db_query->fetchrow_array; - - if ( defined ( $message ) ) - { - $message .= " " if ( $message =~ /\n$/ ); - return $message; - } - - my @lines = ::safe_pipe_capture("git", "cat-file", "commit", $commithash); - shift @lines while ( $lines[0] =~ /\S/ ); - $message = join("",@lines); - $message .= " " if ( $message =~ /\n$/ ); - return $message; -} - -=head2 gethistorydense - -This function takes a filename (with path) argument and returns an arrayofarrays -containing revision,filehash,commithash ordered by revision descending. - -This version of gethistory skips deleted entries -- so it is useful for annotate. -The 'dense' part is a reference to a '--dense' option available for git-rev-list -and other git tools that depend on it. - -See also getlog(). - -=cut -sub gethistorydense -{ - my $self = shift; - my $filename = shift; - my $tablename = $self->tablename("revision"); - - my $db_query; - $db_query = $self->{dbh}->prepare_cached("SELECT revision, filehash, commithash FROM $tablename WHERE name=? AND filehash!='deleted' ORDER BY revision DESC",{},1); - $db_query->execute($filename); - - my $result = $db_query->fetchall_arrayref; - - my $i; - for($i=0 ; $i[$i][0]="1." . $result->[$i][0]; - } - - return $result; -} - -=head2 escapeRefName - -Apply an escape mechanism to compensate for characters that -git ref names can have that CVS tags can not. - -=cut -sub escapeRefName -{ - my($self,$refName)=@_; - - # CVS officially only allows [-_A-Za-z0-9] in tag names (or in - # many contexts it can also be a CVS revision number). - # - # Git tags commonly use '/' and '.' as well, but also handle - # anything else just in case: - # - # = "_-s-" For '/'. - # = "_-p-" For '.'. - # = "_-u-" For underscore, in case someone wants a literal "_-" in - # a tag name. - # = "_-xx-" Where "xx" is the hexadecimal representation of the - # desired ASCII character byte. (for anything else) - - if(! $refName=~/^[1-9][0-9]*(\.[1-9][0-9]*)*$/) - { - $refName=~s/_-/_-u--/g; - $refName=~s/\./_-p-/g; - $refName=~s%/%_-s-%g; - $refName=~s/[^-_a-zA-Z0-9]/sprintf("_-%02x-",$1)/eg; - } -} - -=head2 unescapeRefName - -Undo an escape mechanism to compensate for characters that -git ref names can have that CVS tags can not. - -=cut -sub unescapeRefName -{ - my($self,$refName)=@_; - - # see escapeRefName() for description of escape mechanism. - - $refName=~s/_-([spu]|[0-9a-f][0-9a-f])-/unescapeRefNameChar($1)/eg; - - # allowed tag names - # TODO: Perhaps use git check-ref-format, with an in-process cache of - # validated names? - if( !( $refName=~m%^[^-][-a-zA-Z0-9_/.]*$% ) || - ( $refName=~m%[/.]$% ) || - ( $refName=~/\.lock$/ ) || - ( $refName=~m%\.\.|/\.|[[\\:?*~]|\@\{% ) ) # matching } - { - # Error: - $log->warn("illegal refName: $refName"); - $refName=undef; - } - return $refName; -} - -sub unescapeRefNameChar -{ - my($char)=@_; - - if($char eq "s") - { - $char="/"; - } - elsif($char eq "p") - { - $char="."; - } - elsif($char eq "u") - { - $char="_"; - } - elsif($char=~/^[0-9a-f][0-9a-f]$/) - { - $char=chr(hex($char)); - } - else - { - # Error case: Maybe it has come straight from user, and - # wasn't supposed to be escaped? Restore it the way we got it: - $char="_-$char-"; - } - - return $char; -} - -=head2 in_array() - -from Array::PAT - mimics the in_array() function -found in PHP. Yuck but works for small arrays. - -=cut -sub in_array -{ - my ($check, @array) = @_; - my $retval = 0; - foreach my $test (@array){ - if($check eq $test){ - $retval = 1; - } - } - return $retval; -} - -=head2 mangle_dirname - -create a string from a directory name that is suitable to use as -part of a filename, mainly by converting all chars except \w.- to _ - -=cut -sub mangle_dirname { - my $dirname = shift; - return unless defined $dirname; - - $dirname =~ s/[^\w.-]/_/g; - - return $dirname; -} - -=head2 mangle_tablename - -create a string from a that is suitable to use as part of an SQL table -name, mainly by converting all chars except \w to _ - -=cut -sub mangle_tablename { - my $tablename = shift; - return unless defined $tablename; - - $tablename =~ s/[^\w_]/_/g; - - return $tablename; -} - -1; diff --git a/dependencies/darwin_amd64/git/2.30.1/bin/git-shell b/dependencies/darwin_amd64/git/2.30.1/bin/git-shell deleted file mode 100755 index 75b8fc43b..000000000 Binary files a/dependencies/darwin_amd64/git/2.30.1/bin/git-shell and /dev/null differ diff --git a/dependencies/darwin_amd64/git/2.30.1/etc/bash_completion.d/git-completion.bash b/dependencies/darwin_amd64/git/2.30.1/etc/bash_completion.d/git-completion.bash deleted file mode 100644 index 463a3124d..000000000 --- a/dependencies/darwin_amd64/git/2.30.1/etc/bash_completion.d/git-completion.bash +++ /dev/null @@ -1,3516 +0,0 @@ -# bash/zsh completion support for core Git. -# -# Copyright (C) 2006,2007 Shawn O. Pearce -# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). -# Distributed under the GNU General Public License, version 2.0. -# -# The contained completion routines provide support for completing: -# -# *) local and remote branch names -# *) local and remote tag names -# *) .git/remotes file names -# *) git 'subcommands' -# *) git email aliases for git-send-email -# *) tree paths within 'ref:path/to/file' expressions -# *) file paths within current working directory and index -# *) common --long-options -# -# To use these routines: -# -# 1) Copy this file to somewhere (e.g. ~/.git-completion.bash). -# 2) Add the following line to your .bashrc/.zshrc: -# source ~/.git-completion.bash -# 3) Consider changing your PS1 to also show the current branch, -# see git-prompt.sh for details. -# -# If you use complex aliases of form '!f() { ... }; f', you can use the null -# command ':' as the first command in the function body to declare the desired -# completion style. For example '!f() { : git commit ; ... }; f' will -# tell the completion to use commit completion. This also works with aliases -# of form "!sh -c '...'". For example, "!sh -c ': git commit ; ... '". -# -# Compatible with bash 3.2.57. -# -# You can set the following environment variables to influence the behavior of -# the completion routines: -# -# GIT_COMPLETION_CHECKOUT_NO_GUESS -# -# When set to "1", do not include "DWIM" suggestions in git-checkout -# and git-switch completion (e.g., completing "foo" when "origin/foo" -# exists). -# -# GIT_COMPLETION_SHOW_ALL -# -# When set to "1" suggest all options, including options which are -# typically hidden (e.g. '--allow-empty' for 'git commit'). - -case "$COMP_WORDBREAKS" in -*:*) : great ;; -*) COMP_WORDBREAKS="$COMP_WORDBREAKS:" -esac - -# Discovers the path to the git repository taking any '--git-dir=' and -# '-C ' options into account and stores it in the $__git_repo_path -# variable. -__git_find_repo_path () -{ - if [ -n "${__git_repo_path-}" ]; then - # we already know where it is - return - fi - - if [ -n "${__git_C_args-}" ]; then - __git_repo_path="$(git "${__git_C_args[@]}" \ - ${__git_dir:+--git-dir="$__git_dir"} \ - rev-parse --absolute-git-dir 2>/dev/null)" - elif [ -n "${__git_dir-}" ]; then - test -d "$__git_dir" && - __git_repo_path="$__git_dir" - elif [ -n "${GIT_DIR-}" ]; then - test -d "${GIT_DIR-}" && - __git_repo_path="$GIT_DIR" - elif [ -d .git ]; then - __git_repo_path=.git - else - __git_repo_path="$(git rev-parse --git-dir 2>/dev/null)" - fi -} - -# Deprecated: use __git_find_repo_path() and $__git_repo_path instead -# __gitdir accepts 0 or 1 arguments (i.e., location) -# returns location of .git repo -__gitdir () -{ - if [ -z "${1-}" ]; then - __git_find_repo_path || return 1 - echo "$__git_repo_path" - elif [ -d "$1/.git" ]; then - echo "$1/.git" - else - echo "$1" - fi -} - -# Runs git with all the options given as argument, respecting any -# '--git-dir=' and '-C ' options present on the command line -__git () -{ - git ${__git_C_args:+"${__git_C_args[@]}"} \ - ${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null -} - -# Removes backslash escaping, single quotes and double quotes from a word, -# stores the result in the variable $dequoted_word. -# 1: The word to dequote. -__git_dequote () -{ - local rest="$1" len ch - - dequoted_word="" - - while test -n "$rest"; do - len=${#dequoted_word} - dequoted_word="$dequoted_word${rest%%[\\\'\"]*}" - rest="${rest:$((${#dequoted_word}-$len))}" - - case "${rest:0:1}" in - \\) - ch="${rest:1:1}" - case "$ch" in - $'\n') - ;; - *) - dequoted_word="$dequoted_word$ch" - ;; - esac - rest="${rest:2}" - ;; - \') - rest="${rest:1}" - len=${#dequoted_word} - dequoted_word="$dequoted_word${rest%%\'*}" - rest="${rest:$((${#dequoted_word}-$len+1))}" - ;; - \") - rest="${rest:1}" - while test -n "$rest" ; do - len=${#dequoted_word} - dequoted_word="$dequoted_word${rest%%[\\\"]*}" - rest="${rest:$((${#dequoted_word}-$len))}" - case "${rest:0:1}" in - \\) - ch="${rest:1:1}" - case "$ch" in - \"|\\|\$|\`) - dequoted_word="$dequoted_word$ch" - ;; - $'\n') - ;; - *) - dequoted_word="$dequoted_word\\$ch" - ;; - esac - rest="${rest:2}" - ;; - \") - rest="${rest:1}" - break - ;; - esac - done - ;; - esac - done -} - -# The following function is based on code from: -# -# bash_completion - programmable completion functions for bash 3.2+ -# -# Copyright © 2006-2008, Ian Macdonald -# © 2009-2010, Bash Completion Maintainers -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# The latest version of this software can be obtained here: -# -# http://bash-completion.alioth.debian.org/ -# -# RELEASE: 2.x - -# This function can be used to access a tokenized list of words -# on the command line: -# -# __git_reassemble_comp_words_by_ref '=:' -# if test "${words_[cword_-1]}" = -w -# then -# ... -# fi -# -# The argument should be a collection of characters from the list of -# word completion separators (COMP_WORDBREAKS) to treat as ordinary -# characters. -# -# This is roughly equivalent to going back in time and setting -# COMP_WORDBREAKS to exclude those characters. The intent is to -# make option types like --date= and : easy to -# recognize by treating each shell word as a single token. -# -# It is best not to set COMP_WORDBREAKS directly because the value is -# shared with other completion scripts. By the time the completion -# function gets called, COMP_WORDS has already been populated so local -# changes to COMP_WORDBREAKS have no effect. -# -# Output: words_, cword_, cur_. - -__git_reassemble_comp_words_by_ref() -{ - local exclude i j first - # Which word separators to exclude? - exclude="${1//[^$COMP_WORDBREAKS]}" - cword_=$COMP_CWORD - if [ -z "$exclude" ]; then - words_=("${COMP_WORDS[@]}") - return - fi - # List of word completion separators has shrunk; - # re-assemble words to complete. - for ((i=0, j=0; i < ${#COMP_WORDS[@]}; i++, j++)); do - # Append each nonempty word consisting of just - # word separator characters to the current word. - first=t - while - [ $i -gt 0 ] && - [ -n "${COMP_WORDS[$i]}" ] && - # word consists of excluded word separators - [ "${COMP_WORDS[$i]//[^$exclude]}" = "${COMP_WORDS[$i]}" ] - do - # Attach to the previous token, - # unless the previous token is the command name. - if [ $j -ge 2 ] && [ -n "$first" ]; then - ((j--)) - fi - first= - words_[$j]=${words_[j]}${COMP_WORDS[i]} - if [ $i = $COMP_CWORD ]; then - cword_=$j - fi - if (($i < ${#COMP_WORDS[@]} - 1)); then - ((i++)) - else - # Done. - return - fi - done - words_[$j]=${words_[j]}${COMP_WORDS[i]} - if [ $i = $COMP_CWORD ]; then - cword_=$j - fi - done -} - -if ! type _get_comp_words_by_ref >/dev/null 2>&1; then -_get_comp_words_by_ref () -{ - local exclude cur_ words_ cword_ - if [ "$1" = "-n" ]; then - exclude=$2 - shift 2 - fi - __git_reassemble_comp_words_by_ref "$exclude" - cur_=${words_[cword_]} - while [ $# -gt 0 ]; do - case "$1" in - cur) - cur=$cur_ - ;; - prev) - prev=${words_[$cword_-1]} - ;; - words) - words=("${words_[@]}") - ;; - cword) - cword=$cword_ - ;; - esac - shift - done -} -fi - -# Fills the COMPREPLY array with prefiltered words without any additional -# processing. -# Callers must take care of providing only words that match the current word -# to be completed and adding any prefix and/or suffix (trailing space!), if -# necessary. -# 1: List of newline-separated matching completion words, complete with -# prefix and suffix. -__gitcomp_direct () -{ - local IFS=$'\n' - - COMPREPLY=($1) -} - -# Similar to __gitcomp_direct, but appends to COMPREPLY instead. -# Callers must take care of providing only words that match the current word -# to be completed and adding any prefix and/or suffix (trailing space!), if -# necessary. -# 1: List of newline-separated matching completion words, complete with -# prefix and suffix. -__gitcomp_direct_append () -{ - local IFS=$'\n' - - COMPREPLY+=($1) -} - -__gitcompappend () -{ - local x i=${#COMPREPLY[@]} - for x in $1; do - if [[ "$x" == "$3"* ]]; then - COMPREPLY[i++]="$2$x$4" - fi - done -} - -__gitcompadd () -{ - COMPREPLY=() - __gitcompappend "$@" -} - -# Generates completion reply, appending a space to possible completion words, -# if necessary. -# It accepts 1 to 4 arguments: -# 1: List of possible completion words. -# 2: A prefix to be added to each possible completion word (optional). -# 3: Generate possible completion matches for this word (optional). -# 4: A suffix to be appended to each possible completion word (optional). -__gitcomp () -{ - local cur_="${3-$cur}" - - case "$cur_" in - --*=) - ;; - --no-*) - local c i=0 IFS=$' \t\n' - for c in $1; do - if [[ $c == "--" ]]; then - continue - fi - c="$c${4-}" - if [[ $c == "$cur_"* ]]; then - case $c in - --*=|*.) ;; - *) c="$c " ;; - esac - COMPREPLY[i++]="${2-}$c" - fi - done - ;; - *) - local c i=0 IFS=$' \t\n' - for c in $1; do - if [[ $c == "--" ]]; then - c="--no-...${4-}" - if [[ $c == "$cur_"* ]]; then - COMPREPLY[i++]="${2-}$c " - fi - break - fi - c="$c${4-}" - if [[ $c == "$cur_"* ]]; then - case $c in - *=|*.) ;; - *) c="$c " ;; - esac - COMPREPLY[i++]="${2-}$c" - fi - done - ;; - esac -} - -# Clear the variables caching builtins' options when (re-)sourcing -# the completion script. -if [[ -n ${ZSH_VERSION-} ]]; then - unset ${(M)${(k)parameters[@]}:#__gitcomp_builtin_*} 2>/dev/null -else - unset $(compgen -v __gitcomp_builtin_) -fi - -# This function is equivalent to -# -# __gitcomp "$(git xxx --git-completion-helper) ..." -# -# except that the output is cached. Accept 1-3 arguments: -# 1: the git command to execute, this is also the cache key -# 2: extra options to be added on top (e.g. negative forms) -# 3: options to be excluded -__gitcomp_builtin () -{ - # spaces must be replaced with underscore for multi-word - # commands, e.g. "git remote add" becomes remote_add. - local cmd="$1" - local incl="${2-}" - local excl="${3-}" - - local var=__gitcomp_builtin_"${cmd/-/_}" - local options - eval "options=\${$var-}" - - if [ -z "$options" ]; then - local completion_helper - if [ "$GIT_COMPLETION_SHOW_ALL" = "1" ]; then - completion_helper="--git-completion-helper-all" - else - completion_helper="--git-completion-helper" - fi - # leading and trailing spaces are significant to make - # option removal work correctly. - options=" $incl $(__git ${cmd/_/ } $completion_helper) " || return - - for i in $excl; do - options="${options/ $i / }" - done - eval "$var=\"$options\"" - fi - - __gitcomp "$options" -} - -# Variation of __gitcomp_nl () that appends to the existing list of -# completion candidates, COMPREPLY. -__gitcomp_nl_append () -{ - local IFS=$'\n' - __gitcompappend "$1" "${2-}" "${3-$cur}" "${4- }" -} - -# Generates completion reply from newline-separated possible completion words -# by appending a space to all of them. -# It accepts 1 to 4 arguments: -# 1: List of possible completion words, separated by a single newline. -# 2: A prefix to be added to each possible completion word (optional). -# 3: Generate possible completion matches for this word (optional). -# 4: A suffix to be appended to each possible completion word instead of -# the default space (optional). If specified but empty, nothing is -# appended. -__gitcomp_nl () -{ - COMPREPLY=() - __gitcomp_nl_append "$@" -} - -# Fills the COMPREPLY array with prefiltered paths without any additional -# processing. -# Callers must take care of providing only paths that match the current path -# to be completed and adding any prefix path components, if necessary. -# 1: List of newline-separated matching paths, complete with all prefix -# path components. -__gitcomp_file_direct () -{ - local IFS=$'\n' - - COMPREPLY=($1) - - # use a hack to enable file mode in bash < 4 - compopt -o filenames +o nospace 2>/dev/null || - compgen -f /non-existing-dir/ >/dev/null || - true -} - -# Generates completion reply with compgen from newline-separated possible -# completion filenames. -# It accepts 1 to 3 arguments: -# 1: List of possible completion filenames, separated by a single newline. -# 2: A directory prefix to be added to each possible completion filename -# (optional). -# 3: Generate possible completion matches for this word (optional). -__gitcomp_file () -{ - local IFS=$'\n' - - # XXX does not work when the directory prefix contains a tilde, - # since tilde expansion is not applied. - # This means that COMPREPLY will be empty and Bash default - # completion will be used. - __gitcompadd "$1" "${2-}" "${3-$cur}" "" - - # use a hack to enable file mode in bash < 4 - compopt -o filenames +o nospace 2>/dev/null || - compgen -f /non-existing-dir/ >/dev/null || - true -} - -# Execute 'git ls-files', unless the --committable option is specified, in -# which case it runs 'git diff-index' to find out the files that can be -# committed. It return paths relative to the directory specified in the first -# argument, and using the options specified in the second argument. -__git_ls_files_helper () -{ - if [ "$2" == "--committable" ]; then - __git -C "$1" -c core.quotePath=false diff-index \ - --name-only --relative HEAD -- "${3//\\/\\\\}*" - else - # NOTE: $2 is not quoted in order to support multiple options - __git -C "$1" -c core.quotePath=false ls-files \ - --exclude-standard $2 -- "${3//\\/\\\\}*" - fi -} - - -# __git_index_files accepts 1 or 2 arguments: -# 1: Options to pass to ls-files (required). -# 2: A directory path (optional). -# If provided, only files within the specified directory are listed. -# Sub directories are never recursed. Path must have a trailing -# slash. -# 3: List only paths matching this path component (optional). -__git_index_files () -{ - local root="$2" match="$3" - - __git_ls_files_helper "$root" "$1" "${match:-?}" | - awk -F / -v pfx="${2//\\/\\\\}" '{ - paths[$1] = 1 - } - END { - for (p in paths) { - if (substr(p, 1, 1) != "\"") { - # No special characters, easy! - print pfx p - continue - } - - # The path is quoted. - p = dequote(p) - if (p == "") - continue - - # Even when a directory name itself does not contain - # any special characters, it will still be quoted if - # any of its (stripped) trailing path components do. - # Because of this we may have seen the same directory - # both quoted and unquoted. - if (p in paths) - # We have seen the same directory unquoted, - # skip it. - continue - else - print pfx p - } - } - function dequote(p, bs_idx, out, esc, esc_idx, dec) { - # Skip opening double quote. - p = substr(p, 2) - - # Interpret backslash escape sequences. - while ((bs_idx = index(p, "\\")) != 0) { - out = out substr(p, 1, bs_idx - 1) - esc = substr(p, bs_idx + 1, 1) - p = substr(p, bs_idx + 2) - - if ((esc_idx = index("abtvfr\"\\", esc)) != 0) { - # C-style one-character escape sequence. - out = out substr("\a\b\t\v\f\r\"\\", - esc_idx, 1) - } else if (esc == "n") { - # Uh-oh, a newline character. - # We cannot reliably put a pathname - # containing a newline into COMPREPLY, - # and the newline would create a mess. - # Skip this path. - return "" - } else { - # Must be a \nnn octal value, then. - dec = esc * 64 + \ - substr(p, 1, 1) * 8 + \ - substr(p, 2, 1) - out = out sprintf("%c", dec) - p = substr(p, 3) - } - } - # Drop closing double quote, if there is one. - # (There is not any if this is a directory, as it was - # already stripped with the trailing path components.) - if (substr(p, length(p), 1) == "\"") - out = out substr(p, 1, length(p) - 1) - else - out = out p - - return out - }' -} - -# __git_complete_index_file requires 1 argument: -# 1: the options to pass to ls-file -# -# The exception is --committable, which finds the files appropriate commit. -__git_complete_index_file () -{ - local dequoted_word pfx="" cur_ - - __git_dequote "$cur" - - case "$dequoted_word" in - ?*/*) - pfx="${dequoted_word%/*}/" - cur_="${dequoted_word##*/}" - ;; - *) - cur_="$dequoted_word" - esac - - __gitcomp_file_direct "$(__git_index_files "$1" "$pfx" "$cur_")" -} - -# Lists branches from the local repository. -# 1: A prefix to be added to each listed branch (optional). -# 2: List only branches matching this word (optional; list all branches if -# unset or empty). -# 3: A suffix to be appended to each listed branch (optional). -__git_heads () -{ - local pfx="${1-}" cur_="${2-}" sfx="${3-}" - - __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ - "refs/heads/$cur_*" "refs/heads/$cur_*/**" -} - -# Lists branches from remote repositories. -# 1: A prefix to be added to each listed branch (optional). -# 2: List only branches matching this word (optional; list all branches if -# unset or empty). -# 3: A suffix to be appended to each listed branch (optional). -__git_remote_heads () -{ - local pfx="${1-}" cur_="${2-}" sfx="${3-}" - - __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ - "refs/remotes/$cur_*" "refs/remotes/$cur_*/**" -} - -# Lists tags from the local repository. -# Accepts the same positional parameters as __git_heads() above. -__git_tags () -{ - local pfx="${1-}" cur_="${2-}" sfx="${3-}" - - __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ - "refs/tags/$cur_*" "refs/tags/$cur_*/**" -} - -# List unique branches from refs/remotes used for 'git checkout' and 'git -# switch' tracking DWIMery. -# 1: A prefix to be added to each listed branch (optional) -# 2: List only branches matching this word (optional; list all branches if -# unset or empty). -# 3: A suffix to be appended to each listed branch (optional). -__git_dwim_remote_heads () -{ - local pfx="${1-}" cur_="${2-}" sfx="${3-}" - local fer_pfx="${pfx//\%/%%}" # "escape" for-each-ref format specifiers - - # employ the heuristic used by git checkout and git switch - # Try to find a remote branch that cur_es the completion word - # but only output if the branch name is unique - __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ - --sort="refname:strip=3" \ - "refs/remotes/*/$cur_*" "refs/remotes/*/$cur_*/**" | \ - uniq -u -} - -# Lists refs from the local (by default) or from a remote repository. -# It accepts 0, 1 or 2 arguments: -# 1: The remote to list refs from (optional; ignored, if set but empty). -# Can be the name of a configured remote, a path, or a URL. -# 2: In addition to local refs, list unique branches from refs/remotes/ for -# 'git checkout's tracking DWIMery (optional; ignored, if set but empty). -# 3: A prefix to be added to each listed ref (optional). -# 4: List only refs matching this word (optional; list all refs if unset or -# empty). -# 5: A suffix to be appended to each listed ref (optional; ignored, if set -# but empty). -# -# Use __git_complete_refs() instead. -__git_refs () -{ - local i hash dir track="${2-}" - local list_refs_from=path remote="${1-}" - local format refs - local pfx="${3-}" cur_="${4-$cur}" sfx="${5-}" - local match="${4-}" - local fer_pfx="${pfx//\%/%%}" # "escape" for-each-ref format specifiers - - __git_find_repo_path - dir="$__git_repo_path" - - if [ -z "$remote" ]; then - if [ -z "$dir" ]; then - return - fi - else - if __git_is_configured_remote "$remote"; then - # configured remote takes precedence over a - # local directory with the same name - list_refs_from=remote - elif [ -d "$remote/.git" ]; then - dir="$remote/.git" - elif [ -d "$remote" ]; then - dir="$remote" - else - list_refs_from=url - fi - fi - - if [ "$list_refs_from" = path ]; then - if [[ "$cur_" == ^* ]]; then - pfx="$pfx^" - fer_pfx="$fer_pfx^" - cur_=${cur_#^} - match=${match#^} - fi - case "$cur_" in - refs|refs/*) - format="refname" - refs=("$match*" "$match*/**") - track="" - ;; - *) - for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD; do - case "$i" in - $match*) - if [ -e "$dir/$i" ]; then - echo "$pfx$i$sfx" - fi - ;; - esac - done - format="refname:strip=2" - refs=("refs/tags/$match*" "refs/tags/$match*/**" - "refs/heads/$match*" "refs/heads/$match*/**" - "refs/remotes/$match*" "refs/remotes/$match*/**") - ;; - esac - __git_dir="$dir" __git for-each-ref --format="$fer_pfx%($format)$sfx" \ - "${refs[@]}" - if [ -n "$track" ]; then - __git_dwim_remote_heads "$pfx" "$match" "$sfx" - fi - return - fi - case "$cur_" in - refs|refs/*) - __git ls-remote "$remote" "$match*" | \ - while read -r hash i; do - case "$i" in - *^{}) ;; - *) echo "$pfx$i$sfx" ;; - esac - done - ;; - *) - if [ "$list_refs_from" = remote ]; then - case "HEAD" in - $match*) echo "${pfx}HEAD$sfx" ;; - esac - __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ - "refs/remotes/$remote/$match*" \ - "refs/remotes/$remote/$match*/**" - else - local query_symref - case "HEAD" in - $match*) query_symref="HEAD" ;; - esac - __git ls-remote "$remote" $query_symref \ - "refs/tags/$match*" "refs/heads/$match*" \ - "refs/remotes/$match*" | - while read -r hash i; do - case "$i" in - *^{}) ;; - refs/*) echo "$pfx${i#refs/*/}$sfx" ;; - *) echo "$pfx$i$sfx" ;; # symbolic refs - esac - done - fi - ;; - esac -} - -# Completes refs, short and long, local and remote, symbolic and pseudo. -# -# Usage: __git_complete_refs [