1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-25 06:36:11 +02:00
Commit Graph

241 Commits

Author SHA1 Message Date
Lucien Kong c214538416 rebase -i: teach "--exec <cmd>"
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>
2012-06-13 15:25:44 -07:00
Junio C Hamano d274fc093c Merge branch 'jk/doc-asciidoc-inline-literal'
Our documentation was written for an ancient version of AsciiDoc,
making the source not very readable.

By Jeff King
* jk/doc-asciidoc-inline-literal:
  docs: stop using asciidoc no-inline-literal
2012-05-02 13:51:45 -07:00
Jeff King 6cf378f0cb docs: stop using asciidoc no-inline-literal
In asciidoc 7, backticks like `foo` produced a typographic
effect, but did not otherwise affect the syntax. In asciidoc
8, backticks introduce an "inline literal" inside which markup
is not interpreted. To keep compatibility with existing
documents, asciidoc 8 has a "no-inline-literal" attribute to
keep the old behavior. We enabled this so that the
documentation could be built on either version.

It has been several years now, and asciidoc 7 is no longer
in wide use. We can now decide whether or not we want
inline literals on their own merits, which are:

  1. The source is much easier to read when the literal
     contains punctuation. You can use `master~1` instead
     of `master{tilde}1`.

  2. They are less error-prone. Because of point (1), we
     tend to make mistakes and forget the extra layer of
     quoting.

This patch removes the no-inline-literal attribute from the
Makefile and converts every use of backticks in the
documentation to an inline literal (they must be cleaned up,
or the example above would literally show "{tilde}" in the
output).

Problematic sites were found by grepping for '`.*[{\\]' and
examined and fixed manually. The results were then verified
by comparing the output of "html2text" on the set of
generated html pages. Doing so revealed that in addition to
making the source more readable, this patch fixes several
formatting bugs:

  - HTML rendering used the ellipsis character instead of
    literal "..." in code examples (like "git log A...B")

  - some code examples used the right-arrow character
    instead of '->' because they failed to quote

  - api-config.txt did not quote tilde, and the resulting
    HTML contained a bogus snippet like:

      <tt><sub></tt> foo <tt></sub>bar</tt>

    which caused some parsers to choke and omit whole
    sections of the page.

  - git-commit.txt confused ``foo`` (backticks inside a
    literal) with ``foo'' (matched double-quotes)

  - mentions of `A U Thor <author@example.com>` used to
    erroneously auto-generate a mailto footnote for
    author@example.com

  - the description of --word-diff=plain incorrectly showed
    the output as "[-removed-] and {added}", not "{+added+}".

  - using "prime" notation like:

      commit `C` and its replacement `C'`

    confused asciidoc into thinking that everything between
    the first backtick and the final apostrophe were meant
    to be inside matched quotes

  - asciidoc got confused by the escaping of some of our
    asterisks. In particular,

      `credential.\*` and `credential.<url>.\*`

    properly escaped the asterisk in the first case, but
    literally passed through the backslash in the second
    case.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-26 13:19:06 -07:00
Neil Horman 90e1818f9a git-rebase: add keep_empty flag
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>
2012-04-24 15:24:14 -07:00
Nelson Benitez Leon d3f2475c01 documentation: fix alphabetic ordered list for git-rebase man page
An alphabetic ordered list (a.) is converted to numerical in
the man page (1.) so context comments naming 'a' were confusing,
fix that by not using ordered list notation for 'a' anb 'b' items.

Signed-off-by: Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-26 10:28:55 -07:00
Junio C Hamano f424d7e0b9 Merge branch 'mz/doc-rebase-abort'
* mz/doc-rebase-abort:
  rebase: clarify "restore the original branch"
2011-07-22 14:44:08 -07:00
Martin von Zweigbergk 5960bc9d63 rebase: clarify "restore the original branch"
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>
2011-07-13 22:03:12 -07:00
Martin von Zweigbergk 7791a1d9b9 Documentation: use [verse] for SYNOPSIS sections
The SYNOPSIS sections of most commands that span several lines already
use [verse] to retain line breaks. Most commands that don't span
several lines seem not to use [verse]. In the HTML output, [verse]
does not only preserve line breaks, but also makes the section
indented, which causes a slight inconsistency between commands that
use [verse] and those that don't. Use [verse] in all SYNOPSIS sections
for consistency.

