git.git
18 years agoreflog expire: do not punt on tags that point at non commits.
Junio C Hamano [Sat, 23 Dec 2006 07:42:30 +0000 (23:42 -0800)]
reflog expire: do not punt on tags that point at non commits.

It is unusual for a tag to point at a non-commit, and it is also
unusual for a tag to have reflog, but that is not an error and
we should still prune its reflog entries just as other refs.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoreflog expire: prune commits that are not incomplete
Junio C Hamano [Fri, 22 Dec 2006 08:46:33 +0000 (00:46 -0800)]
reflog expire: prune commits that are not incomplete

Older fsck-objects and prune did not protect commits in reflog
entries, and it is quite possible that a commit still exists in
the repository (because it was in a pack, or something) while
some of its trees and blobs are long gone.  Make sure the commit
and its associated tree is complete and expire incomplete ones.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDon't crash during repack of a reflog with pruned commits.
Shawn O. Pearce [Fri, 22 Dec 2006 00:49:06 +0000 (19:49 -0500)]
Don't crash during repack of a reflog with pruned commits.

If the user has been using reflog for a long time (e.g. since its
introduction) then it is very likely that an existing branch's
reflog may still mention commits which have long since been pruned
out of the repository.

Rather than aborting with a very useless error message during
git-repack, pack as many valid commits as we can get from the
reflog and let the user know that the branch's reflog contains
already pruned commits.  A future 'git reflog expire' (or whatever
it finally winds up being called) can then be performed to expunge
those reflog entries.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'master' into jc/fsck-reflog
Junio C Hamano [Fri, 22 Dec 2006 07:01:45 +0000 (23:01 -0800)]
Merge branch 'master' into jc/fsck-reflog

* master:
  Introduce a global level warn() function.
  Rename imap-send's internal info/warn functions.
  _XOPEN_SOURCE problem also exists on FreeBSD
  parse-remote: mark all refs not for merge only when fetching more than one
  git-reset --hard: tell the user what the HEAD was reset to
  git-tag: support -F <file> option
  Revert "git-pull: refuse default merge without branch.*.merge"
  Suggest 'add' in am/revert/cherry-pick.
  Use git-merge-file in git-merge-one-file, too
  diff --check: fix off by one error
  Documentation/git-branch: new -r to delete remote-tracking branches.
  Fix system header problems on Mac OS X
  spurious .sp in manpages

18 years agoIntroduce a global level warn() function.
Shawn O. Pearce [Fri, 22 Dec 2006 00:48:32 +0000 (19:48 -0500)]
Introduce a global level warn() function.

Like the existing error() function the new warn() function can be
used to describe a situation that probably should not be occuring,
but which the user (and Git) can continue to work around without
running into too many problems.

An example situation is a bad commit SHA1 found in a reflog.
Attempting to read this record out of the reflog isn't really an
error as we have skipped over it in the past.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoRename imap-send's internal info/warn functions.
Shawn O. Pearce [Fri, 22 Dec 2006 00:48:12 +0000 (19:48 -0500)]
Rename imap-send's internal info/warn functions.

Because I am about to introduce a global warn() function (much
like the global error function) this global declaration would
conflict with the one supplied by imap-send.  Further since
imap-send's warn function output depends on its Quiet setting
we cannot simply remove its internal definition and use the
forthcoming global one.

So refactor warn() -> imap_warn() and info() -> imap_info()
(the latter was done just to be consistent in naming).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years ago_XOPEN_SOURCE problem also exists on FreeBSD
Junio C Hamano [Fri, 22 Dec 2006 06:51:42 +0000 (22:51 -0800)]
_XOPEN_SOURCE problem also exists on FreeBSD

Suggested by Rocco Rutte, Marco Roeland and others.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoparse-remote: mark all refs not for merge only when fetching more than one
Junio C Hamano [Fri, 22 Dec 2006 06:39:09 +0000 (22:39 -0800)]
parse-remote: mark all refs not for merge only when fetching more than one

An earlier commit a71fb0a1 implemented much requested safety
valve to refuse "git pull" or "git pull origin" without explicit
refspecs from using the first set of remote refs obtained by
reading .git/remotes/origin file or branch.*.fetch configuration
variables to create a merge.  The argument was that while on a
branch different from the default branch, it is often wrong to
merge the default remote ref suitable for merging into the master.

That is fine as a theory.  But many repositories already in use
by people in the real world do not have any of the per branch
configuration crap.  They did not need it, and they do not need
it now.  Merging with the first remote ref listed was just fine,
because they had only one ref (e.g. 'master' from linux-2.6.git)
anyway.

So this changes the safety valve to be a lot looser.  When "git
fetch" gets only one remote branch, the irritating warning would
not trigger anymore.

I think we could also make the warning trigger when branch.*.merge
is not specified for the current branch, but is for some other
branch.  That is for another commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'maint'
Junio C Hamano [Fri, 22 Dec 2006 06:56:04 +0000 (22:56 -0800)]
Merge branch 'maint'

* maint:
  diff --check: fix off by one error
  spurious .sp in manpages

18 years agogit-reset --hard: tell the user what the HEAD was reset to
Johannes Schindelin [Thu, 21 Dec 2006 14:26:35 +0000 (15:26 +0100)]
git-reset --hard: tell the user what the HEAD was reset to

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-tag: support -F <file> option
Johannes Schindelin [Thu, 21 Dec 2006 14:13:02 +0000 (15:13 +0100)]
git-tag: support -F <file> option

This imitates the behaviour of git-commit.

