Commit Graph

7688 Commits

Author SHA1 Message Date
J. Bruce Fields
559e4d7a0d user-manual: reflogs, other recovery
Add a brief discussion of reflogs.  Also recovery of dangling commits
seems to fit in here, so move some of the discussion out of Linus's
email to here.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-29 01:31:35 -05:00
J. Bruce Fields
61b41790c4 user-manual: fix a header level
Oops.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-29 00:45:33 -05:00
J. Bruce Fields
988b27d3f5 user-manual: typo fix
Oops

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-29 00:33:57 -05:00
J. Bruce Fields
fc90c536dc user-manual: add references to git-config man page
Direct editing of config files may be more natural for users than using
the git-config commandline; but we should still reference the
git-config man page when we describe such editing, so people know where
to go for details on the config file syntax and meanings of the
variables.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-29 00:17:51 -05:00
J. Bruce Fields
9d13bda3ff user-manual: repo-config -> config
Looks like we're going to allow git-config as the preferred alias to
git-repo-config, so let's document that instead.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-28 23:50:22 -05:00
J. Bruce Fields
04e50e9457 user-manual: fsck-objects -> fsck
There seems to be an agreement to rename fsck-objects to fsck.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-28 23:31:47 -05:00
J. Bruce Fields
21dcb3b7ab user-manual: git-fsck, dangling objects
Initial import of fsck and dangling objects discussion, mostly lifted from
an email from Linus.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-28 23:29:19 -05:00
J. Bruce Fields
b181d57ff4 user-manual: reorganize fetch discussion, add internals, etc.
Keep git remote discussion in the first chapter, but postpone
lower-level git fetch usage (to fetch individual branches) till later.

Import a bunch of slightly modified text from the readme to give an
architectural overview at the end.

Add more discussion of history rewriting.

And a bunch of other miscellaneous changes....

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-27 01:12:19 -05:00
J. Bruce Fields
11e016a32c user-manual: stub discussion of fsck and reflog
Have some sort of recovery/reliability section that deals with reflog
and fsck.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-26 00:17:12 -05:00
J. Bruce Fields
17217090cf user-manual: update git-gc discussion
It appears git-gc will no longer prune automatically, so we don't
need to tell people not to do other stuff while running it.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-21 23:03:36 -05:00
J. Bruce Fields
f60b964249 user-manual: update references discussion
Since references may be packed, it's no longer as helpful to
introduce references as paths relative to .git.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-21 22:31:07 -05:00
J. Bruce Fields
fe4b3e591b user-manual: clarify difference between tag and branch
Explain the difference (well, one of the differences) between a tag
and a branch.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-21 22:14:39 -05:00
J. Bruce Fields
e4add70cd4 user-manual: minor quickstart reorganization
Move around some stuff in the quickstart, add "push" examples.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-21 22:02:34 -05:00
J. Bruce Fields
ef89f701a0 user-manual: add "quick start" as chapter 1
Add a "quick start" guide, modelled after Mercurial's, as the
first chapter.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-20 21:41:48 -05:00
J. Bruce Fields
2f99710cfe user-manual: rewrap, fix heading levels
Fix some heading levels that prevented compile; rewrap some stuff.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-14 22:43:47 -05:00
J. Bruce Fields
67583917e9 Merge branch 'master' of git://git.kernel.org/pub/scm/git/git 2007-01-14 19:27:28 -05:00
J. Bruce Fields
69f7ad730a user-manual: reindent
Just some minor reindenting

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-01-14 16:29:40 -05:00
Junio C Hamano
f4b6c6b90f Merge branch 'jc/int'
* jc/int:
  More tests in t3901.
  Consistent message encoding while reusing log from an existing commit.
  t3901: test "format-patch | am" pipe with i18n
  Use log output encoding in --pretty=email headers.
2007-01-14 12:04:25 -08:00
Junio C Hamano
6de33478af Merge branch 'sp/merge' (early part)
* 'sp/merge' (early part):
  Improve merge performance by avoiding in-index merges.
