Commit Graph

7289 Commits

Author SHA1 Message Date
Brian Gernhardt
f49006b0c7 Make git-show-branch options similar to git-branch.
Branch has "-r" for remote branches and "-a" for local and remote.
It seems logical to mirror that in show-branch.  Also removes the
dubiously useful "--tags" option (as part of changing the meaning
for "--all").

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 23:18:07 -08:00
Brian Gernhardt
c321f00d09 Keep "git --git-dir" from causing a bus error.
The option checking code for --git-dir had an off by 1 error that
would cause it to access uninitialized memory if it was the last
argument.  This causes it to display an error and display the usage
string instead.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 23:17:20 -08:00
Eric Wong
4b1552238e git-svn: enable common fetch/commit options for dcommit
dcommit does commits and fetches, so all options used for those
should work, too, including --authors-file.

Reported missing by Nicolas Vilz.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 23:14:58 -08:00
Alexandre Julliard
4de0f9f9b6 vc-git: Ignore errors caused by a non-existent directory in vc-git-registered.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 23:14:43 -08:00
Eric Wong
40f656cd02 Remove NO_ACCURATE_DIFF options from build systems
The code no longer uses it, as we have --inaccurate-eof in
git-apply.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 23:13:28 -08:00
Junio C Hamano
a6782bc572 git-tag: lose exit after die
We are not running under /bin/resurrection shell ;-)

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 22:48:46 -08:00
Junio C Hamano
95ca1c6cb7 Really fix headers for __FreeBSD__
The symbol to detect FreeBSD is __FreeBSD__, not __FreeBSD.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 22:46:11 -08:00
Junio C Hamano
ea560e6d64 Do not support "partial URL shorthand" anymore.
We used to support specifying the top part of remote URL in
remotes and use that as a short-hand for the URL.

	$ cat .git/remotes/jgarzik
	URL: git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/
	$ git pull jgarzik/misc-2.6

This is confusing when somebody attempts to do this:

	$ git pull origin/foo

which is not syntactically correct (unless you have origin/foo.git
repository) and should fail, but it resulted in a mysterious
access to the 'foo' subdirectory of the origin repository.

Which was what it was designed to do, but because this is an
oddball "feature" I suspect nobody uses, let's remove it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 15:37:48 -08:00
Junio C Hamano
fb8696d9d8 default pull: forget about "newbie protection" for now.
This will not be backward compatible no matter how you cut it.
Shelve it for now until somebody comes up with a better way to
determine when we can safely refuse to use the first set of
branchse for merging without upsetting valid workflows.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 15:25:21 -08:00
Junio C Hamano
228e2eb67e merge and reset: adjust for "reset --hard" messages
An earlier commit made "reset --hard" chattier but leaking its
message from "git rebase" (which calls it when first rewinding
the current branch to prepare replaying our own changes) without
explanation was confusing, so add an extra message to mention
it.  Inside restorestate in merge (which is rarely exercised
codepath, where more than one strategies are attempted),
resetting to the original state uses "reset --hard" -- this can
be squelched entirely.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 15:21:55 -08:00
Junio C Hamano
2295e8d0c4 commit-tree: do not overflow MAXPARENT
We have a static allocation of MAXPARENT, but that limit was not
enforced, other than by a lucky invocation of the program segfaulting.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-21 23:49:13 -08:00
Shawn O. Pearce
fa39b6b5b1 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>
2006-12-21 22:59:34 -08:00
Shawn O. Pearce
51dcaa9686 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>
2006-12-21 22:59:34 -08:00
Junio C Hamano
a01c9c28a5 _XOPEN_SOURCE problem also exists on FreeBSD
Suggested by Rocco Rutte, Marco Roeland and others.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-21 22:56:26 -08:00
Junio C Hamano
d41cb273d3 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>
2006-12-21 22:56:25 -08:00
Junio C Hamano
27e4dd8de7 Merge branch 'maint'
* maint:
  diff --check: fix off by one error
  spurious .sp in manpages