Noticed by Han-Wen Nienhuys.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoRevert "git-pull: refuse default merge without branch.*.merge"
Junio C Hamano [Fri, 22 Dec 2006 06:10:56 +0000 (22:10 -0800)]
Revert "git-pull: refuse default merge without branch.*.merge"

This reverts commit a71fb0a1412c82405f078fb536797d3f5de68d53.

The logic to decide when to refuse to use the default "first set of
refs fetched" for merge was utterly bogus.

In a repository that happily worked correctly without any of the
per-branch configuration crap did not have (and did not have to
have) any branch.<current>.merge.  With that broken commit, pulling
from origin no longer would work.

18 years agoSuggest 'add' in am/revert/cherry-pick.
Shawn O. Pearce [Fri, 22 Dec 2006 02:30:17 +0000 (21:30 -0500)]
Suggest 'add' in am/revert/cherry-pick.

Now that we have decided to make 'add' behave like 'update-index'
(and therefore fully classify update-index as strictly plumbing)
the am/revert/cherry-pick family of commands should not steer the
user towards update-index.  Instead send them to the command they
probably already know, 'add'.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoUse git-merge-file in git-merge-one-file, too
Johannes Schindelin [Fri, 22 Dec 2006 02:20:55 +0000 (03:20 +0100)]
Use git-merge-file in git-merge-one-file, too

Would you believe? I edited git-merge-one-file (note the missing ".sh"!)
when I submitted the patch which became commit e2b7008752...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agodiff --check: fix off by one error
Johannes Schindelin [Fri, 22 Dec 2006 02:20:11 +0000 (03:20 +0100)]
diff --check: fix off by one error

When parsing the diff line starting with '@@', the line number of the
'+' file is parsed. For the subsequent line parses, the line number
should therefore be incremented after the parse, not before it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-branch: new -r to delete remote-tracking branches.
Quy Tonthat [Thu, 21 Dec 2006 04:18:07 +0000 (15:18 +1100)]
Documentation/git-branch: new -r to delete remote-tracking branches.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoFix system header problems on Mac OS X
Terje Sten Bjerkseth [Thu, 21 Dec 2006 01:32:21 +0000 (17:32 -0800)]
Fix system header problems on Mac OS X

For Mac OS X 10.4, _XOPEN_SOURCE defines _POSIX_C_SOURCE which
hides many symbols from the program.

Breakage noticed and initial analysis provided by Randal
L. Schwartz.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit reflog expire
Junio C Hamano [Tue, 19 Dec 2006 08:23:12 +0000 (00:23 -0800)]
git reflog expire

This prepares a place to collect reflog management subcommands,
and implements "expire" action.

$ git reflog expire --dry-run \
--expire=4.weeks \
--expire-unreachable=1.week \
refs/heads/master

The expiration uses two timestamps: --expire and --expire-unreachable.
Entries older than expire time (defaults to 90 days), and entries older
than expire-unreachable time (defaults to 30 days) and records a commit
that has been rewound and made unreachable from the current tip of the
ref are removed from the reflog.

The parameter handling is still rough, but I think the
core logic for expiration is already sound.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMove in_merge_bases() to commit.c
Junio C Hamano [Tue, 19 Dec 2006 08:14:04 +0000 (00:14 -0800)]
Move in_merge_bases() to commit.c

This reasonably useful function was hidden inside builtin-branch.c

18 years agoreflog: fix warning message.
Junio C Hamano [Tue, 19 Dec 2006 06:07:45 +0000 (22:07 -0800)]
reflog: fix warning message.

When ref@{N} is specified on a ref that has only M entries (M < N),
instead of saying the initial timestamp the reflog has, warn that
there is only M entries.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach git-repack to preserve objects referred to by reflog entries.
Junio C Hamano [Tue, 19 Dec 2006 01:25:28 +0000 (17:25 -0800)]
Teach git-repack to preserve objects referred to by reflog entries.

This adds a new option --reflog to pack-objects and revision
machinery; do not bother documenting it for now, since this is
only useful for local repacking.

When the option is passed, objects reachable from reflog entries
are marked as interesting while computing the set of objects to
pack.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoProtect commits recorded in reflog from pruning.
Junio C Hamano [Mon, 18 Dec 2006 09:36:16 +0000 (01:36 -0800)]
Protect commits recorded in reflog from pruning.

This teaches fsck-objects and prune to protect objects referred
to by reflog entries.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoadd for_each_reflog_ent() iterator
Junio C Hamano [Mon, 18 Dec 2006 09:18:16 +0000 (01:18 -0800)]
add for_each_reflog_ent() iterator

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'ew/svn-pm'
Junio C Hamano [Thu, 21 Dec 2006 01:20:45 +0000 (17:20 -0800)]
Merge branch 'ew/svn-pm'

* ew/svn-pm:
  git-svn: rename 'commit' command to 'set-tree'
  git-svn: remove support for the svn command-line client
  git-svn: convert to using Git.pm

18 years agodiff documentation: mostly talk about <commit>
Junio C Hamano [Wed, 20 Dec 2006 22:41:54 +0000 (14:41 -0800)]
diff documentation: mostly talk about <commit>

This corrects minor remaining bits that still talked about <tree-ish>;
the Porcelain users (as opposed to plumbers) are mostly interested in
commits so use <commit> consistently and keep a sentence that mentions
that <tree-ish> can be used in place of them.

18 years agoMerge branch 'jc/leftright'
Junio C Hamano [Wed, 20 Dec 2006 22:20:17 +0000 (14:20 -0800)]
Merge branch 'jc/leftright'

