From: Junio C Hamano Date: Mon, 2 Jul 2007 08:45:47 +0000 (-0700) Subject: Merge branch 'js/rebase' X-Git-Tag: v1.5.3-rc0~13 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f36db549057f09dd390d712fa2d72dd2599feba6?ds=inline;hp=-c Merge branch 'js/rebase' * js/rebase: Teach rebase -i about --preserve-merges rebase -i: provide reasonable reflog for the rebased branch rebase -i: several cleanups ignore git-rebase--interactive Teach rebase an interactive mode Move the pick_author code to git-sh-setup --- f36db549057f09dd390d712fa2d72dd2599feba6 diff --combined Makefile index 5d60dc8e12,4ea5e450bd..eed6bd5770 --- a/Makefile +++ b/Makefile @@@ -94,9 -94,9 +94,9 @@@ all: # Define OLD_ICONV if your library has an old iconv(), where the second # (input buffer pointer) parameter is declared with type (const char **). # -# Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that -# tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib" -# is used instead. +# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" +# that tells runtime paths to dynamic libraries; +# "-Wl,-rpath=/path/lib" is used instead. # # Define USE_NSEC below if you want git to care about sub-second file mtimes # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and @@@ -204,7 -204,7 +204,7 @@@ SCRIPT_SH = git-fetch.sh \ git-ls-remote.sh \ git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \ - git-pull.sh git-rebase.sh \ + git-pull.sh git-rebase.sh git-rebase--interactive.sh \ git-repack.sh git-request-pull.sh git-reset.sh \ git-sh-setup.sh \ git-tag.sh git-verify-tag.sh \ diff --combined git-sh-setup.sh index 0de49e8459,d861db3b28..98959600eb --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@@ -29,7 -29,11 +29,7 @@@ set_reflog_action() } is_bare_repository () { - git-config --bool --get core.bare || - case "$GIT_DIR" in - .git | */.git) echo false ;; - *) echo true ;; - esac + git-rev-parse --is-bare-repository } cd_to_toplevel () { @@@ -44,11 -48,38 +44,38 @@@ } require_work_tree () { - test $(is_bare_repository) = false && + test $(git-rev-parse --is-inside-work-tree) = true && test $(git-rev-parse --is-inside-git-dir) = false || die "fatal: $0 cannot be used without a working tree." } + get_author_ident_from_commit () { + pick_author_script=' + /^author /{ + s/'\''/'\''\\'\'\''/g + h + s/^author \([^<]*\) <[^>]*> .*$/\1/ + s/'\''/'\''\'\'\''/g + s/.*/GIT_AUTHOR_NAME='\''&'\''/p + + g + s/^author [^<]* <\([^>]*\)> .*$/\1/ + s/'\''/'\''\'\'\''/g + s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p + + g + s/^author [^<]* <[^>]*> \(.*\)$/\1/ + s/'\''/'\''\'\'\''/g + s/.*/GIT_AUTHOR_DATE='\''&'\''/p + + q + } + ' + encoding=$(git config i18n.commitencoding || echo UTF-8) + git show -s --pretty=raw --encoding="$encoding" "$1" | + LANG=C LC_ALL=C sed -ne "$pick_author_script" + } + if [ -z "$LONG_USAGE" ] then LONG_USAGE="Usage: $0 $USAGE"