2007-01-14 12:03:53 -08:00
Junio C Hamano
3681d40b96 Merge branch 'jc/subdir'
* jc/subdir:
  Allow whole-tree operations to be started from a subdirectory
  Use cd_to_toplevel in scripts that implement it by hand.
  Define cd_to_toplevel shell function in git-sh-setup
2007-01-14 11:41:36 -08:00
Shawn O. Pearce
e6e2bd6201 Remove read_or_die in favor of better error messages.
Originally I introduced read_or_die for the purpose of reading
the pack header and trailer, and I was too lazy to print proper
error messages.

Linus Torvalds <torvalds@osdl.org>:
> For a read error, at the very least you have to say WHICH FILE
> couldn't be read, because it's usually a matter of some file just
> being too short, not some system-wide problem.

and of course Linus is right. Make it so.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 00:42:41 -08:00
Shawn O. Pearce
38434f2eed Hide output about SVN::Core not being found during tests.
If the user doesn't have SVN::Core installed or working then the
SVN tests properly turn themselves off.  But the user doesn't need
to know that SVN::Core isn't loadable as a Perl module.  Unless of
course they are trying to debug the test, so lets relegate the Perl
failures to --verbose only.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 00:40:12 -08:00
Nicolas Pitre
dcbc7bbe39 simplify the "no changes added to commit" message
Suggesting the use of [-a|-i|-o] with git-commit is unnecessarily
complex and confusing.  In this context -o is totally useless and -i
requires extra arguments which are not mentioned.  The only sensible
hint (besides reading the man page but let's not go there) is
"commit -a".

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-13 18:48:10 -08:00
Junio C Hamano
c34c6008bc More tests in t3901.
This adds tests for "cherry-pick" and "rebase --merge" (and
indirectly "commit -C" since it is used in the latter) to make
sure they create a new commit with correct encoding.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-13 13:34:44 -08:00
Junio C Hamano
5ac2715f2e Consistent message encoding while reusing log from an existing commit.
The following commands can reuse log message from an existing
commit while creating a new commit:

	git-cherry-pick
	git-rebase (both with and without --merge)
	git-commit (-c and -C)

When the original commit was made in a different encoding from
the current i18n.commitencoding, "cat-file commit" would give a
string that is inconsistent with what the resulting commit will
claim to be in.  Replace them with "git show -s --encoding".

"git-rebase" without --merge is "git format-patch" piped to "git
am" in essence, and has been taken care of before this commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-13 13:33:07 -08:00
Junio C Hamano
696b1b507f git-commit documentation: -a adds and also removes
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-13 12:26:13 -08:00
Junio C Hamano
a731ec5eb8 t3901: test "format-patch | am" pipe with i18n
This checks combinations of i18n.commitencoding (declares what
encoding you are feeding commit-tree to make commits) and
i18n.logoutputencoding (instructs what encoding to emit the
commit message out to log output, including e-mail format) to
make sure the "format-patch | am" pipe used in git-rebase works
correctly.

I suspect "git cherry-pick" and "git rebase --merge" may fail
similar tests.  We'll see.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-13 10:10:20 -08:00
Junio C Hamano
f7e68b2967 Use log output encoding in --pretty=email headers.
Private functions add_rfc2047() and pretty_print_commit() assumed
they are only emitting UTF-8.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-13 10:10:20 -08:00
Quy Tonthat
c03f77573a git-remote: no longer silent on unknown commands.
Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-13 10:03:44 -08:00
Eric Wong
e66191f483 git-svn: fix tests to work with older svn
Some of the recent changes and shortcuts to the tests broke
things for people using older versions of svn:

t9104-git-svn-follow-parent.sh:
  v1.2.3 (from SuSE 10.0 as reported by riddochc on #git
  (thanks!)) required an extra 'svn up'.  I was also able to
  reproduce this with v1.1.4 (Debian Sarge).

lib-git-svn.sh:
  SVN::Repos bindings in versions up to and including 1.1.4
  (Sarge again) do not pass fs-config options to the underlying
  library.  BerkeleyDB repositories also seem completely broken
  on all my Sarge machines; so not using FSFS does not seem to
  be an option for most people.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-13 10:03:04 -08:00
Junio C Hamano
533b70390e Allow whole-tree operations to be started from a subdirectory
This updates five commands (merge, pull, rebase, revert and cherry-pick)
so that they can be started from a subdirectory.

This may not actually be what we want to do.  These commands are
inherently whole-tree operations, and an inexperienced user may
mistakenly expect a "git pull" from a subdirectory would merge
only the subdirectory the command started from.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 16:54:38 -08:00
Junio C Hamano
514c09fdcf Use cd_to_toplevel in scripts that implement it by hand.
This converts scripts that do "cd $(rev-parse --show-cdup)" by
hand to use cd_to_toplevel.

I think git-fetch does not have to go to the toplevel, but that
should be dealt with in a separate patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 16:54:38 -08:00
Junio C Hamano
9fde9401a9 Define cd_to_toplevel shell function in git-sh-setup
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 16:54:38 -08:00
Junio C Hamano
b60daf0515 Make git-prune-packed a bit more chatty.
Steven Grimm noticed that git-repack's verbosity is inconsistent
because pack-objects is chatty and prune-packed is not.  This
makes the latter a bit more chatty and gives -q option to
squelch it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 15:10:29 -08:00
Junio C Hamano
f215f27013 glossary typofix
Pointed out by Paul Witt <paul.witt@oxix.org>

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 14:13:53 -08:00
Nicolas Pitre
5c94f87e6b use 'init' instead of 'init-db' for shipped docs and tools
While 'init-db' still is and probably will always remain a valid git
command for obvious backward compatibility reasons, it would be a good
idea to move shipped tools and docs to using 'init' instead.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 13:36:16 -08:00
Junio C Hamano
120b0dfbed Explain "Not a git repository: '.git'".
Andy Parkins noticed that the error message some "whole tree"
oriented commands emit is stated misleadingly when they refused
to run from a subdirectory.

We could probably allow some of them to work from a subdirectory
but that is a semantic change that could have unintended side
effects, so let's start at first by rewording the error message
to be easier to read without doing anything else to be safe.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 12:26:39 -08:00
Junio C Hamano
1cf716a219 merge-recursive: do not report the resulting tree object name
It is not available in the outermost merge, and it is only
useful for debugging merge-recursive in the inner merges.

Sergey Vlasov noticed that the old code accesses an
uninitialized location.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 12:05:58 -08:00
Bob Proulx
397dfe67c7 git-revert: Fix die before git-sh-setup defines it.
The code previously checked it's own name and called 'die' upon
an error.  However 'die' was not yet defined because git-sh-setup
had not been sourced yet.  Instead simply write the error message
to stderr and exit with an error as was originally desired.

Signed-off-by: Bob Proulx <bob@proulx.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 00:13:34 -08:00
Michael S. Tsirkin
fc41be3b2e fix documentation for git-commit --no-verify
Despite what the documentation claims, git-commit does not check commit
for suspicious lines: all hooks are disabled by default,
and the pre-comit hook could be changed to do something else.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12 00:09:07 -08:00
Linus Torvalds
4494c656e2 Fix up totally buggered read_or_die()
The "read_or_die()" function would silently NOT die for a partial read,
and since it was of type "void" it obviously couldn't even return the
partial number of bytes read.

IOW, it was totally broken. This hopefully fixes it up.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-11 21:05:34 -08:00
Linus Torvalds
d34cf19b89 Clean up write_in_full() users
With the new-and-improved write_in_full() semantics, where a partial write
simply always returns a real error (and always sets 'errno' when that
happens, including for the disk full case), a lot of the callers of
write_in_full() were just unnecessarily complex.

In particular, there's no reason to ever check for a zero length or
return: if the length was zero, we'll return zero, otherwise, if a disk
full resulted in the actual write() system call returning zero the
write_in_full() logic would have correctly turned that into a negative
return value, with 'errno' set to ENOSPC.

I really wish every "write_in_full()" user would just check against "<0"
now, but this fixes the nasty and stupid ones.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-11 21:02:58 -08:00
Junio C Hamano
9bbaa6cc68 reflog-expire: brown paper bag fix.
When --stale-fix is not passed, the code did not initialize the
two commit objects properly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-11 19:56:43 -08:00
Junio C Hamano
ba70de01bb GIT v1.5.0-rc1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-11 18:22:48 -08:00
Junio C Hamano
94d23673e3 plug a few leaks in revision walking used in describe.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-11 18:05:53 -08:00
Shawn O. Pearce
80dbae03b0 Chose better tag names in git-describe after merges.
Recently git.git itself encountered a situation on its master and
next branches where git-describe stopped reporting 'v1.5.0-rc0-gN'
and instead started reporting 'v1.4.4.4-gN'.  This appeared to be
a backward jump in version numbering.

  maint     o-------------------4
            \                    \
  master     o-o-o-o-o-o-o-5-o-C-o-W

The issue is that commit C in the diagram claims it is version
1.5.0, as the tag v1.5.0 is placed on commit 5.  Yet commit W
claims it is version 1.4.4.4 as the tag v1.5.0 has an older tag
date than the v1.4.4.4 tag.

As it turns out this situation is very common.  A bug fix applied
to maint and later merged into master occurs frequently enough that
it should Just Work Right(tm).

Rather than taking the first tag that gets found git-describe will
now generate a list of all possible tags and select the one which
has the most number of commits in common with HEAD (or whatever
revision the user requested the description of).

This rule is based on the principle shown in the diagram above.
There are a large number of commits on the primary development branch
'master' which do not appear in the 'maint' branch, and many of
these are already tagged as part of v1.5.0-rc0.  Additionally these
commits are not in v1.4.4.4, as they are part of the v1.5.0 release
still being developed.  The v1.5.0-rc0 tag is more descriptive of
W than v1.4.4.4 is, and therefore should be used.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-11 18:05:53 -08:00
Junio C Hamano
e861ce1692 Merge branch 'jc/bare'
* jc/bare:
  Disallow working directory commands in a bare repository.
  git-fetch: allow updating the current branch in a bare repository.
  Introduce is_bare_repository() and core.bare configuration variable
  Move initialization of log_all_ref_updates
2007-01-11 16:50:36 -08:00
Junio C Hamano
141d21b825 Merge branch 'ar/merge-recursive'
* ar/merge-recursive:
  merge-recursive: do not use on-file index when not needed.
  Speed-up recursive by flushing index only once for all entries
2007-01-11 16:48:28 -08:00
Junio C Hamano
c388761c15 Merge branch 'jc/detached-head'
* jc/detached-head:
  git-checkout: handle local changes sanely when detaching HEAD
  git-checkout: safety check for detached HEAD checks existing refs
  git-checkout: fix branch name output from the command
  git-checkout: safety when coming back from the detached HEAD state.
  git-checkout: rewording comments regarding detached HEAD.
  git-checkout: do not warn detaching HEAD when it is already detached.
  Detached HEAD (experimental)
  git-branch: show detached HEAD
  git-status: show detached HEAD
2007-01-11 16:47:34 -08:00
Junio C Hamano
4d229653ab git-status: wording update to deal with deleted files.
If you do:

	$ /bin/rm foo
	$ git status

we used to say "git add ... to add content to commit".  But
suggsting "git add" to record the deletion of a file is simply
insane.

So this rewords various things:

 - The section header is the old "Changed but not updated",
   instead of "Changed but not added";

 - Suggestion is "git add ... to update what will be committed",
   instead of "... to add content to commit";

 - If there are removed paths, the above suggestion becomes "git
   add/rm ... to update what will be committed";

 - For untracked files, the suggestion is "git add ... to
   include in what will be committed".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-11 15:34:41 -08:00