From: Junio C Hamano Date: Tue, 31 Aug 2010 23:15:03 +0000 (-0700) Subject: Merge branch 'hv/autosquash-config' X-Git-Tag: v1.7.3-rc0~36 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a621859101370205d89a6fea7ba17839a43eb4ab?ds=inline;hp=-c Merge branch 'hv/autosquash-config' * hv/autosquash-config: add configuration variable for --autosquash option of interactive rebase --- a621859101370205d89a6fea7ba17839a43eb4ab diff --combined Documentation/config.txt index 05ec3fed89,9e3c48bd8c..19b6dc6dda --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -128,7 -128,7 +128,7 @@@ advice.*: when writing commit messages. Default: true. commitBeforeMerge:: Advice shown when linkgit:git-merge[1] refuses to - merge to avoid overwritting local changes. + merge to avoid overwriting local changes. Default: true. resolveConflict:: Advices shown by various commands when conflicts @@@ -418,7 -418,7 +418,7 @@@ Common unit suffixes of 'k', 'm', or 'g core.deltaBaseCacheLimit:: Maximum number of bytes to reserve for caching base objects - that multiple deltafied objects reference. By storing the + that may be referenced by multiple deltified objects. By storing the entire decompressed base objects in a cache Git is able to avoid unpacking and decompressing frequently used base objects multiple times. @@@ -563,7 -563,7 +563,7 @@@ not necessarily be the current director am.keepcr:: If true, git-am will call git-mailsplit for patches in mbox format with parameter '--keep-cr'. In this case git-mailsplit will - not remove `\r` from lines ending with `\r\n`. Can be overrriden + not remove `\r` from lines ending with `\r\n`. Can be overridden by giving '--no-keep-cr' from the command line. See linkgit:git-am[1], linkgit:git-mailsplit[1]. @@@ -826,11 -826,6 +826,11 @@@ diff.renames: will enable basic rename detection. If set to "copies" or "copy", it will detect copies, as well. +diff.ignoreSubmodules:: + Sets the default value of --ignore-submodules. Note that this + affects only 'git diff' Porcelain, and not lower level 'diff' + commands such as 'git diff-files'. + diff.suppressBlankEmpty:: A boolean to inhibit the standard behavior of printing a space before each empty output line. Defaults to false. @@@ -1007,7 -1002,7 +1007,7 @@@ gitcvs.usecrlfattr: If true, the server will look up the end-of-line conversion attributes for files to determine the '-k' modes to use. If the attributes force git to treat a file as text, - the '-k' mode will be left blank so cvs clients will + the '-k' mode will be left blank so CVS clients will treat it as text. If they suppress text conversion, the file will be set with '-kb' mode, which suppresses any newline munging the client might otherwise do. If the attributes do not allow @@@ -1248,15 -1243,6 +1248,15 @@@ http.noEPSV: support EPSV mode. Can be overridden by the 'GIT_CURL_FTP_NO_EPSV' environment variable. Default is false (curl will use EPSV). +http.useragent:: + The HTTP USER_AGENT string presented to an HTTP server. The default + value represents the version of the client git such as git/1.7.1. + This option allows you to override this value to a more common value + such as Mozilla/4.0. This may be necessary, for instance, if + connecting through a firewall that restricts HTTP connections to a set + of common USER_AGENT strings (but not including those like git/1.7.1). + Can be overridden by the 'GIT_HTTP_USER_AGENT' environment variable. + i18n.commitEncoding:: Character encoding the commit messages are stored in; git itself does not care per se, but this information is necessary e.g. when @@@ -1289,9 -1275,7 +1289,9 @@@ instaweb.local: be bound to the local IP (127.0.0.1). instaweb.modulepath:: - The module path for an apache httpd used by linkgit:git-instaweb[1]. + The default module path for linkgit:git-instaweb[1] to use + instead of /usr/lib/apache2/modules. Only used if httpd + is Apache. instaweb.port:: The port number to bind the gitweb httpd to. See @@@ -1549,6 -1533,9 +1549,9 @@@ rebase.stat: Whether to show a diffstat of what changed upstream since the last rebase. False by default. + rebase.autosquash:: + If set to true enable '--autosquash' option by default. + receive.autogc:: By default, git-receive-pack will run "git-gc --auto" after receiving data from git-push and updating refs. You can stop @@@ -1574,10 -1561,6 +1577,10 @@@ receive.denyDeletes: If set to true, git-receive-pack will deny a ref update that deletes the ref. Use this to prevent such a ref deletion via a push. +receive.denyDeleteCurrent:: + If set to true, git-receive-pack will deny a ref update that + deletes the currently checked out branch of a non-bare repository. + receive.denyCurrentBranch:: If set to true or "refuse", git-receive-pack will deny a ref update to the currently checked out branch of a non-bare repository. @@@ -1754,28 -1737,6 +1757,28 @@@ status.submodulesummary: summary of commits for modified submodules will be shown (see --summary-limit option of linkgit:git-submodule[1]). +submodule..path:: +submodule..url:: +submodule..update:: + The path within this project, URL, and the updating strategy + for a submodule. These variables are initially populated + by 'git submodule init'; edit them to override the + URL and other values found in the `.gitmodules` file. See + linkgit:git-submodule[1] and linkgit:gitmodules[5] for details. + +submodule..ignore:: + Defines under what circumstances "git status" and the diff family show + a submodule as modified. When set to "all", it will never be considered + modified, "dirty" will ignore all changes to the submodules work tree and + takes only differences between the HEAD of the submodule and the commit + recorded in the superproject into account. "untracked" will additionally + let submodules with modified tracked files in their work tree show up. + Using "none" (the default when this option is not set) also shows + submodules that have untracked files in their work tree as changed. + This setting overrides any setting made in .gitmodules for this submodule, + both settings can be overridden on the command line by using the + "--ignore-submodules" option. + tar.umask:: This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the diff --combined Documentation/git-rebase.txt index 3b87f1a1b6,911b1380f3..45c52d2e57 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@@ -199,6 -199,9 +199,9 @@@ rebase.stat: Whether to show a diffstat of what changed upstream since the last rebase. False by default. + rebase.autosquash:: + If set to true enable '--autosquash' option by default. + OPTIONS ------- :: @@@ -250,13 -253,6 +253,13 @@@ on top of the branch using t the 'ours' strategy simply discards all patches from the , which makes little sense. +-X :: +--strategy-option=:: + Pass the through to the merge strategy. + This implies `\--merge` and, if no strategy has been + specified, `-s recursive`. Note the reversal of 'ours' and + 'theirs' as noted in above for the `-m` option. + -q:: --quiet:: Be quiet. Implies --no-stat. @@@ -333,6 -329,7 +336,7 @@@ idea unless you know what you are doin instead. --autosquash:: + --no-autosquash:: When the commit log message begins with "squash! ..." (or "fixup! ..."), and there is a commit whose title begins with the same ..., automatically modify the todo list of rebase -i @@@ -341,6 -338,10 +345,10 @@@ commit from `pick` to `squash` (or `fixup`). + This option is only valid when the '--interactive' option is used. + + + If the '--autosquash' option is enabled by default using the + configuration variable `rebase.autosquash`, this option can be + used to override and disable this setting. --no-ff:: With --interactive, cherry-pick all rebased commits instead of @@@ -466,30 -467,6 +474,30 @@@ sure that the current HEAD is "B", and $ git rebase -i -p --onto Q O ----------------------------- +Reordering and editing commits usually creates untested intermediate +steps. You may want to check that your history editing did not break +anything by running a test, or at least recompiling at intermediate +points in history by using the "exec" command (shortcut "x"). You may +do so by creating a todo list like this one: + +------------------------------------------- +pick deadbee Implement feature XXX +fixup f1a5c00 Fix to feature XXX +exec make +pick c0ffeee The oneline of the next commit +edit deadbab The oneline of the commit after +exec cd subdir; make test +... +------------------------------------------- + +The interactive rebase will stop when a command fails (i.e. exits with +non-0 status) to give you an opportunity to fix the problem. You can +continue with `git rebase --continue`. + +The "exec" command launches the command in a shell (the one specified +in `$SHELL`, or the default shell if `$SHELL` is not set), so you can +use shell features (like "cd", ">", ";" ...). The command is run from +the root of the working tree. SPLITTING COMMITS ----------------- diff --combined git-rebase--interactive.sh index 3419247d03,7b35f80818..4d14b077d2 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@@ -111,6 -111,7 +111,7 @@@ VERBOSE OK_TO_SKIP_PRE_REBASE= REBASE_ROOT= AUTOSQUASH= + test "$(git config --bool rebase.autosquash)" = "true" && AUTOSQUASH=t NEVER_FF= GIT_CHERRY_PICK_HELP=" After resolving the conflicts, @@@ -119,7 -120,7 +120,7 @@@ run 'git rebase --continue' export GIT_CHERRY_PICK_HELP warn () { - echo "$*" >&2 + printf '%s\n' "$*" >&2 } output () { @@@ -263,10 -264,10 +264,10 @@@ pick_one_preserving_merges () then if test "$fast_forward" = t then - cat "$DOTEST"/current-commit | while read current_commit + while read current_commit do git rev-parse HEAD > "$REWRITTEN"/$current_commit - done + done <"$DOTEST"/current-commit rm "$DOTEST"/current-commit || die "Cannot write current commit's replacement sha1" fi @@@ -440,9 -441,9 +441,9 @@@ record_in_rewritten() echo "$oldsha1" >> "$REWRITTEN_PENDING" case "$(peek_next_command)" in - squash|s|fixup|f) + squash|s|fixup|f) ;; - *) + *) flush_rewritten_pending ;; esac @@@ -450,7 -451,7 +451,7 @@@ do_next () { rm -f "$MSG" "$AUTHOR_SCRIPT" "$AMEND" || exit - read command sha1 rest < "$TODO" + read -r command sha1 rest < "$TODO" case "$command" in '#'*|''|noop) mark_action_done @@@ -537,34 -538,6 +538,34 @@@ esac record_in_rewritten $sha1 ;; + x|"exec") + read -r command rest < "$TODO" + mark_action_done + printf 'Executing: %s\n' "$rest" + # "exec" command doesn't take a sha1 in the todo-list. + # => can't just use $sha1 here. + git rev-parse --verify HEAD > "$DOTEST"/stopped-sha + ${SHELL:-@SHELL_PATH@} -c "$rest" # Actual execution + status=$? + if test "$status" -ne 0 + then + warn "Execution failed: $rest" + warn "You can fix the problem, and then run" + warn + warn " git rebase --continue" + warn + exit "$status" + fi + # Run in subshell because require_clean_work_tree can die. + if ! (require_clean_work_tree) + then + warn "Commit or stash your changes, and then run" + warn + warn " git rebase --continue" + warn + exit 1 + fi + ;; *) warn "Unknown command: $command $sha1 $rest" if git rev-parse --verify -q "$sha1" >/dev/null @@@ -619,30 -592,22 +620,30 @@@ do_rest () # skip picking commits whose parents are unchanged skip_unnecessary_picks () { fd=3 - while read command sha1 rest + while read -r command rest do # fd=3 means we skip the command - case "$fd,$command,$(git rev-parse --verify --quiet $sha1^)" in - 3,pick,"$ONTO"*|3,p,"$ONTO"*) + case "$fd,$command" in + 3,pick|3,p) # pick a commit whose parent is current $ONTO -> skip - ONTO=$sha1 + sha1=$(printf '%s' "$rest" | cut -d ' ' -f 1) + case "$(git rev-parse --verify --quiet "$sha1"^)" in + "$ONTO"*) + ONTO=$sha1 + ;; + *) + fd=1 + ;; + esac ;; - 3,#*|3,,*) + 3,#*|3,) # copy comments ;; *) fd=1 ;; esac - echo "$command${sha1:+ }$sha1${rest:+ }$rest" >&$fd + printf '%s\n' "$command${rest:+ }$rest" >&$fd done <"$TODO" >"$TODO.new" 3>>"$DONE" && mv -f "$TODO".new "$TODO" && case "$(peek_next_command)" in @@@ -680,17 -645,17 +681,17 @@@ rearrange_squash () test -s "$1.sq" || return used= - while read pick sha1 message + while read -r pick sha1 message do case " $used" in *" $sha1 "*) continue ;; esac - echo "$pick $sha1 $message" - while read squash action msg + printf '%s\n' "$pick $sha1 $message" + while read -r squash action msg do case "$message" in "$msg"*) - echo "$action $squash $action! $msg" + printf '%s\n' "$action $squash $action! $msg" used="$used$squash " ;; esac @@@ -831,6 -796,9 +832,9 @@@ first and then run 'git rebase --contin --autosquash) AUTOSQUASH=t ;; + --no-autosquash) + AUTOSQUASH= + ;; --onto) shift ONTO=$(parse_onto "$1") || @@@ -926,12 -894,11 +930,12 @@@ git rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \ --abbrev=7 --reverse --left-right --topo-order \ $REVISIONS | \ - sed -n "s/^>//p" | while read shortsha1 rest + sed -n "s/^>//p" | + while read -r shortsha1 rest do if test t != "$PRESERVE_MERGES" then - echo "pick $shortsha1 $rest" >> "$TODO" + printf '%s\n' "pick $shortsha1 $rest" >> "$TODO" else sha1=$(git rev-parse $shortsha1) if test -z "$REBASE_ROOT" @@@ -950,7 -917,7 +954,7 @@@ if test f = "$preserve" then touch "$REWRITTEN"/$sha1 - echo "pick $shortsha1 $rest" >> "$TODO" + printf '%s\n' "pick $shortsha1 $rest" >> "$TODO" fi fi done @@@ -993,7 -960,6 +997,7 @@@ # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message +# x , exec = Run a shell command , and stop if it fails # # If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove everything, the rebase will be aborted.