Also remove the blank lines from git-fetch.txt and git-rebase.txt to
align with the other man pages. In the case of git-rebase.txt, which
already uses [verse], the blank line makes the [verse] not apply to
the last line, so removing the blank line also makes the formatting
within the document more consistent.

While at it, add single quotes to 'git cvsimport' for consistency with
other commands.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-07-06 14:26:26 -07:00
Junio C Hamano 78c6e0f3fa Merge branch 'mz/rebase'
* mz/rebase: (34 commits)
  rebase: define options in OPTIONS_SPEC
  Makefile: do not install sourced rebase scripts
  rebase: use @{upstream} if no upstream specified
  rebase -i: remove unnecessary state rebase-root
  rebase -i: don't read unused variable preserve_merges
  git-rebase--am: remove unnecessary --3way option
  rebase -m: don't print exit code 2 when merge fails
  rebase -m: remember allow_rerere_autoupdate option
  rebase: remember strategy and strategy options
  rebase: remember verbose option
  rebase: extract code for writing basic state
  rebase: factor out sub command handling
  rebase: make -v a tiny bit more verbose
  rebase -i: align variable names
  rebase: show consistent conflict resolution hint
  rebase: extract am code to new source file
  rebase: extract merge code to new source file
  rebase: remove $branch as synonym for $orig_head
  rebase -i: support --stat
  rebase: factor out call to pre-rebase hook
  ...
2011-04-28 14:11:39 -07:00
Junio C Hamano 1d5742cbf7 Merge branch 'jk/doc-credits' of git://github.com/peff/git
* 'jk/doc-credits' of git://github.com/peff/git:
  docs: point git.txt author credits to git-scm.com
  doc: add missing git footers
  doc: drop author/documentation sections from most pages
2011-03-15 13:32:09 -07:00
Drew Northup ee55703bac Documentation: "rebase <onto> <that>" stays on <that> branch upon exit
This change makes it clearer that the change to the history effected by
executing 'git rebase master' while on 'topic' branch, and by executing
'git rebase master topic' on any branch, will be the same; the implicit
checkout of the second form will remain after the rebase exits.

Signed-off-by: Drew Northup <drew.northup@maine.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-14 10:52:23 -07:00
Jeff King 48bb914ed6 doc: drop author/documentation sections from most pages
The point of these sections is generally to:

  1. Give credit where it is due.

  2. Give the reader an idea of where to ask questions or
     file bug reports.

But they don't do a good job of either case. For (1), they
are out of date and incomplete. A much more accurate answer
can be gotten through shortlog or blame.  For (2), the
correct contact point is generally git@vger, and even if you
wanted to cc the contact point, the out-of-date and
incomplete fields mean you're likely sending to somebody
useless.

So let's drop the fields entirely from all manpages except
git(1) itself. We already point people to the mailing list
for bug reports there, and we can update the Authors section
to give credit to the major contributors and point to
shortlog and blame for more information.

Each page has a "This is part of git" footer, so people can
follow that to the main git manpage.
2011-03-11 10:59:16 -05:00
Martin von Zweigbergk 15a147e618 rebase: use @{upstream} if no upstream specified
'git rebase' without arguments is currently not supported. 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.

Defaulting to @{upstream} will make it possible to run e.g. 'git
rebase -i' without arguments, which is probably a quite common use
case. It also improves the scenario where you have multiple branches
that rebase against a remote-tracking branch, where you currently have
to choose between the extra network delay of 'git pull' or the
slightly awkward keys to enter 'git rebase @{u}'.

The error reporting when no upstream is configured for the current
branch or when no branch is checked out is reused from git-pull.sh. A
function is extracted into git-parse-remote.sh for this purpose.