* jc/leftright:
  Revert "Make left-right automatic."
  Make left-right automatic.
  Teach all of log family --left-right output.
  rev-list --left-right

18 years agoMerge branch 'jc/blame'
Junio C Hamano [Wed, 20 Dec 2006 21:58:10 +0000 (13:58 -0800)]
Merge branch 'jc/blame'

* jc/blame:
  blame: -b (blame.blankboundary) and --root (blame.showroot)

18 years agoMerge branch 'jc/branch-remove-remote'
Junio C Hamano [Wed, 20 Dec 2006 21:57:59 +0000 (13:57 -0800)]
Merge branch 'jc/branch-remove-remote'

* jc/branch-remove-remote:
  git-branch -d: do not stop at the first failure.
  Teach git-branch to delete tracking branches with -r -d

18 years agoMerge branch 'jc/clone'
Junio C Hamano [Wed, 20 Dec 2006 21:56:14 +0000 (13:56 -0800)]
Merge branch 'jc/clone'

* jc/clone:
  Move "no merge candidate" warning into git-pull
  Use preprocessor constants for environment variable names.
  Do not create $GIT_DIR/remotes/ directory anymore.
  Introduce GIT_TEMPLATE_DIR
  Revert "fix testsuite: make sure they use templates freshly built from the source"
  fix testsuite: make sure they use templates freshly built from the source
  git-clone: lose the traditional 'no-separate-remote' layout
  git-clone: lose the artificial "first" fetch refspec
  git-pull: refuse default merge without branch.*.merge
  git-clone: use wildcard specification for tracking branches

18 years agocompat/inet_ntop: do not use u_int
Junio C Hamano [Wed, 20 Dec 2006 21:45:55 +0000 (13:45 -0800)]
compat/inet_ntop: do not use u_int

It is pointless.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agospurious .sp in manpages
Junio C Hamano [Wed, 13 Dec 2006 08:58:28 +0000 (00:58 -0800)]
spurious .sp in manpages

This cherry-picks 7ef04350 that has been applied to the 'master'
to fix ".sp" in generated manpages.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-add: error out when given no arguments.
Junio C Hamano [Wed, 20 Dec 2006 21:06:46 +0000 (13:06 -0800)]
git-add: error out when given no arguments.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'maint'
Junio C Hamano [Wed, 20 Dec 2006 19:24:56 +0000 (11:24 -0800)]
Merge branch 'maint'

* maint:
  GIT 1.4.4.3

18 years agoGIT 1.4.4.3 v1.4.4.3
Junio C Hamano [Wed, 20 Dec 2006 19:23:22 +0000 (11:23 -0800)]
GIT 1.4.4.3

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoclarify some error messages wrt unknown object types
Nicolas Pitre [Wed, 20 Dec 2006 18:34:05 +0000 (13:34 -0500)]
clarify some error messages wrt unknown object types

If ever new object types are added for future extensions then better
have current git version report them as "unknown" instead of
"corrupted".

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agosimplify inclusion of system header files.
Junio C Hamano [Tue, 19 Dec 2006 22:34:12 +0000 (14:34 -0800)]
simplify inclusion of system header files.

This is a mechanical clean-up of the way *.c files include
system header files.

 (1) sources under compat/, platform sha-1 implementations, and
     xdelta code are exempt from the following rules;

 (2) the first #include must be "git-compat-util.h" or one of
     our own header file that includes it first (e.g. config.h,
     builtin.h, pkt-line.h);

 (3) system headers that are included in "git-compat-util.h"
     need not be included in individual C source files.

 (4) "git-compat-util.h" does not have to include subsystem
     specific header files (e.g. expat.h).

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoindex-pack usage of mmap() is unacceptably slower on many OSes other than Linux
Nicolas Pitre [Tue, 19 Dec 2006 15:53:08 +0000 (10:53 -0500)]
index-pack usage of mmap() is unacceptably slower on many OSes other than Linux

It was reported by Randal L. Schwartz <merlyn@stonehenge.com> that
indexing the Linux repository ~150MB pack takes about an hour on OS x
while it's a minute on Linux.  It seems that the OS X mmap()
implementation is more than 2 orders of magnitude slower than the Linux
one.

Linus proposed a patch replacing mmap() with pread() bringing index-pack
performance on OS X in line with the Linux one.  The performances on
Linux also improved by a small margin.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Show '...' links in "summary" view only if there are more items
Robert Fitzsimons [Tue, 19 Dec 2006 12:08:54 +0000 (12:08 +0000)]
gitweb: Show '...' links in "summary" view only if there are more items

Show "..." links in "summary" view to shortlog, heads (if there are
any), and tags (if there are any) only if there are more items to show
than shown already.

This means that "..." link is shown below shortened shortlog if there
are more than 16 commits, "..." link below shortened heads list if
there are more than 16 heads refs (16 branches), "..." link below
shortened tags list if there are more than 16 tags.

Modified patch from Jakub to to apply cleanly to master, also preform
the same "..." link logic to the forks list.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoconfig_rename_section: fix FILE* leak
Junio C Hamano [Wed, 20 Dec 2006 05:55:27 +0000 (21:55 -0800)]
config_rename_section: fix FILE* leak

Noticed by SungHyun Nam.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoRemove COLLISION_CHECK from Makefile since it's not used.
Brian Gernhardt [Wed, 20 Dec 2006 03:25:13 +0000 (22:25 -0500)]
Remove COLLISION_CHECK from Makefile since it's not used.

