Commit graph

7249 commits

Author SHA1 Message Date
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 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
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
Junio C Hamano 74d20040ca 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>
2006-12-18 16:21:54 -08:00
Junio C Hamano 8336afa563 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>
2006-12-18 16:20:53 -08:00
Aneesh Kumar K.V 910c00c8ca 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>
2006-12-18 16:05:08 -08:00
Brian Gernhardt 38c594d330 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
d320a5437f.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:03:39 -08:00
Nicolas Pitre b3d9899324 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>
2006-12-18 15:31:28 -08:00
Nicolas Pitre 57b73150c4 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>
2006-12-18 15:30:17 -08:00
Junio C Hamano e1bb1d31ea 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>
2006-12-18 14:18:54 -08:00
Junio C Hamano d8285af481 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>
2006-12-18 13:40:25 -08:00
Junio C Hamano 0c7a97fafd 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>
2006-12-18 12:13:46 -08:00
Jeff King ff7f22f36e 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
  82dca84871

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 00:00:15 -08:00
Junio C Hamano 64fe031a7a 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>
2006-12-17 19:36:50 -08:00
Junio C Hamano dd9142993c show-ref: fix --quiet --verify
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-17 18:53:24 -08:00
Junio C Hamano 00bc0ec262 Merge branch 'jc/blame-boundary'
* jc/blame-boundary:
  git-blame: show lines attributed to boundary commits differently.
2006-12-17 18:34:51 -08:00
Junio C Hamano 570c524dd3 Merge branch 'jc/reflog' (early part)
* 'jc/reflog' (early part):
  Teach show-branch how to show ref-log data.
2006-12-17 18:31:24 -08:00
Junio C Hamano bdf17a02fd 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
2006-12-17 18:27:17 -08:00
Junio C Hamano 9057695012 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
2006-12-17 18:27:17 -08:00
Junio C Hamano 26cdd1e7c7 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>
2006-12-17 18:26:53 -08:00
Junio C Hamano ed9f7c954c 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>
2006-12-17 17:57:19 -08:00
Junio C Hamano 7e3fe904ef Teach show-branch how to show ref-log data.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-17 10:35:53 -08:00
Junio C Hamano ee6002aa42 markup fix in svnimport documentation.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-17 10:33:24 -08:00
Quy Tonthat c0e9232e43 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>
2006-12-17 10:31:11 -08:00
Junio C Hamano 38477d9e60 Fix mis-mark-up in git-merge-file.txt documentation
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-17 01:14:44 -08:00
Shawn O. Pearce a7f196a746 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>
2006-12-17 01:14:44 -08:00
Junio C Hamano 81a361be3b 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>
2006-12-17 01:14:44 -08:00
Junio C Hamano c33ab0dd10 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>
2006-12-17 01:14:43 -08:00
Junio C Hamano 790fa0e297 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>
2006-12-17 01:14:43 -08:00
Johannes Schindelin dc81c58cd6 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>
2006-12-16 13:38:44 -08:00
Johannes Schindelin 0667fcfb62 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>
2006-12-16 13:28:20 -08:00
Junio C Hamano 63085fabbd 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>
2006-12-16 13:01:41 -08:00
Junio C Hamano 3dd3d5b0e2 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>
2006-12-16 13:01:41 -08:00
Junio C Hamano a71fb0a141 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>
2006-12-16 13:01:41 -08:00