Helped-by: Yann Dirson <ydirson@altern.org>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-10 14:45:25 -08:00
Martin von Zweigbergk 7baf9c4b70 rebase: support --verify
Interactive rebase allows the '--verify' option to be passed, but it will
be ignored. Implement proper support for the option for both interactive
and non-interactive rebase by making it override any previous
'--no-verify'.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-23 12:15:43 -08:00
Junio C Hamano c0808fe708 Merge branch 'jn/doc-backslash'
* jn/doc-backslash:
  Documentation: remove stray backslash in show-branch discussion
  Documentation: remove stray backslashes from "Fighting regressions" article
  Documentation: do not convert ... operator to ellipses
  Documentation: avoid stray backslash in user manual
  Documentation: avoid stray backslashes in core tutorial
  Documentation: remove stray backslashes in rev-parse manual
  Documentation: remove backslash before ~ in fast-import manual
  Documentation: remove stray backslash from "git bundle" manual
  Documentation/technical: avoid stray backslash in parse-options API docs
  Documentation: remove backslashes in manpage synopses
  Documentation: clarify quoting in gitignore docs
  Documentation: clarify quoting in "git rm" example
  Documentation: add missing quotes to "git grep" examples
  Documentation: clarify quoting in "git add" example
  Documentation: unbreak regex in show-ref manual
  Documentation: quoting trouble in "git rm" discussion
  Documentation: tweak description of log.date
2010-09-03 09:43:42 -07:00
Junio C Hamano a621859101 Merge branch 'hv/autosquash-config'
* hv/autosquash-config:
  add configuration variable for --autosquash option of interactive rebase
2010-08-31 16:15:03 -07:00
Junio C Hamano 5cba1229d8 Merge branch 'mm/rebase-i-exec'
* mm/rebase-i-exec:
  git-rebase--interactive.sh: use printf instead of echo to print commit message
  git-rebase--interactive.sh: rework skip_unnecessary_picks
  test-lib: user-friendly alternatives to test [-d|-f|-e]
  rebase -i: add exec command to launch a shell command

Conflicts:
	git-rebase--interactive.sh
	t/t3404-rebase-interactive.sh
2010-08-21 23:29:11 -07:00
Jonathan Nieder b9190e7913 Documentation: do not convert ... operator to ellipses
The symmetric difference or merge-base operator ... as used by
rev-list and diff is actually three period characters.  If it
gets replaced by an ellipsis glyph in the manual, that would
stop readers from copying and pasting it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-20 14:16:51 -07:00
Matthieu Moy cd035b1cef rebase -i: add exec command to launch a shell command
The typical usage pattern would be to run a test (or simply a compilation
command) at given points in history.

The shell command is ran (from the worktree root), and the rebase is
stopped when the command fails, to give the user an opportunity to fix
the problem before continuing with "git rebase --continue".

This needs a little rework of skip_unnecessary_picks, which wasn't robust
enough to deal with lines like

  exec >"file    name with many spaces"

in the todolist. The new version extracts command, sha1 and rest from
each line, but outputs the line itself verbatim to avoid changing the
whitespace layout.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11 10:21:34 -07:00
Mike Lundy 93ce190cd1 rebase: support -X to pass through strategy options
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>
2010-08-03 15:14:20 -07:00
Heiko Voigt dd1e5b313a add configuration variable for --autosquash option of interactive rebase
If you use this feature regularly you can now enable it by default. In
case the user wants to override this config on the commandline
--no-autosquash can be used to force disabling.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14 08:47:29 -07:00
Jonathan Nieder cddb42d2c5 rebase -i -p: document shortcomings
The rebase --preserve-merges facility presents a list of commits
in its instruction sheet and uses a separate table to keep
track of their parents.  Unfortunately, in practice this means
that with -p after most attempts to rearrange patches, some
commits have the "wrong" parent and the resulting history is
rarely what the caller expected.

Yes, it would be nice to fix that.  But first, add a warning to the
manual to help the uninitiated understand what is going on.

Reported-by: Jiří Paleček <jpalecek@web.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11 08:44:13 -07:00
Michael J Gruber 873c347205 Documentation: A...B shortcut for checkout and rebase
Describe the A...B shortcuts for checkout and rebase [-i] which were
introduced in these commits:

619a64e ("checkout A...B" switches to the merge base between A and B, 2009-10-18)
61dfa1b ("rebase --onto A...B" replays history on the merge base between A and B, 2009-11-20)
230a456 (rebase -i: teach --onto A...B syntax, 2010-01-07)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-02 10:03:53 -07:00
Markus Heidelberg 56a05720b1 Documentation: rebase -i ignores options passed to "git am"
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-18 21:51:40 -07:00
Marc Branchaud b499549401 Teach rebase the --no-ff option.
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>
2010-03-24 14:42:57 -07:00
Horst H. von Brand 42cfcd20a7 git-rebase.txt: Fix spelling
Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-21 15:02:45 -08:00
Junio C Hamano add0951ab0 Merge remote branch 'remotes/trast-doc/for-next'
* remotes/trast-doc/for-next:
  Documentation: spell 'git cmd' without dash throughout
  Documentation: format full commands in typewriter font
  Documentation: warn prominently against merging with dirty trees
  Documentation/git-merge: reword references to "remote" and "pull"

Conflicts:
	Documentation/config.txt
	Documentation/git-config.txt
	Documentation/git-merge.txt
2010-01-20 20:28:49 -08:00
Thomas Rast 0b444cdb19 Documentation: spell 'git cmd' without dash throughout
The documentation was quite inconsistent when spelling 'git cmd' if it
only refers to the program, not to some specific invocation syntax:
both 'git-cmd' and 'git cmd' spellings exist.

The current trend goes towards dashless forms, and there is precedent
in 647ac70 (git-svn.txt: stop using dash-form of commands.,
2009-07-07) to actively eliminate the dashed variants.

Replace 'git-cmd' with 'git cmd' throughout, except where git-shell,
git-cvsserver, git-upload-pack, git-receive-pack, and
git-upload-archive are concerned, because those really live in the
$PATH.
2010-01-10 13:01:28 +01:00
Nanako Shiraishi f59baa502f rebase -i --autosquash: auto-squash commits
Teach a new option, --autosquash, to the interactive rebase.
When the commit log message begins with "!fixup ...", and there
is a commit whose title begins with the same ..., automatically
modify the todo list of rebase -i so that the commit marked for
squashing come right after the commit to be modified, and change
the action of the moved commit from pick to squash.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 17:18:56 -08:00
Michael Haggerty 0205e72f08 Add a command "fixup" to rebase --interactive
The command is like "squash", except that it discards the commit message
of the corresponding commit.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-07 13:50:57 -08:00
Junio C Hamano c50230f751 Merge branch 'tr/maint-merge-ours-clarification' (early part)
* 'tr/maint-merge-ours-clarification' (early part):
  rebase docs: clarify --merge and --strategy
  Documentation: clarify 'ours' merge strategy
2009-11-22 16:28:06 -08:00
Thomas Rast 31ddd1ee0f rebase docs: clarify --merge and --strategy
Add a paragraph about the swapped sides in a --merge rebase, which was
otherwise only documented in the sources.

Add a paragraph about the effects of the 'ours' strategy to the -s
description.  Also remove the mention of the 'octopus' strategy, which
was copied from the git-merge description but is pointless in a
rebase.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-16 22:10:34 -08:00
Björn Gustavsson 6741aa6c39 Teach 'rebase -i' the command "reword"
Make it easier to edit just the commit message for a commit
using 'git rebase -i' by introducing the "reword" command.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-07 21:46:41 -07:00
Giuseppe Bilotta 86c91f9179 git apply: option to ignore whitespace differences
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>
2009-08-05 11:59:56 -07:00
Stephen Boyd 0e987a12fc am, rebase: teach quiet option
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>
2009-06-18 11:54:48 -07:00
Nguyễn Thái Ngọc Duy 06f391906a doc/git-rebase.txt: remove mention of multiple strategies
git-rebase.sh does not seem to support this.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-21 07:33:23 -07:00
Michele Ballabio 570ccad33e rebase: add options passed to git-am
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>
2009-03-18 19:25:01 -07:00
Michele Ballabio 5e75d56f11 document --force-rebase
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-18 19:24:51 -07:00
Tor Arne Vestbø a9c3821ca2 git-rebase: Add --stat and --no-stat for producing diffstat on rebase
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>
2009-03-02 23:22:32 -08:00
Todd Zullinger 749485f622 git-rebase: Update --whitespace documentation
The parameters accepted by the --whitespace option of "git apply" have
changed over time, and the documentation for "git rebase" was out of
sync.  Remove the specific parameter list from the "git rebase"
documentation and simply point to the "git apply" documentation for
details, as is already done in the "git am" documentation.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-28 11:47:25 -08:00
Mark Burton 7fe5438516 git-rebase.txt: --interactive does not work with --whitespace
Signed-off-by: Mark Burton <markb@ordern.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-12 16:50:28 -08:00
Thomas Rast be49662101 rebase: update documentation for --root
Since the new option depends on --onto and omission of <upstream>, use
a separate invocation style, and omit most options to save space.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-11 23:09:14 -08:00
Junio C Hamano 310d188f7e Merge branch 'tr/workflow-doc'
* tr/workflow-doc:
  Documentation: add manpage about workflows
  Documentation: Refer to git-rebase(1) to warn against rewriting
  Documentation: new upstream rebase recovery section in git-rebase
