Commit graph

2974 commits

Author SHA1 Message Date
Petr Baudis c0be8aa06b Documentation/git-merge.txt: Partial rewrite of How Merge Works
The git-merge documentation's "HOW MERGE WORKS" section is confusingly
composed and actually omits the most interesting part, the merging of
the arguments into HEAD itself, surprisingly not actually mentioning
the fast-forward merge anywhere.

This patch replaces the "[NOTE]" screenful of highly technical details
by a single sentence summing up the interesting information, and instead
explains how are the arguments compared with HEAD and the three possible
inclusion states that are named "Already up-to-date", "Fast-forward"
and "True merge". It also makes it clear that the rest of the section
talks only about the true merge situation, and slightly expands the
talk on solving conflicts.

Junio initiated the removal of the Note screenful altogether and
offered many stylistical fixes.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-19 11:25:27 -07:00
Petr Baudis 6259ac6628 Documentation: How to ignore local changes in tracked files
This patch explains more carefully that `.gitignore` concerns only
untracked files and refers the reader to

	git update-index --assume-unchanged

in the need of ignoring uncommitted changes in already tracked files.
The description of this option is lifted to a more "porcelainish"
level and explains the caveats of this usecase.

Whether feasible or not, I believe adding this functionality to
the porcelain is out of the scope of this patch. (And I personally
think that referring to the plumbing in the case of such a special
usage is fine.)

This is currently probably one of the top FAQs at #git and the
--assume-unchanged switch is not widely known; gitignore(5) is the first
place where people are likely to look for it.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-19 11:17:43 -07:00
Petr Baudis c47f10246a Documentation/git-submodule.txt: Further clarify the description
This patch rewrites the general description yet again, first clarifying
the high-level concept, mentioning the difference to remotes and using
the subtree merge strategy, then getting to the details about tree
entries and .gitmodules file.

The patch also makes few smallar grammar fixups within the rest of the
description and clarifies how does 'init' relate to 'update --init'.

Cc: Heikki Orsila <shdl@zakalwe.fi>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-19 11:17:43 -07:00
Petr Baudis 1b76ead004 Documentation/RelNotes-1.6.0.txt: Expand on the incompatible packfiles
Note that v1.4.4.5 supports pack index v2, and describe how to keep
your repositories backwards-compatible, shall you need to.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-17 11:19:39 -07:00
Junio C Hamano 57cbf72e87 Update draft release notes for 1.6.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-16 18:34:19 -07:00
Petr Baudis e38953ab00 Documentation/git-submodule.txt: Add Description section
Figuring out how submodules work conceptually is quite a bumpy
ride for a newcomer; the user manual helps (if one knows to actually
look into it), but the reference documentation should provide good
quick intro as well. This patch attempts to do that, with suggestions
from Heikki Orsila.

Cc: Heikki Orsila <shdl@zakalwe.fi>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-16 17:24:32 -07:00
Junio C Hamano 88bbda08d7 Merge branch 'maint'
* maint:
  Start preparing 1.5.6.4 release notes
  git fetch-pack: do not complain about "no common commits" in an empty repo
  rebase-i: keep old parents when preserving merges
  t7600-merge: Use test_expect_failure to test option parsing
  Fix buffer overflow in prepare_attr_stack
  Fix buffer overflow in git diff
  Fix buffer overflow in git-grep
  git-cvsserver: fix call to nonexistant cleanupWorkDir()
  Documentation/git-cherry-pick.txt et al.: Fix misleading -n description

Conflicts:
	RelNotes
2008-07-16 17:10:28 -07:00
Junio C Hamano 473a189b92 Start preparing 1.5.6.4 release notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-16 15:55:51 -07:00
Junio C Hamano 013942f637 Merge branch 'js/maint-pretty-mailmap' into maint
* js/maint-pretty-mailmap:
  Add pretty format %aN which gives the author name, respecting .mailmap
2008-07-16 15:27:03 -07:00
Petr Baudis 8bd867ee0e Documentation/git-cherry-pick.txt et al.: Fix misleading -n description
The manual page of git-cherry-pick and git-revert asserts that -n works
primarily on the working tree, while in fact the primary object it operates
on is the index, and the changes only "accidentally" propagate to the
working tree. This e.g. leads innocent #git IRC folks to believe that you
can use -n to prepare changes for git-add -i staging.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-16 08:50:07 -07:00
Junio C Hamano fab600ce2e Merge branch 'js/maint-pretty-mailmap'
* js/maint-pretty-mailmap:
  Add pretty format %aN which gives the author name, respecting .mailmap