It's rather misleading to have configuration options that don't do
anything.  If someone adds collision checking they might also want to
restore this option.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agofix populate-filespec
Junio C Hamano [Wed, 20 Dec 2006 02:26:48 +0000 (18:26 -0800)]
fix populate-filespec

I hand munged the original patch when committing 1510fea78, and
screwed up the conversion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-cvsserver: fix breakage when calling git merge-file
Eric Wong [Tue, 19 Dec 2006 22:58:20 +0000 (14:58 -0800)]
git-cvsserver: fix breakage when calling git merge-file

In the same vein as 8336afa563fbeff35e531396273065161181f04c,
this fixes the the RCS merge to git-merge-file conversion in
commit e2b70087.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoRevert "Make left-right automatic."
Junio C Hamano [Tue, 19 Dec 2006 10:28:16 +0000 (02:28 -0800)]
Revert "Make left-right automatic."

This reverts commit 5761231975ceffa531d86d9bab0f9a9a370674f6.

Feeding symmetric difference to gitk is so useful, and it is the
same for other graphical Porcelains.  Rather than forcing them
to pass --no-left-right, making it optional.

Noticed and reported by Jeff King.

18 years agoMove "no merge candidate" warning into git-pull
Josef Weidendorfer [Tue, 19 Dec 2006 00:39:07 +0000 (01:39 +0100)]
Move "no merge candidate" warning into git-pull

The warning triggered even when running "git fetch" only
when resulting .git/FETCH_HEAD only contained
branches marked as 'not-for-merge'.

Signed-off-by: Josef Weidendorfer <weidendo@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoUse preprocessor constants for environment variable names.
Junio C Hamano [Tue, 19 Dec 2006 09:28:15 +0000 (01:28 -0800)]
Use preprocessor constants for environment variable names.

We broke the discipline Linus set up to allow compiler help us
avoid typos in environment names in the early days of git over
time.  This defines a handful preprocessor constants for
environment variable names used in relatively core parts of the
system.

I've left out variable names specific to subsystems such as HTTP
and SSL as I do not think they are big problems.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDo not create $GIT_DIR/remotes/ directory anymore.
Junio C Hamano [Tue, 19 Dec 2006 09:50:37 +0000 (01:50 -0800)]
Do not create $GIT_DIR/remotes/ directory anymore.

Because we do not use --no-separate-remote anymore, there is no
reason to create that directory from the template.

t5510 test is updated to test both $GIT_DIR/remotes/ based
configuration and $GIT_DIR/config variable (credits to
Johannes).

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'jc/test-clone' into jc/clone
Junio C Hamano [Tue, 19 Dec 2006 09:38:18 +0000 (01:38 -0800)]
Merge branch 'jc/test-clone' into jc/clone

* jc/test-clone: (35 commits)
  Introduce GIT_TEMPLATE_DIR
  Revert "fix testsuite: make sure they use templates freshly built from the source"
  fix testsuite: make sure they use templates freshly built from the source
  rerere: fix breakage of resolving.
  Add config example with respect to branch
  Add documentation for show-branch --topics
  make git a bit less cryptic on fetch errors
  make patch_delta() error cases a bit more verbose
  racy-git: documentation updates.
  show-ref: fix --exclude-existing
  parse-remote::expand_refs_wildcard()
  vim syntax: follow recent changes to commit template
  show-ref: fix --verify --hash=length
  show-ref: fix --quiet --verify
  avoid accessing _all_ loose refs in git-show-ref --verify
  git-fetch: Avoid reading packed refs over and over again
  Teach show-branch how to show ref-log data.
  markup fix in svnimport documentation.
  Documentation: new option -P for git-svnimport
  Fix mis-mark-up in git-merge-file.txt documentation
  ...

18 years agoIntroduce GIT_TEMPLATE_DIR
Johannes Schindelin [Tue, 19 Dec 2006 08:18:09 +0000 (09:18 +0100)]
Introduce GIT_TEMPLATE_DIR

Instead of passing --template explicitely to init-db and clone, you can
just set the environment variable GIT_TEMPLATE_DIR.

Also make use of it in the tests, to make sure that the templates are
copied.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoRevert "fix testsuite: make sure they use templates freshly built from the source"
Junio C Hamano [Tue, 19 Dec 2006 09:14:35 +0000 (01:14 -0800)]
Revert "fix testsuite: make sure they use templates freshly built from the source"

This reverts commit 74d20040cafdced657efbf49795183d209a3a07b.
Version from Johannes to introduce GIT_TEMPLATE_DIR is simpler,
although I unconsciously stayed away from introducing yet another
environment variable.

18 years agoblame: -b (blame.blankboundary) and --root (blame.showroot)
Junio C Hamano [Mon, 18 Dec 2006 22:04:38 +0000 (14:04 -0800)]
blame: -b (blame.blankboundary) and --root (blame.showroot)

When blame.blankboundary is set (or -b option is given), commit
object names are blanked out in the "human readable" output
format for boundary commits.

When blame.showroot is not set (or --root is not given), the
root commits are treated as boundary commits.  The code still
attributes the lines to them, but with -b their object names are
not shown.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-branch -d: do not stop at the first failure.
Quy Tonthat [Mon, 18 Dec 2006 22:42:16 +0000 (09:42 +1100)]
git-branch -d: do not stop at the first failure.