2008-10-19 16:07:23 -07:00
Junio C Hamano edacb101ef Merge branch 'ae/preservemerge'
* ae/preservemerge:
  rebase: Support preserving merges in non-interactive mode
2008-10-19 16:06:31 -07:00
Nanako Shiraishi fd631d5828 rebase: Document --no-verify option to bypass pre-rebase hook
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-14 16:50:32 -07:00
Andreas Ericsson f8cca019b9 rebase: Support preserving merges in non-interactive mode
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>
2008-09-30 15:34:52 -07:00
Garry Dolley e2b850b2da Fixed some grammatical errors in git-rebase.txt documentation.
Generally, the dependent clause "for example" is suffixed with a comma.
Used present tense where appropriate to be consistent with the other
paragraphs.

Rewrote the paragraph in the second hunk to be more clear.

Signed-off-by: Garry Dolley <gdolley@ucla.edu>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24 09:12:07 -07:00
Thomas Rast 90d1c08efc Documentation: new upstream rebase recovery section in git-rebase
Document how to recover if the upstream that you pull from has
rebased the branches you depend your work on.  Hopefully this can also
serve as a warning to potential rebasers.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15 21:21:59 -07:00
Johannes Schindelin 51ef1daa4a Rename .git/rebase to .git/rebase-apply
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>
2008-07-21 18:51:47 -07:00
Junio C Hamano 59eb68aa2b Update my e-mail address
The old cox.net address is still getting mails from gitters.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-21 12:14:42 -07:00
Johannes Schindelin 28ed6e7b32 Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"
Since the files generated and used during a rebase are never to be
tracked, they should live in $GIT_DIR.  While at it, avoid the rather
meaningless term "dotest" to "rebase", and unhide ".dotest-merge".

This was wished for on the mailing list, but so far unimplemented.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-15 18:49:28 -07:00
Brian Gernhardt 9869099bee Documentation: mention ORIG_HEAD in am, merge, and rebase
Merge has always set ORIG_HEAD but never mentioned it, while we
recently added it to am and rebase.  These facts should be reflected
in the documentation.

git-reset also sets ORIG_HEAD, but that fact is already mentioned in
the very first example so no changes were needed there.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-08 13:13:03 -07:00
Jonathan Nieder ba020ef5eb manpages: italicize git command names (which were in teletype font)
The names of git commands are not meant to be entered at the
commandline; they are just names. So we render them in italics,
as is usual for command names in manpages.

Using

	doit () {
	  perl -e 'for (<>) { s/\`(git-[^\`.]*)\`/'\''\1'\''/g; print }'
	}
	for i in git*.txt config.txt diff*.txt blame*.txt fetch*.txt i18n.txt \
	        merge*.txt pretty*.txt pull*.txt rev*.txt urls*.txt
	do
	  doit <"$i" >"$i+" && mv "$i+" "$i"
	done
	git diff

.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-05 11:24:40 -07:00
Jonathan Nieder 467c0197fd Documentation: more "git-" versus "git " changes
With git-commands moving out of $(bindir), it is useful to make a
clearer distinction between the git subcommand 'git-whatever' and
the command you type, `git whatever <options>`.  So we use a dash
after "git" when referring to the former and not the latter.

I already sent a patch doing this same thing, but I missed some
spots.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-05 11:24:39 -07:00
Jonathan Nieder 483bc4f045 Documentation formatting and cleanup
Following what appears to be the predominant style, format
names of commands and commandlines both as `teletype text`.