2008-07-15 18:59:04 -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
Junio C Hamano 6c11a5fd46 Update draft release notes to 1.6.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-15 07:38:35 -07:00
Ciaran McCreesh 1e5aaa6db3 Make git-add -i accept ranges like 7-
git-add -i ranges expect number-number. But for the supremely lazy, typing in
that second number when selecting "from patch 7 to the end" is wasted effort.
So treat an empty second number in a range as "until the last item".

Signed-off-by: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-15 07:37:00 -07:00
Junio C Hamano b773fc34a0 Merge branch 'jc/branch-merged'
* jc/branch-merged:
  branch --merged/--no-merged: allow specifying arbitrary commit
  branch --contains: default to HEAD
  parse-options: add PARSE_OPT_LASTARG_DEFAULT flag

Conflicts:
	Documentation/git-branch.txt
2008-07-14 23:47:01 -07:00
Junio C Hamano 633ce9a3ba Merge branch 'jc/rebase-orig-head'
* jc/rebase-orig-head:
  Documentation: mention ORIG_HEAD in am, merge, and rebase
  Teach "am" and "rebase" to mark the original position with ORIG_HEAD
2008-07-14 23:45:49 -07:00
Mark Levedahl ec05df353c git-submodule - make "submodule add" more strict, and document it
This change makes "submodule add" much more strict in the arguments it
takes, and is intended to address confusion as recently noted on the
git-list. With this change, the required syntax is:

	$ git submodule add URL path

Specifically, this eliminates the form

	$ git submodule add URL

which was confused by more than one person as

	$ git submodule add path

With this patch, the URL locating the submodule's origin repository can be
either an absolute URL, or (if it begins with ./ or ../) can express the
submodule's repository location relative to the superproject's origin.