2006-12-21 22:56:04 -08:00
Johannes Schindelin
95f2fb7d9f 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>
2006-12-21 22:47:49 -08:00
Johannes Schindelin
f79c73ce9c 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>
2006-12-21 22:44:04 -08:00
Junio C Hamano
9e11554917 Revert "git-pull: refuse default merge without branch.*.merge"
This reverts commit a71fb0a141.

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.
2006-12-21 22:12:42 -08:00
Shawn O. Pearce
64646d1177 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>
2006-12-21 20:33:49 -08:00
Johannes Schindelin
caba139d43 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>
2006-12-21 20:33:06 -08:00
Johannes Schindelin
e6d40d65df 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>
2006-12-21 20:31:14 -08:00
Quy Tonthat
7dda22e317 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>
2006-12-20 20:36:42 -08:00
Terje Sten Bjerkseth
c902c9a608 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>
2006-12-20 17:59:22 -08:00
Junio C Hamano
5b85143ba5 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
2006-12-20 17:20:45 -08:00
Junio C Hamano
ce0545455a 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.
2006-12-20 14:41:54 -08:00
Junio C Hamano
63c4b4c5c1 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
2006-12-20 14:20:17 -08:00
Junio C Hamano
e035ce939d Merge branch 'jc/blame'
* jc/blame:
  blame: -b (blame.blankboundary) and --root (blame.showroot)
2006-12-20 13:58:10 -08:00
Junio C Hamano
55e268e7ed 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
2006-12-20 13:57:59 -08:00
Junio C Hamano
aa1cef54a2 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
2006-12-20 13:56:14 -08:00
Junio C Hamano
1d182bd5f4 compat/inet_ntop: do not use u_int
It is pointless.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 13:45:55 -08:00
Junio C Hamano
ec722203ee 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>
2006-12-20 13:43:03 -08:00
Junio C Hamano
93b0d86aaf git-add: error out when given no arguments.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 13:41:00 -08:00
Junio C Hamano
54851157ac Merge branch 'maint'
* maint:
  GIT 1.4.4.3
2006-12-20 11:25:25 -08:00
Junio C Hamano
851a911024 GIT 1.4.4.3
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 11:23:22 -08:00
Nicolas Pitre
08a19d873c 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>
2006-12-20 10:46:34 -08:00
Junio C Hamano
85023577a8 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>
2006-12-20 09:51:35 -08:00
Nicolas Pitre
6d2fa7f1b4 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>
2006-12-20 00:42:10 -08:00
Robert Fitzsimons
313ce8cee6 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>
2006-12-19 22:49:59 -08:00
Junio C Hamano
fc1905bb93 config_rename_section: fix FILE* leak
Noticed by SungHyun Nam.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 22:30:59 -08:00
Brian Gernhardt
c17f9f12a4 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>
2006-12-19 21:33:35 -08:00
Junio C Hamano
5caf923223 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>
2006-12-19 21:33:24 -08:00
Eric Wong
c6b4fa96cb git-cvsserver: fix breakage when calling git merge-file
In the same vein as 8336afa563,
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>
2006-12-19 16:32:18 -08:00
Junio C Hamano
8dce823562 Revert "Make left-right automatic."
This reverts commit 5761231975.

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.
2006-12-19 02:28:16 -08:00
Josef Weidendorfer
4363dfbe3d 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>
2006-12-19 01:53:02 -08:00
Junio C Hamano
d4ebc36c5e 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>
2006-12-19 01:51:51 -08:00
Junio C Hamano
75c384efb5 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>
2006-12-19 01:50:37 -08:00
Junio C Hamano
5fed466815 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
  ...
2006-12-19 01:38:18 -08:00
Johannes Schindelin
8683a45d66 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>
2006-12-19 01:14:59 -08:00
Junio C Hamano
171e800b37 Revert "fix testsuite: make sure they use templates freshly built from the source"
This reverts commit 74d20040ca.
Version from Johannes to introduce GIT_TEMPLATE_DIR is simpler,
although I unconsciously stayed away from introducing yet another
environment variable.
2006-12-19 01:14:35 -08:00