If there are more than one branches to be deleted, failure on
one will no longer stop git-branch to process the next ones.
The command still reports failures by exitting non-zero status.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach git-branch to delete tracking branches with -r -d
Junio C Hamano [Mon, 18 Dec 2006 07:58:16 +0000 (23:58 -0800)]
Teach git-branch to delete tracking branches with -r -d

Because -r already means "remote" when listing, you can say:

$ git branch -d -r origin/todo origin/html origin/man

I just twisted it not to check fast-forwardness with the current
branch when you are removing a tracking branch.  Most likely,
removal of a tracking branch is not because you are "done with"
it (for a local branch, it usually means "you merged it up"),
but because you are not even interested in it.  In other words,
remote tracking branches are more like tags than branches.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agofix testsuite: make sure they use templates freshly built from the source
Junio C Hamano [Mon, 18 Dec 2006 23:27:43 +0000 (15:27 -0800)]
fix testsuite: make sure they use templates freshly built from the source

The initial t/trash repository for testing was created properly
but over time we gained many tests that create secondary test
repositories with init-db or clone and they were not careful
enough.

This fixes it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agorerere: fix breakage of resolving.
Junio C Hamano [Tue, 19 Dec 2006 00:20:53 +0000 (16:20 -0800)]
rerere: fix breakage of resolving.