While we're at it, add articles ("a" and "the") in some
places, italicize the name of the command in the manual page
synopsis line, and add a comma or two where it seems appropriate.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:16 -07:00
Jonathan Nieder b1889c36d8 Documentation: be consistent about "git-" versus "git "
Since the git-* commands are not installed in $(bindir), using
"git-command <parameters>" in examples in the documentation is
not a good idea. On the other hand, it is nice to be able to
refer to each command using one hyphenated word. (There is no
escaping it, anyway: man page names cannot have spaces in them.)

This patch retains the dash in naming an operation, command,
program, process, or action. Complete command lines that can
be entered at a shell (i.e., without options omitted) are
made to use the dashless form.

The changes consist only of replacing some spaces with hyphens
and vice versa. After a "s/ /-/g", the unpatched and patched
versions are identical.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:15 -07:00
Stephan Beyer 3240240ff4 Docs: Use "-l::\n--long\n" format in OPTIONS sections
The OPTIONS section of a documentation file contains a list
of the options a git command accepts.

Currently there are several variants to describe the case that
different options (almost) do the same in the OPTIONS section.

Some are:

 -f, --foo::
 -f|--foo::
 -f | --foo::

But AsciiDoc has the special form:

 -f::
 --foo::

This patch applies this form to the documentation of the whole git suite,
and removes useless em-dash prevention, so \--foo becomes --foo.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-08 13:46:38 -07:00
Christian Couder 9e1f0a85c6 documentation: move git(7) to git(1)
As the "git" man page describes the "git" command at the end-user
level, it seems better to move it to man section 1.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-06 11:18:28 -07:00
SZEDER Gábor 702088afc6 update 'git rebase' documentation
Being in the project's top directory when starting or continuing a rebase
is not necessary since 533b703 (Allow whole-tree operations to be started
from a subdirectory, 2007-01-12).

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-10 17:38:03 -07:00
Mike Hommey f32086becc Documentation/git-rebase.txt: Add --strategy to synopsys
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-01 19:45:15 -08:00
Dan McGee 5162e69732 Documentation: rename gitlink macro to linkgit
Between AsciiDoc 8.2.2 and 8.2.3, the following change was made to the stock
Asciidoc configuration:

@@ -149,7 +153,10 @@
 # Inline macros.
 # Backslash prefix required for escape processing.
 # (?s) re flag for line spanning.
-(?su)[\\]?(?P<name>\w(\w|-)*?):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
+
+# Explicit so they can be nested.
+(?su)[\\]?(?P<name>(http|https|ftp|file|mailto|callto|image|link)):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
+
 # Anchor: [[[id]]]. Bibliographic anchor.
 (?su)[\\]?\[\[\[(?P<attrlist>[\w][\w-]*?)\]\]\]=anchor3
 # Anchor: [[id,xreflabel]]

This default regex now matches explicit values, and unfortunately in this
case gitlink was being matched by just 'link', causing the wrong inline
macro template to be applied. By renaming the macro, we can avoid being
matched by the wrong regex.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-06 18:41:44 -08:00
Jeff King ff9054627c git-rebase: document suppression of duplicate commits
git-rebase uses format-patch's --ignore-if-in-upstream
option, but we never document the user-visible behavior. The
example is placed near the top of the example list rather
than at the bottom because it is:
  a. a simple example
  b. a reasonably common scenario for many projects (mail
     some patches which get accepted upstream, then rebase)

[sp: Corrected direction of 'HEAD..<upstream>' set comparsion]

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 01:18:43 -04:00
Junio C Hamano 2af89f12c6 Merge branch 'maint'
* maint:
  git-remote: exit with non-zero status after detecting errors.
  rebase -i: squash should retain the authorship of the _first_ commit
  git-add--interactive: Improve behavior on bogus input
  git-add--interactive: Allow Ctrl-D to exit
2007-09-29 23:32:36 -07:00
Johannes Schindelin 81ab1cb43a rebase -i: squash should retain the authorship of the _first_ commit
It was determined on the mailing list, that it makes more sense for a
"squash" to keep the author of the first commit as the author for the
result of the squash.

