summaryrefslogtreecommitdiff
path: root/git-rebase.sh
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'os/fix-rebase-diff-no-prefix'Junio C Hamano2010-09-151-0/+1
|\ | | | | | | | | * os/fix-rebase-diff-no-prefix: Add --src/dst-prefix to git-formt-patch in git-rebase.sh
| * Add --src/dst-prefix to git-formt-patch in git-rebase.shOded Shimon2010-09-091-0/+1
| | | | | | | | | | | | | | | | For the case of "diff.noprefix" in git-config, git-format-patch should still output diff with standard prefixes for git-am Signed-off-by: Oded Shimon <ods15@ods15.dyndns.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Merge branch 'jn/rebase-rename-am' into maintJunio C Hamano2010-08-201-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * jn/rebase-rename-am: rebase: protect against diff.renames configuration t3400 (rebase): whitespace cleanup Teach "apply --index-info" to handle rename patches t4150 (am): futureproof against failing tests t4150 (am): style fix
* | \ Merge branch 'ml/rebase-x-strategy'Junio C Hamano2010-08-181-1/+23
|\ \ \ | | | | | | | | | | | | | | | | * ml/rebase-x-strategy: rebase: support -X to pass through strategy options
| * | | rebase: support -X to pass through strategy optionsMike Lundy2010-08-031-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-rebase calls out to merge strategies, but did not support merge strategy options so far. Add this, in the same style used in git-merge. Sadly we have to do the full quoting/eval dance here, since merge-recursive supports the --subtree=<path> option which potentially contains whitespace. This patch does not cover git rebase -i, which does not call any merge strategy directly except in --preserve-merges, and even then only for merges. [jc: with a trivial fix-up for 'expr'] Signed-off-by: Mike Lundy <mike@fluffypenguin.org> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jn/rebase-rename-am'Junio C Hamano2010-08-181-1/+1
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | | | | | | | | | | * jn/rebase-rename-am: rebase: protect against diff.renames configuration t3400 (rebase): whitespace cleanup Teach "apply --index-info" to handle rename patches t4150 (am): futureproof against failing tests t4150 (am): style fix
| * | rebase: protect against diff.renames configurationJunio C Hamano2010-07-231-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently do not disable diff.renames configuration while rebase internally runs "format-patch" to feed "am -3". The end user configuration for "diff" should not affect the result produced by the higher level command that is related to "diff" only because internally it is implemented in terms of it. For that matter, I have a feeling that format-patch should not even look at diff.renames, but we seem to have been doing this for a long time so there is no easy way to fix this thinko. In any case, here is a much straightforward fix for "rebase". [jn: with test case from David] Reported-by: David D. Kilzer <ddkilzer@kilzer.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-rebase: fix typo when parsing --force-rebaseWilly Tarreau2010-08-091-1/+1
| | | | | | | | | | | | | | | | Due to two missing hyphens, The "force" keyword on the command line would be taken as an alias for the --force-rebase option. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix git rebase --continue to work with touched filesDavid D. Kilzer2010-07-281-0/+1
|/ | | | | | | | | | | | | | | | | | | | | When performing a non-interactive rebase, sometimes "git rebase --continue" will fail if an unmodified file is touched in the working directory: You must edit all merge conflicts and then mark them as resolved using git add This is caused by "git diff-files" reporting a difference between the index and the filesystem: :100644 100644 d00491...... 000000...... M file The fix is to run "git update-index --refresh" before "git diff-files" as is done in git-rebase--interactive. Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: improve error message when upstream argument is missingJonathan Nieder2010-05-311-9/+8
| | | | | | | | | | | | | | | | | | | | Strip out options before checking for a missing upstream argument. Before: $ git rebase -m shift: 426: can't shift that many After: $ git rebase -m Usage: git rebase ... While at it, fix the usage message to explain that the upstream argument is mandatory. Reported-by: Jon Dowland <jmtd@debian.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'mb/rebase-i-no-ff'Junio C Hamano2010-04-031-2/+2
|\ | | | | | | | | | | | | | | | | * mb/rebase-i-no-ff: Teach rebase the --no-ff option. Conflicts: git-rebase--interactive.sh t/t3404-rebase-interactive.sh
| * Teach rebase the --no-ff option.Marc Branchaud2010-03-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For git-rebase.sh, --no-ff is a synonym for --force-rebase. For git-rebase--interactive.sh, --no-ff cherry-picks all the commits in the rebased branch, instead of fast-forwarding over any unchanged commits. --no-ff offers an alternative way to deal with reverted merges. Instead of "reverting the revert" you can use "rebase --no-ff" to recreate the branch with entirely new commits (they're new because at the very least the committer time is different). This obviates the need to revert the reversion, as you can re-merge the new topic branch directly. Added an addendum to revert-a-faulty-merge.txt describing the situation and how to use --no-ff to handle it. Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'tr/notes-display'Junio C Hamano2010-03-241-0/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tr/notes-display: git-notes(1): add a section about the meaning of history notes: track whether notes_trees were changed at all notes: add shorthand --ref to override GIT_NOTES_REF commit --amend: copy notes to the new commit rebase: support automatic notes copying notes: implement helpers needed for note copying during rewrite notes: implement 'git notes copy --stdin' rebase -i: invoke post-rewrite hook rebase: invoke post-rewrite hook commit --amend: invoke post-rewrite hook Documentation: document post-rewrite hook Support showing notes from more than one notes tree test-lib: unset GIT_NOTES_REF to stop it from influencing tests Conflicts: git-am.sh refs.c
| * rebase: support automatic notes copyingThomas Rast2010-03-121-0/+1
| | | | | | | | | | | | | | Luckily, all the support already happens to be there. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * rebase: invoke post-rewrite hookThomas Rast2010-03-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to deal with two separate code paths: a normal rebase, which actually goes through git-am; and rebase {-m|-s}. The only small issue with both is that they need to remember the original sha1 across a possible conflict resolution. rebase -m already puts this information in $dotest/current, and we just introduce a similar file for git-am. Note that in git-am, the hook really only runs when coming from git-rebase: the code path that sets the $dotest/original-commit file is guarded by a test for $dotest/rebasing. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase: don't invoke the pager for each commit summaryMarkus Heidelberg2010-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This regression was introduced by commit 0aa958d (rebase: replace antiquated sed invocation, 2010-01-24), which changed the invocation of "git rev-list | sed" to "git log". It can be reproduced by something like this: $ git rebase -s recursive origin/master Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase: replace antiquated sed invocationStephen Boyd2010-01-251-4/+2
|/ | | | | | | | Use the modern form of printing a commit subject instead of piping the output of rev-list to sed. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jc/rerere'Junio C Hamano2010-01-181-1/+5
|\ | | | | | | | | * jc/rerere: Teach --[no-]rerere-autoupdate option to merge, revert and friends
| * Teach --[no-]rerere-autoupdate option to merge, revert and friendsJunio C Hamano2009-12-041-1/+5
| | | | | | | | | | | | | | Introduce a command line option to override rerere.autoupdate configuration variable to make it more useful. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jc/checkout-merge-base'Junio C Hamano2010-01-131-1/+23
|\ \ | |/ |/| | | | | | | | | | | * jc/checkout-merge-base: rebase -i: teach --onto A...B syntax rebase: fix --onto A...B parsing and add tests "rebase --onto A...B" replays history on the merge base between A and B "checkout A...B" switches to the merge base between A and B
| * rebase: fix --onto A...B parsing and add testsNanako Shiraishi2010-01-071-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous patch didn't parse "rebase --onto A...B" correctly when A isn't an empty string. It also tried to be careful to notice a case in which there are more than one merge bases, but forgot to give --all option to merge-base, making the test pointless. Fix these problems and add a test script to verify. Improvements to the script to parse A...B syntax was taken from review comments by Johannes Schindelin. Signed-off-by: しらいし ななこ <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * "rebase --onto A...B" replays history on the merge base between A and BJunio C Hamano2009-11-211-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in spirit similar to "checkout A...B". To re-queue a new set of patches for a series that the original author prepared to apply on 'next' on the same base as before, you would do something like this: $ git checkout next^0 $ git am -s rerolled-series.mbox $ git rebase --onto next...jh/notes next The first two commands recreates commits to be rebased as the original author intended (i.e. applies directly on top of 'next'), and the rebase command replays that history on top of the same commit the series being replaced was built on (which is typically much older than the tip of 'next'). Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rs/work-around-grep-opt-insanity'Junio C Hamano2009-11-251-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * rs/work-around-grep-opt-insanity: Protect scripted Porcelains from GREP_OPTIONS insanity mergetool--lib: simplify guess_merge_tool() Conflicts: git-instaweb.sh
| * | Protect scripted Porcelains from GREP_OPTIONS insanityJunio C Hamano2009-11-231-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user has exported the GREP_OPTIONS environment variable, the output from "grep" and "egrep" in scripted Porcelains may be different from what they expect. For example, we may want to count number of matching lines, by "grep" piped to "wc -l", and GREP_OPTIONS=-C3 will break such use. The approach taken by this change to address this issue is to protect only our own use of grep/egrep. Because we do not unset it at the beginning of our scripts, hook scripts run from the scripted Porcelains are exposed to the same insanity this environment variable causes when grep/egrep is used to implement logic (e.g. "grep | wc -l"), and it is entirely up to the hook scripts to protect themselves. On the other hand, applypatch-msg hook may want to show offending words in the proposed commit log message using grep to the end user, and the user might want to set GREP_OPTIONS=--color to paint the match more visibly. The approach to protect only our own use without unsetting the environment variable globally will allow this use case. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Use 'fast-forward' all over the placeFelipe Contreras2009-10-241-1/+1
|/ | | | | | | It's a compound word. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: use plumbing to show dirty stateJeff King2009-09-111-1/+1
| | | | | | | | | | | | | Commit 4cfbe06 introduced the use of "git diff" to show dirty state in a format more familiar to users. However, it should have used the plumbing "git diff-files" instead. Not only is it good practice in general to use plumbing in scripts, but in this case we really don't want the automatic pager to kick in for an error message. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'gb/apply-ignore-whitespace'Junio C Hamano2009-08-211-0/+3
|\ | | | | | | | | * gb/apply-ignore-whitespace: git apply: option to ignore whitespace differences
| * git apply: option to ignore whitespace differencesGiuseppe Bilotta2009-08-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Introduce --ignore-whitespace option and corresponding config bool to ignore whitespace differences while applying patches, akin to the 'patch' program. 'git am', 'git rebase' and the bash git completion are made aware of this option. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase: consistent error messages for staged and unstaged changes.Matthieu Moy2009-08-061-2/+4
|/ | | | | | | | | | | Previous version expose the output of the plumbing update-index to the user, which novice users have difficulty to understand. We still need to run update-index to refresh the cache (if diff.autorefreshindex is false, git diff won't do it). Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'sb/quiet-porcelains'Junio C Hamano2009-07-011-10/+38
|\ | | | | | | | | | | | | | | | | | | * sb/quiet-porcelains: stash: teach quiet option am, rebase: teach quiet option submodule, repack: migrate to git-sh-setup's say() git-sh-setup: introduce say() for quiet options am: suppress apply errors when using 3-way t4150: test applying with a newline in subject
| * am, rebase: teach quiet optionStephen Boyd2009-06-181-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-am and git-rebase are talkative scripts. Teach them to be quiet when told, allowing them to speak only when they fail or experience errors. The quiet option is maintained when git-am or git-rebase fails to apply a patch. This means subsequent --resolved, --continue, --skip, --abort invocations will be quiet if the original invocation was quiet. Drop a handful of >&2 redirection; the rest of the program sends all the info messages to stdout, not to stderr. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | pull, rebase: simplify to use die()Stephen Boyd2009-06-141-6/+3
|/ | | | | Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: fix typo (force_rebas -> force-rebas)Michele Ballabio2009-03-271-1/+1
| | | | | Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: add options passed to git-amMichele Ballabio2009-03-181-0/+4
| | | | | | | | | Add the options --committer-date-is-author-date and --ignore-date to git-rebase. They were introduced in commit a79ec62d0 for git-am. These options imply --force-rebase. Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'tv/rebase-stat'Junio C Hamano2009-03-111-7/+18
|\ | | | | | | | | | | * tv/rebase-stat: git-pull: Allow --stat and --no-stat to be used with --rebase git-rebase: Add --stat and --no-stat for producing diffstat on rebase
| * git-rebase: Add --stat and --no-stat for producing diffstat on rebaseTor Arne Vestbø2009-03-021-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | The behavior of --verbose is unchanged, but uses a different state variable internally, so that the meaning of verbose output may be expanded without affecting the diffstat. This is also reflected in the documentation. The configuration option rebase.stat works the same was as merg.stat, but the default is currently false. Signed-off-by: Tor Arne Vestbø <torarnv@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'sr/force-rebase'Junio C Hamano2009-03-051-5/+19
|\ \ | |/ |/| | | | | * sr/force-rebase: Teach rebase to rebase even if upstream is up to date
| * Teach rebase to rebase even if upstream is up to dateSverre Rabbelier2009-02-131-5/+19
| | | | | | | | | | | | | | | | | | | | Normally, if the current branch is up to date, the rebase is aborted. However, it may be desirable to allow rebasing even if the current branch is up to date. When using the '--whitespace=fix' option -f is implied. Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | disallow providing multiple upstream branches to rebase, pull --rebaseJay Soffian2009-02-181-0/+1
|/ | | | | | | | It does not make sense to provide multiple upstream branches to either git pull --rebase, or to git rebase, so disallow both. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: learn to rebase root commitThomas Rast2009-01-111-16/+40
| | | | | | | | | | | | | | | | | | Teach git-rebase a new option --root, which instructs it to rebase the entire history leading up to <branch>. This option must be used with --onto <newbase>, and causes commits that already exist in <newbase> to be skipped. (Normal operation skips commits that already exist in <upstream> instead.) One possible use-case is with git-svn: suppose you start hacking (perhaps offline) on a new project, but later notice you want to commit this work to SVN. You will have to rebase the entire history, including the root commit, on a (possibly empty) commit coming from git-svn, to establish a history connection. This previously had to be done by cherry-picking the root commit manually. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: improve error messages about dirty stateJeff King2008-12-101-3/+6
| | | | | | | | | | | | | | | | | | | | If you have unstaged changes in your working tree and try to rebase, you will get the cryptic "foo: needs update" message, but nothing else. If you have staged changes, you get "your index is not up-to-date". Let's improve this situation in two ways: - for unstaged changes, let's also tell them we are canceling the rebase, and why (in addition to the "needs update" lines) - for the staged changes case, let's use language that is a little more clear to the user: their index contains uncommitted changes Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: use git rev-parse -qMiklos Vajna2008-12-031-2/+2
| | | | | Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ae/preservemerge'Junio C Hamano2008-10-191-3/+19
|\ | | | | | | | | * ae/preservemerge: rebase: Support preserving merges in non-interactive mode
| * rebase: Support preserving merges in non-interactive modeAndreas Ericsson2008-09-301-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a result of implementation details, 'git rebase' could previously only preserve merges in interactive mode. That limitation was hard for users to understand and awkward to explain. This patch works around it by running the interactive rebase helper git-rebase--interactive with GIT_EDITOR set to ':' when the user passes "-p" but not "-i" to the rebase command. The effect is that the interactive rebase helper is used but the user never sees an editor. The test-case included in this patch was originally written by Stephen Habermann <stephen@exigencecorp.com>, but has been extensively modified since its creation. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | rebase --no-verifyNanako Shiraishi2008-10-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | It is sometimes desirable to disable the safety net of pre-rebase hook when the user knows what he is doing (for example, when the original changes on the branch have not been shown to the public yet). This teaches --no-verify option to git-rebase, which is similar to the way pre-commit hook is bypassed by git-commit. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Teach rebase -i to honor pre-rebase hookNanako Shiraishi2008-10-061-7/+11
|/ | | | | | | | | The original git-rebase honored pre-rebase hook so that public branches can be protected from getting rebased, but rebase --interactive ignored the hook entirely. This fixes it. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Improve error output of git-rebaseStephan Beyer2008-08-161-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | "git rebase" without arguments on initial startup showed: fatal: Needed a single revision invalid upstream This patch makes it show the ordinary usage string. If .git/rebase-merge or .git/rebase-apply/rebasing exists, git-rebase will die with a message saying that a rebase is in progress and the user should try --skip/--abort/--continue. If .git/rebase-apply/applying exists, git-rebase will die with a message saying that git-am is in progress, regardless how many arguments are given. If no arguments are given and .git/rebase-apply/ exists, but neither a rebasing nor applying file is in that directory, git-rebase dies with a message saying that rebase-apply exists and no arguments were given. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Rename .git/rebase to .git/rebase-applyJohannes Schindelin2008-07-211-23/+25
| | | | | | | | | | With git-am, it sounds awkward to have the patches in ".git/rebase/", but for technical reasons, we have to keep the same directory name for git-am and git-rebase. ".git/rebase-apply" seems to be a good compromise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'rs/rebase-checkout-not-so-quiet'Junio C Hamano2008-07-161-2/+1
|\ | | | | | | | | | | | | | | * rs/rebase-checkout-not-so-quiet: git-rebase: report checkout failure Conflicts: git-rebase.sh
| * git-rebase: report checkout failureJunio C Hamano2008-07-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | When detaching the HEAD to the base commit, the "git checkout" command could fail if, for example, upstream contains a file that would overrwrite a local, untracked file. Unconditionally discarding the standard error stream was done to squelch the progress and notices back when checkout did not have -q option, but there is no reason to keep doing it anymore. Noticed by Robert Shearman. Signed-off-by: Junio C Hamano <gitster@pobox.com>