commit e2b70087 botched the RCS merge to git-merge-file conversion.
There is no command called "git merge-file" (yes, we are using safer
variant of Perl's system(3)).

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd config example with respect to branch
Aneesh Kumar K.V [Thu, 7 Dec 2006 06:36:55 +0000 (12:06 +0530)]
Add config example with respect to branch

Update config.txt with example with respect to branch
config variable. This give a better idea regarding
how branch names are expected.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd documentation for show-branch --topics
Brian Gernhardt [Mon, 18 Dec 2006 15:48:33 +0000 (10:48 -0500)]
Add documentation for show-branch --topics

Add a quick paragraph explaining the --topics option for show-branch.
The explanation is an abbreviated version of the commit message from
d320a5437f8304cf9ea3ee1898e49d643e005738.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agomake git a bit less cryptic on fetch errors
Nicolas Pitre [Mon, 18 Dec 2006 20:16:58 +0000 (15:16 -0500)]
make git a bit less cryptic on fetch errors

The remote server might not want to tell why it doesn't like us for
security reasons, but let's make the client report such error in a bit
less confusing way.  The remote failure remains a mystery, but the local
message might be a bit less so.

[jc: with a gentle wording updates from Andy Parkins]

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agomake patch_delta() error cases a bit more verbose
Nicolas Pitre [Mon, 18 Dec 2006 21:06:50 +0000 (16:06 -0500)]
make patch_delta() error cases a bit more verbose

It is especially important to distinguish between a malloc() failure
from all the other cases.  An out of memory condition is much less
worrisome than a compatibility/corruption problem.

Also make test-delta compilable again.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoracy-git: documentation updates.
Junio C Hamano [Mon, 18 Dec 2006 22:18:54 +0000 (14:18 -0800)]
racy-git: documentation updates.

We've removed the workaround for runtime penalty that did not
exist in practice some time ago, but the technical paper that
proposed that change still said "we probably should do so".

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoshow-ref: fix --exclude-existing
Junio C Hamano [Mon, 18 Dec 2006 21:33:47 +0000 (13:33 -0800)]
show-ref: fix --exclude-existing

Do not falsely document --filter-invalid which does not even exist.
Also make sure the line is long enough to have ^{} suffix before
checking for it.

Pointed out by Dscho.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoparse-remote::expand_refs_wildcard()
Junio C Hamano [Mon, 18 Dec 2006 20:13:46 +0000 (12:13 -0800)]
parse-remote::expand_refs_wildcard()

Work around dash incompatibility by not using "${name%'^{}'}".

Noticed by Jeff King; dash seems to mistake the closing brace
inside the single quote as the terminating brace for parameter
expansion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agovim syntax: follow recent changes to commit template
Jeff King [Mon, 18 Dec 2006 07:26:42 +0000 (02:26 -0500)]
vim syntax: follow recent changes to commit template

This patch changes the syntax highlighting to correctly match the new
text of the commit message introduced by
  82dca84871637ac9812c0dec27f56d07cfba524c

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoshow-ref: fix --verify --hash=length
Junio C Hamano [Mon, 18 Dec 2006 03:27:49 +0000 (19:27 -0800)]
show-ref: fix --verify --hash=length

An earlier optimization for --verify broke a lot of stuff
because it did not take interaction with other flags into
account.

This also fixes an unrelated argument parsing error; --hash=8
should mean the same as "--hash --abbrev=8".

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoshow-ref: fix --quiet --verify
Junio C Hamano [Mon, 18 Dec 2006 02:53:24 +0000 (18:53 -0800)]
show-ref: fix --quiet --verify

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'jc/blame-boundary'
Junio C Hamano [Mon, 18 Dec 2006 02:34:51 +0000 (18:34 -0800)]
Merge branch 'jc/blame-boundary'

* jc/blame-boundary:
  git-blame: show lines attributed to boundary commits differently.

18 years agoMerge branch 'jc/reflog' (early part)
Junio C Hamano [Mon, 18 Dec 2006 02:31:24 +0000 (18:31 -0800)]
Merge branch 'jc/reflog' (early part)

* 'jc/reflog' (early part):
  Teach show-branch how to show ref-log data.

18 years agoMerge branch 'js/branch-config'
Junio C Hamano [Mon, 18 Dec 2006 02:27:17 +0000 (18:27 -0800)]
Merge branch 'js/branch-config'

* js/branch-config:
  git-branch: rename config vars branch.<branch>.*, too
  add a function to rename sections in the config

18 years agoMerge branch 'jn/web' (early part)
Junio C Hamano [Mon, 18 Dec 2006 02:27:17 +0000 (18:27 -0800)]
Merge branch 'jn/web' (early part)

* 'jn/web' (early part):
  gitweb: Add "next" link to commit view
  gitweb: Add title attribute to ref marker with full ref name
  gitweb: Do not show difftree for merges in "commit" view
  gitweb: SHA-1 in commit log message links to "object" view
  gitweb: Hyperlink target of symbolic link in "tree" view (if possible)
  gitweb: Add generic git_object subroutine to display object of any type
  gitweb: Show target of symbolic link in "tree" view
  gitweb: Don't use Content-Encoding: header in git_snapshot

18 years agoavoid accessing _all_ loose refs in git-show-ref --verify
Junio C Hamano [Mon, 18 Dec 2006 02:08:52 +0000 (18:08 -0800)]
avoid accessing _all_ loose refs in git-show-ref --verify

If you want to verify a ref, it is overkill to first read all loose refs
into a linked list, and then check if the desired ref is there.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
18 years agogit-fetch: Avoid reading packed refs over and over again
Junio C Hamano [Mon, 18 Dec 2006 01:57:19 +0000 (17:57 -0800)]
git-fetch: Avoid reading packed refs over and over again

When checking which tags to fetch, the old code used to call
git-show-ref --verify for each remote tag. Since reading even
packed refs is not a cheap operation when there are a lot of
local refs, the code became quite slow.

This fixes it by teaching git-show-ref to filter out existing
refs using a new mode of operation of git-show-ref.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach show-branch how to show ref-log data.
Junio C Hamano [Thu, 14 Dec 2006 23:58:56 +0000 (15:58 -0800)]
Teach show-branch how to show ref-log data.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMake left-right automatic.
Junio C Hamano [Sun, 17 Dec 2006 00:07:20 +0000 (16:07 -0800)]
Make left-right automatic.

When using symmetric differences, I think the user almost always
would want to know which side of the symmetry each commit came
from.  So this removes --left-right option from the command
line, and turns it on automatically when a symmetric difference
is used ("git log --merge" counts as a symmetric difference
between HEAD and MERGE_HEAD).

Just in case, a new option --no-left-right is provided to defeat
this, but I do not know if it would be useful.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach all of log family --left-right output.
Junio C Hamano [Sat, 16 Dec 2006 23:31:25 +0000 (15:31 -0800)]
Teach all of log family --left-right output.

This makes reviewing

     git log --left-right --merge --no-merges -p

a lot more pleasant.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agorev-list --left-right
Junio C Hamano [Mon, 23 Oct 2006 00:32:47 +0000 (17:32 -0700)]
rev-list --left-right

The output from "symmetric diff", i.e. A...B, does not
distinguish between commits that are reachable from A and the
ones that are reachable from B.  In this picture, such a
symmetric diff includes commits marked with a and b.

         x---b---b  branch B
        / \ /
       /   .
      /   / \
     o---x---a---a  branch A

However, you cannot tell which ones are 'a' and which ones are
'b' from the output.  Sometimes this is frustrating.  This adds
an output option, --left-right, to rev-list.

        rev-list --left-right A...B

would show ones reachable from A prefixed with '<' and the ones
reachable from B prefixed with '>'.

When combined with --boundary, boundary commits (the ones marked
with 'x' in the above picture) are shown with prefix '-', so you
would see list that looks like this:

    git rev-list --left-right --boundary --pretty=oneline A...B

    >bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 3rd on b
    >bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2nd on b
    <aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 3rd on a
    <aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 2nd on a
    -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1st on b
    -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1st on a

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agomarkup fix in svnimport documentation.
Junio C Hamano [Sun, 17 Dec 2006 18:33:24 +0000 (10:33 -0800)]
markup fix in svnimport documentation.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: new option -P for git-svnimport
Quy Tonthat [Sun, 17 Dec 2006 14:50:12 +0000 (01:50 +1100)]
Documentation: new option -P for git-svnimport

Documentation: new option -P for git-svnimport.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoFix mis-mark-up in git-merge-file.txt documentation
Junio C Hamano [Sun, 17 Dec 2006 08:46:35 +0000 (00:46 -0800)]
Fix mis-mark-up in git-merge-file.txt documentation

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDefault GIT_COMMITTER_NAME to login name in recieve-pack.
Shawn O. Pearce [Sun, 17 Dec 2006 08:15:14 +0000 (03:15 -0500)]
Default GIT_COMMITTER_NAME to login name in recieve-pack.

If GIT_COMMITTER_NAME is not available in receive-pack but reflogs
are enabled we would normally die out with an error message asking
the user to correct their environment settings.

Now that reflogs are enabled by default in (what we guessed to be)
non-bare Git repositories this may cause problems for some users
who don't have their full name in the gecos field and who don't
have access to the remote system to correct the problem.

So rather than die()'ing out in receive-pack when we try to log a
ref change and have no committer name we default to the username,
as obtained from the host's password database.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoFix check_file_directory_conflict().
Junio C Hamano [Sun, 17 Dec 2006 01:39:06 +0000 (17:39 -0800)]
Fix check_file_directory_conflict().

When replacing an existing file A with a directory A that has a
file A/B in it in the index, 'update-index --replace --add A/B'
did not properly remove the file to make room for the new
directory.

There was a trivial logic error, most likely a cut & paste one,
dating back to quite early days of git.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-add: remove conflicting entry when adding.
Junio C Hamano [Sun, 17 Dec 2006 09:09:41 +0000 (01:09 -0800)]
git-add: remove conflicting entry when adding.

When replacing an existing file A with a directory A that has a
file A/B in it in the index, 'git add' did not succeed because
it forgot to pass the allow-replace flag to add_cache_entry().

It might be safer to leave this as an error and require the user
to explicitly remove the existing A first before adding A/B
since it is an unusual case, but doing that automatically is
much easier to use.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoupdate-index: make D/F conflict error a bit more verbose.
Junio C Hamano [Sun, 17 Dec 2006 00:23:02 +0000 (16:23 -0800)]
update-index: make D/F conflict error a bit more verbose.

When you remove a directory D that has a tracked file D/F out of the
way to create a file D and try to "git update-index --add D", it used
to say "cannot add" which was not very helpful.  This issues an extra
error message to explain the situation before the final "fatal" message.

Since D/F conflicts are relatively rare event, extra verbosity would
not make things too noisy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-branch: rename config vars branch.<branch>.*, too
Johannes Schindelin [Sat, 16 Dec 2006 14:15:02 +0000 (15:15 +0100)]
git-branch: rename config vars branch.<branch>.*, too

When renaming a branch, the corresponding config section should
be renamed, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoadd a function to rename sections in the config
Johannes Schindelin [Sat, 16 Dec 2006 14:14:14 +0000 (15:14 +0100)]
add a function to rename sections in the config

Given a config like this:

# A config
[very.interesting.section]
not

The command

$ git repo-config --rename-section very.interesting.section bla.1

will lead to this config:

# A config
[bla "1"]
not

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-clone: lose the traditional 'no-separate-remote' layout
Junio C Hamano [Sat, 16 Dec 2006 09:53:10 +0000 (01:53 -0800)]
git-clone: lose the traditional 'no-separate-remote' layout

Finally.

The separate-remote layout is so much more organized than
traditional and easier to work with especially when you need to
deal with remote repositories with multiple branches and/or you
need to deal with more than one remote repositories, and using
traditional layout for new repositories simply does not make
much sense.

Internally we still have code for 1:1 mappings to create a bare
clone; that is a good thing and will not go away.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-clone: lose the artificial "first" fetch refspec
Junio C Hamano [Sat, 16 Dec 2006 09:41:51 +0000 (01:41 -0800)]
git-clone: lose the artificial "first" fetch refspec

Now we lost the "first refspec is the one that is merged by default"
rule, there is no reason for clone to list the remote primary branch
in the config file explicitly anymore.

We still need it for the traditional layout for other reasons,
though.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-pull: refuse default merge without branch.*.merge
Junio C Hamano [Sat, 16 Dec 2006 09:36:32 +0000 (01:36 -0800)]
git-pull: refuse default merge without branch.*.merge

Everybody hated the pull behaviour of merging the first branch
listed on remotes/* file (or remote.*.fetch config) into the
current branch.  This finally corrects that UI wart by
forbidding "git pull" without an explicit branch name on the
command line or branch.$current.merge for the current branch.

The matching change to git-clone was made to prepare the default
branch.*.merge entry for the primary branch some time ago.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-clone: use wildcard specification for tracking branches
Junio C Hamano [Sat, 16 Dec 2006 09:14:39 +0000 (01:14 -0800)]
git-clone: use wildcard specification for tracking branches

This stops enumerating the set of branches found on the remote
side when a clone was made in the configuration file.  Instead,
a single entry that maps each remote branch to the local
tracking branch for the remote under the same name is created.

Doing it this way not only shortens the configuration file, but
automatically adjusts to a new branch added on the remote side
after the clone is made.

Unfortunately this cannot be done for the traditional layout,
where we always need to special case the 'master' to 'origin'
mapping within the local branch namespace.  But that is Ok; it
will be going away before v1.5.0.

We could also lose the "primary branch" mapping at the
beginning, but that has to wait until we implement the "forbid
'git pull' when we do not have branch.$current.merge for the
current branch" policy we earlier discussed.  That should also
be in v1.5.0

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agomerge: give a bit prettier merge message to "merge branch~$n"
Junio C Hamano [Sat, 16 Dec 2006 20:31:45 +0000 (12:31 -0800)]
merge: give a bit prettier merge message to "merge branch~$n"

This hacks the input to fmt-merge-msg to make the message for
merging early part of a branch a little easier to read.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Add "next" link to commit view
Jakub Narebski [Fri, 15 Dec 2006 20:57:16 +0000 (21:57 +0100)]
gitweb: Add "next" link to commit view

Add a kind of "next" view in the bottom part of navigation bar for
"commit" view, similar to what was added for "commitdiff" view in
commit 151602df00b8e5c5b4a8193f59a94b85f9b5aebc
  'gitweb: Add "next" link to commitdiff view'

For "commit" view for single parent commit:
  (parent: _commit_)
For "commit" view for merge (multi-parent) commit:
  (merge: _commit_ _commit_ ...)
For "commit" view for root (parentless) commit
  (initial)
where _link_ denotes hyperlink.  SHA1 of commit is shortened
to 7 characters on display.

While at it, remove leftovers from commit cae1862a by Petr Baudis:
  'gitweb: More per-view navigation bar links'
namely the "blame" link if there exist $file_name and commit has a
parent; it was added in git_commit probably by mistake.  The rest
of what mentioned commit added for git_commit was removed in
commit 6e0e92fda893311ff5af91836e5007bf6bbd4a21 by Luben Tuikov:
  'gitweb: Do not print "log" and "shortlog" redundantly in commit view'
(which should have probably removed also this "blame" link removed now).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Add title attribute to ref marker with full ref name
Jakub Narebski [Fri, 15 Dec 2006 22:49:12 +0000 (23:49 +0100)]
gitweb: Add title attribute to ref marker with full ref name

Add title attribute, which will be shown as popup on mouseover in
graphical web browsers, with full name of ref, including part (type)
removed from the name of ref itself. This is useful to see that this
strange ref is StGIT ref, or it is remote branch, or it is lightweigh
tag (with branch-like name).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Do not show difftree for merges in "commit" view
Jakub Narebski [Fri, 15 Dec 2006 16:53:45 +0000 (17:53 +0100)]
gitweb: Do not show difftree for merges in "commit" view

Do not show difftree against first parent for merges (commits with
more than one parent) in "commit" view, because it usually is
misleading.  git-show and git-whatchanged doesn't show diff for merges
either.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: rename 'commit' command to 'set-tree'
Eric Wong [Sat, 16 Dec 2006 07:58:08 +0000 (23:58 -0800)]
git-svn: rename 'commit' command to 'set-tree'

'set-tree' probably accurately describes what the command
formerly known as 'commit' does.

I'm not entirely sure that 'dcommit' should be renamed to 'commit'
just yet...  Perhaps 'push' or 'push-changes'?

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: remove support for the svn command-line client
Eric Wong [Sat, 16 Dec 2006 07:58:07 +0000 (23:58 -0800)]
git-svn: remove support for the svn command-line client

Using the command-line client was great for prototyping and
getting something working quickly.  Eventually I found time
to study the library documentation and add support for using
the libraries which are much faster and more flexible when
it comes to supporting new features.

Note that we require version 1.1 of the SVN libraries, whereas
we supported the command-line svn client down to version 1.0.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocument git-merge-file
Johannes Schindelin [Sat, 16 Dec 2006 11:22:18 +0000 (12:22 +0100)]
Document git-merge-file

Most of this is derived from the documentation of RCS merge.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-clone documentation
Quy Tonthat [Thu, 14 Dec 2006 14:17:53 +0000 (01:17 +1100)]
git-clone documentation

When --use-separate-remote is used on git-clone, the remote
heads are saved under $GIT_DIR/refs/remotes/origin/, not
"$GIT_DIR/remotes/origin/"

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-status always says what branch it's on
Andy Parkins [Thu, 14 Dec 2006 15:25:23 +0000 (15:25 +0000)]
git-status always says what branch it's on

If the current branch was "master" then git-status wouldn't say

 # On branch XXXX

In its output.  This patch makes it so that this message is always
output; regardless of branch name.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: convert to using Git.pm
Eric Wong [Fri, 15 Dec 2006 18:59:54 +0000 (10:59 -0800)]
git-svn: convert to using Git.pm

Thanks to Git.pm, I've been able to greatly reduce the amount
of extra work that needs to be done to manage input/output
pipes in Perl.

chomp usage has also been greatly reduced, too.

All tests (including full-svn-test) still pass, but this has
not been tested extensively in the real-world.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAlign section headers of 'git status' to new 'git add'.
Shawn O. Pearce [Sat, 16 Dec 2006 02:53:13 +0000 (21:53 -0500)]
Align section headers of 'git status' to new 'git add'.

Now that 'git add' is considered a first-class UI for 'update-index'
and that the 'git add' documentation states "Even modified files
must be added to the set of changes about to be committed" we should
make the output of 'git status' align with that documentation and
common usage.

So now we see a status output such as:

  # Added but not yet committed:
  #   (will commit)
  #
  #       new file: x
  #
  # Changed but not added:
  #   (use "git add file1 file2" to include for commit)
  #
  #       modified:   x
  #
  # Untracked files:
  #   (use "git add" on files to include for commit)
  #
  #       y

which just reads better in the context of using 'git add' to
manipulate a commit (and not a checkin, whatever the heck that is).

We also now support 'color.status.added' as an alias for the existing
'color.status.updated', as this alias more closely aligns with the
current output and documentation.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoSuggest use of "git add file1 file2" when there is nothing to commit.
Shawn O. Pearce [Sat, 16 Dec 2006 02:53:09 +0000 (21:53 -0500)]
Suggest use of "git add file1 file2" when there is nothing to commit.

If a user modifies files and runs 'git commit' (without the very
useful -a option) and they have not yet updated the index they
are probably coming from another SCM-like tool which would perform
the same as 'git commit -a' in this case.  Showing the user their
current status and a final line of "nothing to commit" is not very
reassuring, as the user might believe that Git did not recognize
their files were modified.

Instead we can suggest as part of the 'nothing to commit' message
that the user invoke 'git add' to add files to their next commit.

Suggested by Andy Parkins' Git 'niggles' list
(<200612132237.10051.andyparkins@gmail.com>).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMake git-diff documentation use [--] when it should.
Brian Gernhardt [Fri, 15 Dec 2006 12:39:33 +0000 (07:39 -0500)]
Make git-diff documentation use [--] when it should.

Two of the cases has "[--] [<path>...]" and two had "-- [<path>...]".
Not terribly consistent and potentially confusing.  Also add "[--]" to
the synopsis so that it's obvious you can use it from the very
beginning.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>