Make it so.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 23:16:08 -07:00
J. Bruce Fields 059f446d57 git-rebase: support --whitespace=<option>
Pass --whitespace=<option> to git-apply.  Since git-apply and git-am
expect this, I'm always surprised when I try to give it to git-rebase
and it doesn't work.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-07 21:02:08 -07:00
Robin Rosenberg a94eda65d3 Mention -m as an abbreviation for --merge
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-01 10:36:56 -07:00
Johannes Schindelin f0fd889d7f rebase -i: mention the option to split commits in the man page
The interactive mode of rebase can be used to split commits.  Tell the
interested parties about it, with a dedicated section in the man page.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-31 23:22:51 -07:00
Junio C Hamano 13cc4c81df Documentation/git-rebase: fix an example
The example miscounted the commit to rebase from.
Noticed by Cliff Brake.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-16 12:20:25 -07:00
Johannes Schindelin f09c9b8c5f Teach rebase -i about --preserve-merges
The option "-p" (or long "--preserve-merges") makes it possible to
rebase side branches including merges, without straightening the
history.

Example:

           X
            \
         A---M---B
        /
---o---O---P---Q

When the current HEAD is "B", "git rebase -i -p --onto Q O" will yield

               X
                 \
---o---O---P---Q---A'---M'---B'

Note that this will

- _not_ touch X [*1*], it does

- _not_ work without the --interactive flag [*2*], it does

- _not_ guess the type of the merge, but blindly uses recursive or
  whatever strategy you provided with "-s <strategy>" for all merges it
  has to redo, and it does

- _not_ make use of the original merge commit via git-rerere.

*1*: only commits which reach a merge base between <upstream> and HEAD
     are reapplied. The others are kept as-are.

*2*: git-rebase without --interactive is inherently patch based (at
     least at the moment), and therefore merges cannot be preserved.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-26 18:58:59 -07:00
Johannes Schindelin 1b1dce4bae Teach rebase an interactive mode
Don't you just hate the fact sometimes, that git-rebase just applies
the patches, without any possibility to edit them, or rearrange them?
With "--interactive", git-rebase now lets you edit the list of patches,
so that you can reorder, edit and delete patches.

Such a list will typically look like this:

	pick deadbee The oneline of this commit
	pick fa1afe1 The oneline of the next commit
	...

By replacing the command "pick" with the command "edit", you can amend
that patch and/or its commit message, and by replacing it with "squash"
you can tell rebase to fold that patch into the patch before that.

It is derived from the script sent to the list in
<Pine.LNX.4.63.0702252156190.22628@wbgn013.biozentrum.uni-wuerzburg.de>

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-24 17:45:02 -07:00
Junio C Hamano a6080a0a44 War on whitespace
This uses "git-apply --whitespace=strip" to fix whitespace errors that have
crept in to our source files over time.  There are a few files that need
to have trailing whitespaces (most notably, test vectors).  The results
still passes the test, and build result in Documentation/ area is unchanged.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-07 00:04:01 -07:00
Matthias Kestenholz e448ff877b Documentation: Added [verse] to SYNOPSIS where necessary
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-18 21:47:40 -07:00
Shawn O. Pearce d7f078b8b9 Convert update-index references in docs to add.
Since `git add` is the approved porcelain for an end-user to invoke
when they want to manipulate the index, porcelain documentation
should steer the user to this command rather than the pure plumbing
update-index.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-17 10:20:27 -08:00
Shawn O. Pearce 5ca2db5376 Attempt to improve git-rebase lead-in description.
It was mentioned on #git this morning that the lead-in description
of git-rebase is very confusing.  Too many branch this and branch
that in a very short run of text.

This new description attempts to walk the user through the command
syntax, while also describing exactly what git-rebase is doing to
their repository.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-17 10:08:21 -08:00
Junio C Hamano c5c3fc9851 Documentation: git-rebase -C<n>
Replace -CNUM in Synopsis section with -C<n> to make it consistent with
the description text.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11 22:03:55 -08:00
Michael S. Tsirkin 67dad687ad add -C[NUM] to git-am
Add -C[NUM] to git-am and git-rebase so that patches can be applied even
if context has changed a bit.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-08 15:23:52 -08:00
Shawn O. Pearce ea81fcc576 Show an example of deleting commits with git-rebase.
This particular use of git-rebase to remove a single commit or a
range of commits from the history of a branch recently came up on
the mailing list.  Documenting the example should help other users
arrive at the same solution on their own.

