summaryrefslogtreecommitdiff
path: root/git-rebase.sh
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'km/avoid-non-function-return-in-rebase'Junio C Hamano2014-04-211-10/+1
|\ | | | | | | | | | | | | | | | | Work around /bin/sh that does not like "return" at the top-level of a file that is dot-sourced from inside a function definition. * km/avoid-non-function-return-in-rebase: Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD" rebase: avoid non-function use of "return" on FreeBSD
| * Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"km/avoid-non-function-return-in-rebaseKyle J. McKay2014-04-171-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 99855ddf4bd319cd06a0524e755ab1c1b7d39f3b. The workaround 99855ddf introduced to deal with problematic "return" statements in scripts run by "dot" commands located inside functions only handles one part of the problem. The issue has now been addressed by not using "return" statements in this way in the git-rebase--*.sh scripts. This workaround is therefore no longer necessary, so clean up the code by reverting it. Signed-off-by: Kyle J. McKay <mackyle@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'bg/rebase-off-of-previous-branch'Junio C Hamano2014-03-281-0/+4
|\ \ | | | | | | | | | | | | * bg/rebase-off-of-previous-branch: rebase: allow "-" short-hand for the previous branch
| * | rebase: allow "-" short-hand for the previous branchBrian Gesiak2014-03-191-0/+4
| |/ | | | | | | | | | | | | | | | | | | Teach rebase the same shorthand as checkout and merge to name the branch to rebase the current branch on; that is, that "-" means "the branch we were previously on". Requested-by: Tim Chase <git@tim.thechases.com> Signed-off-by: Brian Gesiak <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase: add the --gpg-sign optionNicolas Vigier2014-02-111-0/+11
| | | | | | | | | | | | Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase: parse options in stuck-long modeNicolas Vigier2014-02-111-28/+22
| | | | | | | | | | | | | | | | | | There is no functional change. The reason for this change is to be able to add a new option taking an optional argument. Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase: don't try to match -M optionNicolas Vigier2014-02-031-1/+1
| | | | | | | | | | | | | | | | | | The -M option does not exist in OPTIONS_SPEC, so there is no use to try to find it. Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase: remove useless arguments checkNicolas Vigier2014-02-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove a check on the number of arguments for --onto and -x options. It is not possible for $# to be <= 2 at this point : - if --onto or -x has an argument, git rev-parse --parseopt will provide something like this : set -- --onto 'x' -- when parsing the "--onto" option, $# will be 3 or more if there are other options. - if --onto or -x doesn't have an argument, git rev-parse --parseopt will exit with an error and display usage information. Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-sh-setup.sh: add variable to use the stuck-long modeNicolas Vigier2014-02-031-0/+1
|/ | | | | | | | | If the variable $OPTIONS_STUCKLONG is not empty, then rev-parse option parsing is done in --stuck-long mode. Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: fix fork-point with zero argumentsJohn Keeping2014-01-091-1/+2
| | | | | | | | | | | | | | | | When no arguments are specified, $switch_to is empty so we end up passing the empty string to "git merge-base --fork-point", which causes an error. git-rebase carries on at this point, but in fact we have failed to apply the fork-point operation. It turns out that the test in t3400 that was meant to test this didn't actually need the fork-point behaviour, so enhance it to make sure that the fork-point is applied correctly. The modified test fails without the change to git-rebase.sh in this patch. Reported-by: Andreas Krey <a.krey@gmx.de> Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: use reflog to find common base with upstreamJohn Keeping2013-12-101-0/+19
| | | | | | | | | | | | | | | | | | | | | | Commit 15a147e (rebase: use @{upstream} if no upstream specified, 2011-02-09) says: Make it default to 'git rebase @{upstream}'. That is also what 'git pull [--rebase]' defaults to, so it only makes sense that 'git rebase' defaults to the same thing. but that isn't actually the case. Since commit d44e712 (pull: support rebased upstream + fetch + pull --rebase, 2009-07-19), pull has actually chosen the most recent reflog entry which is an ancestor of the current branch if it can find one. Add a '--fork-point' argument to git-rebase that can be used to trigger this behaviour. This option is turned on by default if no non-option arguments are specified on the command line, otherwise we treat an upstream specified on the command-line literally. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'mm/rebase-continue-freebsd-WB'Junio C Hamano2013-09-201-1/+10
|\ | | | | | | | | | | | | | | Work around a bug in FreeBSD shell that caused a regression to "git rebase" in v1.8.4. May need to be later applied to 'maint'. * mm/rebase-continue-freebsd-WB: rebase: fix run_specific_rebase's use of "return" on FreeBSD
| * rebase: fix run_specific_rebase's use of "return" on FreeBSDmm/rebase-continue-freebsd-WBMatthieu Moy2013-09-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since a1549e10, git-rebase--am.sh uses the shell's "return" statement, to mean "return from the current file inclusion", which is POSIXly correct, but badly interpreted on FreeBSD, which returns from the current function, hence skips the finish_rebase statement that follows the file inclusion. Make the use of "return" portable by using the file inclusion as the last statement of a function. Reported-by: Christoph Mallon <christoph.mallon@gmx.de> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rr/rebase-autostash'Junio C Hamano2013-07-311-1/+1
|\ \ | | | | | | | | | | | | * rr/rebase-autostash: git-rebase: fix typo
| * | git-rebase: fix typorr/rebase-autostashRalf Thielow2013-07-291-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'rr/rebase-reflog-message-reword'Junio C Hamano2013-07-181-2/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git rebase [-i]" used to leave just "rebase" as its reflog message for some operations. This rewords them to be more informative. * rr/rebase-reflog-message-reword: rebase -i: use a better reflog message rebase: use a better reflog message
| * | | rebase: use a better reflog messageRamkumar Ramachandra2013-06-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the "checkout" invoked internally from "rebase" knows to honor GIT_REFLOG_ACTION, we can start to use it to write a better reflog message when "rebase anotherbranch", "rebase --onto branch", etc. internally checks out the new fork point. We will write: rebase: checkout master instead of the old rebase Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'rr/rebase-stash-store'Junio C Hamano2013-06-271-5/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finishing touches for the "git rebase --autostash" feature introduced earlier. * rr/rebase-stash-store: rebase: use 'git stash store' to simplify logic stash: introduce 'git stash store' stash: simplify option parser for create stash doc: document short form -p in synopsis stash doc: add a warning about using create
| * | | | rebase: use 'git stash store' to simplify logicRamkumar Ramachandra2013-06-171-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rebase has no reason to know about the implementation of the stash. In the case when applying the autostash results in conflicts, replace the relevant code in finish_rebase () to simply call 'git stash store'. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'rr/rebase-sha1-by-string-query'Junio C Hamano2013-06-241-2/+2
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow various commit objects to be given to "git rebase" by ':/look for this string' syntax, e.g. "git rebase --onto ':/there'". * rr/rebase-sha1-by-string-query: rebase: use peel_committish() where appropriate sh-setup: add new peel_committish() helper t/rebase: add failing tests for a peculiar revision
| * | | | rebase: use peel_committish() where appropriateRamkumar Ramachandra2013-06-141-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The revisions specified on the command-line as <onto> and <upstream> arguments could be of the form :/quuxery; so, use peel_committish() to resolve them. The failing tests in t/rebase and t/rebase-interactive now pass. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | rebase: finish_rebase() in noop rebaseRamkumar Ramachandra2013-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the following case $ git rebase master Current branch autostash-fix is up to date. the autostash is not applied automatically, because this codepath forgets to call finish_rebase(). Fix this. Also add a test to guard against regressions. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | rebase: finish_rebase() in fast-forward rebaseRamkumar Ramachandra2013-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the following case $ git rebase master Fast-forwarded autostash-fix to master. The autostash is not applied automatically, because this codepath forgets to call finish_rebase(). Fix this. Also add a test to guard against regressions. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | rebase: guard against missing files in read_basic_state()Ramkumar Ramachandra2013-06-131-0/+2
|/ / / | | | | | | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | rebase: implement --[no-]autostash and rebase.autostashRamkumar Ramachandra2013-05-291-3/+42
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new feature allows a rebase to be executed on a dirty worktree or index. It works by creating a temporary "dangling merge commit" out of the worktree and index changes (via 'git stash create'), and automatically applying it after a successful rebase or abort. rebase stores the SHA-1 hex of the temporary merge commit, along with the rest of the rebase state, in either .git/{rebase-merge,rebase-apply}/autostash depending on the kind of rebase. Since $state_dir is automatically removed at the end of a successful rebase or abort, so is the autostash. The advantage of this approach is that we do not affect the normal stash's reflogs, making the autostash invisible to the end-user. This means that you can use 'git stash' during a rebase as usual. When the autostash application results in a conflict, we push $state_dir/autostash onto the normal stash and remove $state_dir ending the rebase. The user can inspect the stash, and pop or drop at any time. Most significantly, this feature means that a caller like pull (with pull.rebase set to true) can easily be patched to remove the require_clean_work_tree restriction. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase: prepare to do generic housekeepingRamkumar Ramachandra2013-05-121-0/+7
|/ | | | | | | | | | | | | | | | | | | | | | | On successful completion of a rebase in git-rebase--$backend.sh, the $backend script cleans up on its own and exits. The cleanup routine is however, independent of the $backend, and each $backend script unnecessarily duplicates this work: rm -rf "$state_dir" git gc --auto Prepare git-rebase.sh for later patches that return control from each $backend script back to us, for performing this generic cleanup routine. The code that this patch adds is currently unreachable, and will only start to be used when git-rebase--$backend.sh scripts are taught to return control in later patches. Another advantage is that git-rebase.sh can implement a generic finish_rebase() to possibly do additional tasks in addition to the cleanup. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ph/rebase-original'Junio C Hamano2013-04-261-1/+1
|\ | | | | | | | | * ph/rebase-original: rebase: find orig_head unambiguously
| * rebase: find orig_head unambiguouslyPhil Hord2013-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we 'git rebase $upstream', git uses 'rev-parse --verify $current_branch' to find ORIG_HEAD. But if $current_branch is ambiguous, 'rev-parse --verify' emits a warning and returns a SHA1 anyway. When the wrong ambiguous choice is used, git-rebase fails non-gracefully: it emits a warning about failing to lock $current_branch, an error about being unable to checkout $current_branch again, and it might even decide the rebase is a fast-forward when it is not. In the 'rebase $upstream' case, we already know the unambiguous spelling of $current_branch is "HEAD". Fix git-rebase to find $orig_head unambiguously. Add a test in t3400-rebase.sh which creates an ambiguous branch name and rebases it implicitly with 'git rebase $other'. Signed-off-by: Phil Hord <hordp@cisco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase -i: Teach "--edit-todo" actionAndrew Wong2012-09-171-2/+11
| | | | | | | | | | | | | | | | | | | | This allows users to edit the todo file while they're stopped in the middle of an interactive rebase. When this action is executed, all comments from the original todo file are stripped, and new help messages are appended to the end. Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase usage: subcommands can not be combined with -iMartin von Zweigbergk2012-09-171-1/+1
|/ | | | | | | | | | | | | | | | Since 95135b0 (rebase: stricter check of standalone sub command, 2011-02-06), git-rebase has not allowed to use -i together with e.g. --continue. Yet, when rebase started using OPTIONS_SPEC in 45e2acf (rebase: define options in OPTIONS_SPEC, 2011-02-28), the usage message included git-rebase [-i] --continue | --abort | --skip Remove the "[-i]" from this line. Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com> Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-rebase.sh: fix typo in an error messageRalf Thielow2012-08-011-1/+1
| | | | | | | | Fix a typo in the error messages which is shown if it seems that a rebase is already in progress. Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: remove obsolete and unused LONG_USAGE which breaks xgettextJiang Xin2012-07-261-25/+0
| | | | | | | | | | | | | | | | | | | Since there is a modern OPTIONS_SPEC variable in use in this script, the obsolete USAGE and LONG_USAGE variables are no longer used. Remove them. In addition, the obsolete LONG_USAGE variable has the following message in it: A'\''--B'\''--C'\'' And such complex LONG_USAGE message will break xgettext when extracting l10n messages (but if single quotes are removed from the message, xgettext works fine on 'git-rebase.sh'). Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* i18n: Rewrite gettext messages start with dashJiang Xin2012-07-261-1/+1
| | | | | | | | | | | | | | | | | Gettext message in a shell script should not start with '-', one workaround is adding '--' between gettext and the message, like: gettext -- "--exec option ..." But due to a bug in the xgettext extraction, xgettext can not extract the actual message for this case. Rewriting the message is a simpler and better solution. Reported-by: Vincent van Ravesteijn <vfr@lyx.org> Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* i18n: rebase: mark messages for translationJiang Xin2012-07-251-30/+34
| | | | | | | | | | | | | | | | Mark messages in git-rebase.sh for translation. While doing this Jonathan noticed that the comma usage and sentence structure of the resolvemsg was not quite right, so correct that and its cousins in git-am.sh and t/t0201-gettext-fallbacks.sh at the same time. Some tests would start to fail with GETTEXT_POISON turned on after this update. Use test_i18ncmp and test_i18ngrep where appropriate to mark strings that should only be checked in the C locale output to avoid such issues. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'cw/rebase-i-root'Junio C Hamano2012-07-151-2/+12
|\ | | | | | | | | | | | | | | | | | | "git rebase [-i] --root $tip" can now be used to rewrite all the history down to the root. * cw/rebase-i-root: t3404: make test 57 work with dash and others Add tests for rebase -i --root without --onto rebase -i: support --root without --onto
| * rebase -i: support --root without --ontoChris Webb2012-06-261-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow --root to be specified to rebase -i without --onto, making it possible to edit and re-order all commits right back to the root(s). If there is a conflict to be resolved when applying the first change, the user will expect a sane index and working tree to get sensible behaviour from git-diff and friends, so create a sentinel commit with an empty tree to rebase onto. Automatically squash the sentinel with any commits rebased directly onto it, so they end up as root commits in their own right and retain their authorship and commit message. Implicitly use rebase -i for non-interactive rebase of --root without an --onto argument now that rebase -i can correctly do this. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'mz/rebase-no-mbox'Junio C Hamano2012-07-131-1/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach "am --rebasing" codepath to grab authorship, log message and the patch text directly out of existing commits. This will help rebasing commits that have confusing "diff" output in their log messages. * mz/rebase-no-mbox: am: don't call mailinfo if $rebasing am --rebasing: get patch body from commit, not from mailbox rebase --root: print usage on too many args rebase: don't source git-sh-setup twice
| * | rebase --root: print usage on too many argsMartin von Zweigbergk2012-06-261-1/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just like git rebase --onto newbase upstream branch error displays the usage message, so should clearly git rebase --onto newbase --root branch error , but it doesn't. Instead, it ignores both "branch" and "error" and rebases the current HEAD. This is because we try to match the number of remainging arguments "$#", which fails to match "1" argument and matches the "*" that really should have been a "0". Make sure we display usage information when too many arguments are given. Also fail-fast in case of similar bugs in the future by matching on exactly 0 arguments and failing on unknown numbers. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase -i: teach "--exec <cmd>"Lucien Kong2012-06-131-3/+17
|/ | | | | | | | | | | | | | | | | | | | | During an interactive rebase session, it is sometimes desirable to run tests on each commit in the resulting history. This can be done by adding "exec <test command>" when editing the insn sheet, but the command used for testing is often the same for all resulting commits. By passing "--exec <cmd>" from the command line, automatically add these "exec" lines after each commit in the final history. To work well with the --autosquash option, these are added at the end of each run of "fixup" and "squash". Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr> Signed-off-by: Valentin Duperray <Valentin.Duperray@ensimag.imag.fr> Signed-off-by: Franck Jonas <Franck.Jonas@ensimag.imag.fr> Signed-off-by: Thomas Nguy <Thomas.Nguy@ensimag.imag.fr> Signed-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ef/maint-rebase-error-message'Junio C Hamano2012-06-011-1/+1
|\ | | | | | | | | | | By Erik Faye-Lund * ef/maint-rebase-error-message: rebase: report invalid commit correctly
| * rebase: report invalid commit correctlyErik Faye-Lund2012-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 9765b6a (rebase: align variable content, 2011-02-06), the code to error out was moved up one level. Unfortunately, one reference to a function parameter wasn't rewritten as it should, leading to the wrong parameter being errored on. This error was propagated by 71786f5 (rebase: factor out reference parsing, 2011-02-06) and merged in 78c6e0f (Merge branch 'mz/rebase', 2011-04-28). Correct this by reporting $onto_name istead. Reported-By: Manuela Hutter <manuelah@opera.com> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Do not autosquash in case of an implied interactive rebaseVincent van Ravesteijn2012-05-291-0/+1
| | | | | | | | | | | | | | | | | | The option to autosquash is only used in case of an interactive rebase. When merges are preserved, rebase uses an interactive rebase internally, but in this case autosquash should still be disabled. Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-rebase: add keep_empty flagNeil Horman2012-04-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a command line switch to git-rebase to allow a user the ability to specify that they want to keep any commits in a series that are empty. When git-rebase's type is am, then this option will automatically keep any commit that has a tree object identical to its parent. This patch changes the default behavior of interactive rebases as well. With this patch, git-rebase -i will produce a revision set passed to git-revision-editor, in which empty commits are commented out. Empty commits may be kept manually by uncommenting them. If the new --keep-empty option is used in an interactive rebase the empty commits will automatically all be uncommented in the editor. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Make git-{pull,rebase} message without tracking information friendliercn/pull-rebase-messageCarlos Martín Nieto2012-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current message is too long and at too low a level for anybody to understand it if they don't know about the configuration format already. The text about setting up a remote is superfluous and doesn't help understand or recover from the error that has happened. Show the usage more prominently and explain how to set up the tracking information. If there is only one remote, that name is used instead of the generic <remote>. Also simplify the message we print on detached HEAD to remove unnecessary information which is better left for the documentation. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jk/pull-rebase-with-work-tree'Junio C Hamano2011-10-171-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | * jk/pull-rebase-with-work-tree: pull,rebase: handle GIT_WORK_TREE better Conflicts: git-pull.sh
| * | pull,rebase: handle GIT_WORK_TREE betterJeff King2011-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can't currently run git-pull or git-rebase from outside of the work tree, even with GIT_WORK_TREE set, due to an overeager require_work_tree function. Commit e2eb527 documents this problem and provides the infrastructure for a fix, but left it to later commits to audit and update individual scripts. Changing these scripts to use require_work_tree_exists is easy to verify. We immediately call cd_to_toplevel, anyway. Therefore no matter which function we use, the state afterwards is one of: 1. We have a work tree, and we are at the top level. 2. We don't have a work tree, and we have died. The only catch is that we must also make sure no code that ran before the cd_to_toplevel assumed that we were already in the working tree. In this case, we will only have included shell libraries and called set_reflog_action, neither of which care about the current working directory at all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | misc-sh: fix up whitespace in some other .sh files.Jon Seymour2011-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found that the patched 4 files were different when this filter is applied. expand -i | unexpand --first-only This patch contains the corrected files. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'mz/doc-rebase-abort'Junio C Hamano2011-07-221-5/+5
|\ \ \ | | | | | | | | | | | | | | | | * mz/doc-rebase-abort: rebase: clarify "restore the original branch"
| * | | rebase: clarify "restore the original branch"Martin von Zweigbergk2011-07-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The description for 'git rebase --abort' currently says: Restore the original branch and abort the rebase operation. The "restore" can be misinterpreted to imply that the original branch was somehow in a broken state during the rebase operation. It is also not completely clear what "the original branch" is --- is it the branch that was checked out before the rebase operation was called or is the the branch that is being rebased (it is the latter)? Although both issues are made clear in the DESCRIPTION section, let us also make the entry in the OPTIONS secion more clear. Also remove the term "rebasing process" from the usage text, since the user already knows that the text is about "git rebase". Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'js/rebase-typo-branch-squelch-usage'Junio C Hamano2011-07-131-2/+1
|\ \ \ \ | |/ / / |/| | | | | | | | | | | * js/rebase-typo-branch-squelch-usage: rebase: do not print lots of usage hints after an obvious error message