This patch also eliminates a third form of URL, which was relative to the
superproject's top-level directory (not its repository).  Any URL that was
neither absolute nor matched ./*|../* was assumed to point to a
subdirectory of the superproject as the location of the submodule's origin
repository.  This URL form was confusing and does not seem to correspond
to an important use-case.  Specifically, no-one has identified the need to
clone from a repository already in the superproject's tree, but if this is
needed it is easily done using an absolute URL: $(pwd)/relative-path.  So,
no functionality is lost with this patch. (t6008-rev-list-submodule.sh did
rely upon this relative URL, fixed by using $(pwd).)

Following this change, there are exactly four variants of
submodule-add, as both arguments have two flavors:

URL can be absolute, or can begin with ./|../ and thus names the
submodule's origin relative to the superproject's origin.

Note: With this patch, "submodule add" discerns an absolute URL as
matching /*|*:*: e.g., URL begins with /, or it contains a :.  This works
for all valid URLs, an absolute path in POSIX, as well as an absolute path
on Windows).

path can either already exist as a valid git repo, or will be cloned from
the given URL.  The first form here eases creation of a new submodule in
an existing superproject as the submodule can be added and tested in-tree
before pushing to the public repository.  However, the more usual form is
the second, where the repo is cloned from the given URL.

This specifically addresses the issue of

	$ git submodule add a/b/c

attempting to clone from a repository at "a/b/c" to create a new module
in "c". This also simplifies description of "relative URL" as there is now
exactly *one* form: a URL relative to the parent's origin repo.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-14 23:35:31 -07:00
Junio C Hamano dc29bc8bd2 tutorial: clarify "pull" is "fetch + merge"
The document says that a fetch with a configured remote stores what are
fetched in the remote tracking branches "Unlike the longhand form", but
there is no longhand form "fetch" demonstrated earlier.

This adds a missing demonstration of the longhand form, and a new
paragraph to explain why some people might want to fetch before pull.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-14 23:35:31 -07:00
Ian Katz 5d5e88af5c tutorial: use prompt with user names in example, to clarify who is doing what
Signed-off-by: Ian Katz <ifreecarve@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-14 23:35:31 -07:00
Junio C Hamano dc6282d201 Update draft release notes for 1.6.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13 22:30:35 -07:00
Stephan Beyer 356a32a23a git-am/git-mailsplit: correct synopsis for reading from stdin
Invoking git-am or git-mailsplit without mbox or Maildir results in
reading an mbox from stdin.  Mention this in the synopsis and usage
strings.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13 16:08:27 -07:00
Junio C Hamano 447d0cca45 Merge branch 'maint' to sync with 1.5.6.3
* maint:
  GIT 1.5.6.3
  git-am: Do not exit silently if committer is unset
  t0004: fix timing bug
  git-mailinfo: document the -n option
  Fix backwards-incompatible handling of core.sharedRepository
2008-07-13 15:45:38 -07:00
Junio C Hamano 191a8e32b3 GIT 1.5.6.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13 15:23:43 -07:00
Junio C Hamano fa6200fc02 Merge branch 'ph/parseopt-step-blame'
* ph/parseopt-step-blame:
  revisions: refactor handle_revision_opt into parse_revision_opt.
  git-shortlog: migrate to parse-options partially.
  git-blame: fix lapsus
  git-blame: migrate to incremental parse-option [2/2]
  git-blame: migrate to incremental parse-option [1/2]
  revisions: split handle_revision_opt() from setup_revisions()
  parse-opt: add PARSE_OPT_KEEP_ARGV0 parser option.
  parse-opt: fake short strings for callers to believe in.
  parse-opt: do not print errors on unknown options, return -2 intead.
  parse-opt: create parse_options_step.
  parse-opt: Export a non NORETURN usage dumper.
  parse-opt: have parse_options_{start,end}.
  git-blame --reverse
  builtin-blame.c: allow more than 16 parents
  builtin-blame.c: move prepare_final() into a separate function.
  rev-list --children
  revision traversal: --children option
2008-07-13 15:16:35 -07:00
Junio C Hamano 671d322035 Merge branch 'am/stash-branch'
* am/stash-branch:
  Add a test for "git stash branch"
  Implement "git stash branch <newbranch> <stash>"
2008-07-13 15:16:09 -07:00
Junio C Hamano 15fc1c02fc Merge branch 'sg/stash-k-i'
* sg/stash-k-i:
  Documentation: tweak use case in "git stash save --keep-index"
  stash: introduce 'stash save --keep-index' option
2008-07-13 15:15:27 -07:00
Junio C Hamano 69b060c84e Merge branch 'tr/add-i-e'
* tr/add-i-e:
  git-add--interactive: manual hunk editing mode
  git-add--interactive: remove hunk coalescing
  git-add--interactive: replace hunk recounting with apply --recount
2008-07-13 15:14:59 -07:00
Johannes Schindelin e0cbc39768 Add pretty format %aN which gives the author name, respecting .mailmap
The pretty format %an does not respect .mailmap, but gives the exact
author name recorded in the commit.  Sometimes it is more desirable,
however, to look if the email has another name mapped to it in .mailmap.

This commit adds %aN (and %cN for the committer name) to do exactly that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-11 21:16:37 -07:00
Lukas Sandström b4958181a9 git-mailinfo: document the -n option
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-11 21:10:13 -07:00
Junio C Hamano e9a9d6edee Merge branch 'js/apply-root'
* js/apply-root:
  git-apply --directory: make --root more similar to GNU diff
  apply --root: thinkofix.
  Teach "git apply" to prepend a prefix with "--root=<root>"
2008-07-09 16:58:21 -07:00
Junio C Hamano 049716b370 branch --merged/--no-merged: allow specifying arbitrary commit
"git-branch --merged" is a handy way to list all the branches that have
already been merged to the current branch, but it did not allow checking
against anything but the current branch.  Having to switch branches only
to list the branches that are merged with another branch made the feature
practically useless.

This updates the option parser so that "git branch --merged next" is
accepted when you are on 'master' branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-09 02:12:24 -07:00
Junio C Hamano bb293b831b Merge branch 'maint'
* maint:
  Start preparing release notes for 1.5.6.3
  git-submodule - Fix bugs in adding an existing repo as a module
  bash: offer only paths after '--'
  Remove unnecessary pack-*.keep file after successful git-clone
  make deleting a missing ref more quiet
2008-07-09 00:19:50 -07:00
Junio C Hamano e09c4e753c Start preparing release notes for 1.5.6.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-08 23:57:14 -07:00
Junio C Hamano fd11ae0b52 Documentation: update sections on naming revisions and revision ranges
Various *_HEAD pseudo refs were not documented in any central place.
Especially since we may be teaching rebase and am to record ORIG_HEAD,
it would be a good time to do so.

While at it, reword the explanation on r1..r2 notation to reduce
confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-08 23:05:27 -07:00
Mark Levedahl dc0f705415 install-doc-quick - use git --exec-path to find git-sh-setup
This is needed as git-sh-setup is no longer in the path.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-08 16:36:03 -07:00
Junio C Hamano 8bb65883d1 Merge branch 'jc/blame' (early part) into HEAD
* 'jc/blame' (early part):
  git-blame --reverse
  builtin-blame.c: allow more than 16 parents
  builtin-blame.c: move prepare_final() into a separate function.
  rev-list --children
  revision traversal: --children option

Conflicts:

	Documentation/rev-list-options.txt
	revision.c
2008-07-08 15:25:44 -07:00
Eric Raible caf1899699 Documentation: tweak use case in "git stash save --keep-index"
The documentation suggests using "git stash apply" in the
--keep-index workflow even though doing so will lead to clutter
in the stash.  And given that the changes are about to be
committed anyway "git stash pop" is more sensible.

Additionally the text preceeding the example claims that it
works for "two or more commits", but the example itself is
really tailored for just two.  Expanding it just a little
makes it clear how the procedure generalizes to N commits.

Finally the example is annotated with some commentary to
explain things on a line-by-line basis.
2008-07-08 13:59:08 -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
Eric Hanchrow ea449615d8 Documentation: fix broken "linkgit" links
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-08 13:02:11 -07:00
Eric Hanchrow 843c81dcf4 user-manual: typo and grammar fixes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-08 13:00:47 -07:00
Junio C Hamano 39f319f4d5 Merge branch 'qq/maint' (early part) into maint
* 'qq/maint' (early part):
  git-svn.perl: workaround assertions in svn library 1.5.0
  mailinfo: feed the correct line length to decode_transfer_encoding()
  git-clone: remove leftover debugging fprintf().
  Fix "config_error_nonbool" used with value instead of key
  clone -q: honor "quiet" option over native transports.
  attribute documentation: keep EXAMPLE at end
  builtin-commit.c: Use 'git_config_string' to get 'commit.template'
  http.c: Use 'git_config_string' to clean up SSL config.
  diff.c: Use 'git_config_string' to get 'diff.external'
  convert.c: Use 'git_config_string' to get 'smudge' and 'clean'
  builtin-log.c: Use 'git_config_string' to get 'format.subjectprefix' and 'format.suffix'
  Documentation cvs: Clarify when a bare repository is needed
  Documentation: be precise about which date --pretty uses
2008-07-07 16:09:17 -07:00
Junio C Hamano 92371226ac Update draft release notes for 1.6.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-07 02:19:46 -07:00
Junio C Hamano 86d7244321 Merge branch 'jc/rerere'
* jc/rerere:
  rerere.autoupdate
  t4200: fix rerere test
  rerere: remove dubious "tail_optimization"
  git-rerere: detect unparsable conflicts
  rerere: rerere_created_at() and has_resolution() abstraction
2008-07-07 02:17:28 -07:00
Junio C Hamano 17d778e710 Merge branch 'dr/ceiling'
* dr/ceiling:
  Eliminate an unnecessary chdir("..")
  Add support for GIT_CEILING_DIRECTORIES
  Fold test-absolute-path into test-path-utils
  Implement normalize_absolute_path

Conflicts:

	cache.h
	setup.c
2008-07-07 02:17:23 -07:00
Junio C Hamano 5e97f464df Merge branch 'db/no-git-config'
* db/no-git-config:
  Only use GIT_CONFIG in "git config", not other programs

Conflicts:

	Documentation/RelNotes-1.6.0.txt
2008-07-07 02:17:14 -07:00
Junio C Hamano 585ad90c80 Merge branch 'maint'
* maint:
  Fix grammar in git-rev-parse(1).
2008-07-07 02:11:28 -07:00
Junio C Hamano f556388747 git-apply --directory: make --root more similar to GNU diff
Applying a patch in the directory that is different from what the patch
records is done with --directory option in GNU diff.  The --root option we
introduced previously does the same, and we can call it the same way to
give users more familiar feel.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-06 19:33:08 -07:00
Mikael Magnusson faf466ffb1 Fix grammar in git-rev-parse(1).
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-06 19:20:50 -07:00
Junio C Hamano 08b51f51e6 Merge branch 'qq/maint'
* qq/maint:
  clone -q: honor "quiet" option over native transports.
  attribute documentation: keep EXAMPLE at end
  builtin-commit.c: Use 'git_config_string' to get 'commit.template'
  http.c: Use 'git_config_string' to clean up SSL config.
  diff.c: Use 'git_config_string' to get 'diff.external'
  convert.c: Use 'git_config_string' to get 'smudge' and 'clean'
  builtin-log.c: Use 'git_config_string' to get 'format.subjectprefix' and 'format.suffix'
  Documentation cvs: Clarify when a bare repository is needed
  Documentation: be precise about which date --pretty uses

Conflicts:

	Documentation/gitattributes.txt
2008-07-05 18:33:16 -07:00
Junio C Hamano 8a33dd8b6e attribute documentation: keep EXAMPLE at end
The document gives overall definition of states in DESCRIPTION, describes
various aspects of git operations that can be influenced in EFFECTS, and
finally gives examples in the EXAMPLE section.  Archive creation however
was somehow documented after the EXAMPLE section, not insode EFFECTS.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-05 18:31:15 -07:00