It also was not obvious to the newcomer that git-rebase is able to
accept any commit for --onto <newbase> and <upstream>.  We should
at least minimally document this, as much of the language in
git-rebase's manpage refers to 'branch' rather than 'committish'.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:48:59 -08:00
Junio C Hamano c3f0baacad Documentation: sync git.txt command list and manual page title
Also reorders a handful entries to make each list sorted
alphabetically.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 15:53:37 -08:00
Junio C Hamano bd45fec839 Merge branch 'maint'
* maint:
  Documentation: Transplanting branch with git-rebase --onto
  merge-recursive implicitely depends on trust_executable_bit
  adjust_shared_perm: chmod() only when needed.
  Fix git-runstatus for repositories containing a file named HEAD
2006-11-06 22:56:07 -08:00
Jakub Narebski e52775f438 Documentation: Transplanting branch with git-rebase --onto
Added example of transplantig feature branch from one development
branch (for example "next") into the other development branch (for
example "master").

[jc: talking Carl's advice this contains both examples sent to
 the list by Jakub in his original message.]

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-06 15:01:14 -08:00
Robert Shearman b758789c20 git-rebase: Add a -v option to show a diffstat of the changes upstream at the start of a rebase.
Signed-off-by: Robert Shearman <rob@codeweavers.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-04 15:02:04 -07:00
Eric Wong d5e673b60b rebase: allow --skip to work with --merge
Now that we control the merge base selection, we won't be forced
into rolling things in that we wanted to skip beforehand.

Also, add a test to ensure this all works as intended.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-25 00:38:34 -07:00
Eric Wong 58634dbff8 rebase: Allow merge strategies to be used when rebasing
This solves the problem of rebasing local commits against an
upstream that has renamed files.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-21 03:56:29 -07:00
Sean cc120056a8 Make git rebase interactive help match documentation.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14 16:28:32 -07:00
sean 031321c654 Add --continue and --abort options to git-rebase.
git rebase [--onto <newbase>] <upstream> [<branch>]
  git rebase --continue
  git rebase --abort

Add "--continue" to restart the rebase process after
manually resolving conflicts.  The user is warned if
there are still differences between the index and the
working files.

Add "--abort" to restore the original branch, and
remove the .dotest working files.

Some minor additions to the git-rebase documentation.

[jc: fix that applies to the maintenance track has been dealt
 with separately.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 17:10:33 -07:00
J. Bruce Fields 8978d043c3 Document git-rebase behavior on conflicts. 2006-03-26 19:07:43 -08:00
Jon Loeliger 228382aee4 Clarify git-rebase example commands.
Signed-off-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-17 20:42:33 -08:00
Fredrik Kuivinen 7bd7f2804d Remove trailing dot after short description
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-09 11:44:11 -08:00
Carl Worth 69a60af5d0 git-rebase: Clarify usage statement and copy it into the actual documentation.
I found a paper thin man page for git-rebase, but was quite happy to
see something much more useful in the usage statement of the script
when I went there to find out how this thing worked. Here it is
cleaned up slightly and expanded a bit into the actual documentation.

Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-21 17:45:32 -08:00
Sergey Vlasov a7154e916c [PATCH] Documentation: Update all files to use the new gitlink: macro
The replacement was performed automatically by these commands:

	perl -pi -e 's/link:(git.+)\.html\[\1\]/gitlink:$1\[1\]/g' \
		README Documentation/*.txt
	perl -pi -e 's/link:git\.html\[git\]/gitlink:git\[7\]/g' \
		README Documentation/*.txt

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-20 15:07:52 -07:00
Junio C Hamano 215a7ad1ef Big tool rename.
As promised, this is the "big tool rename" patch.  The primary differences
since 0.99.6 are:

  (1) git-*-script are no more.  The commands installed do not
      have any such suffix so users do not have to remember if
      something is implemented as a shell script or not.

  (2) Many command names with 'cache' in them are renamed with
      'index' if that is what they mean.

There are backward compatibility symblic links so that you and
Porcelains can keep using the old names, but the backward
compatibility support  is expected to be removed in the near
future.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07 17:45:20 -07:00