1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 08:47:56 +01:00
Commit graph

3841 commits

Author SHA1 Message Date
Eric Wong
eeb0abe047 contrib/git-svn: cleanup option parsing
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:22 -08:00
Eric Wong
a9612be245 contrib/git-svn: allow --authors-file to be specified
Syntax is compatible with git-svnimport and git-cvsimport:

	normalperson = Eric Wong <normalperson@yhbt.net>

If this option is specified and git-svn encounters an SVN
committer name that it cannot parse, it git-svn will abort.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:20 -08:00
Eric Wong
df746c5a81 contrib/git-svn: strip 'git-svn-id:' when commiting to SVN
We regenerate and use git-svn-id: whenever we fetch or otherwise
commit to remotes/git-svn.  We don't actually know what revision
number we'll commit to SVN at commit time, so this is useless.
It won't throw off things like 'rebuild', though, which knows to
only use the last instance of git-svn-id: in a log message

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:18 -08:00
Eric Wong
ac8e0b910c contrib/git-svn: several small bug fixes and changes
* Fixed manually-edited commit messages not going to
   remotes/git-svn on sequential commits after the sequential
   commit optimization.
 * format help correctly after adding 'show-ignore'
 * sha1_short regexp matches down to 4 hex characters
   (from git-rev-parse --short documentation)
 * Print the first line of the commit message when we commit to
   SVN next to the sha1.
 * Document 'T' (type change) in the comments

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:14 -08:00
Eric Wong
69f0d91e49 contrib/git-svn: add -b/--branch switch for branch detection
I've said I don't like branches in Subversion, and I still don't.
This is a bit more flexible, though, as the argument for -b is any
arbitrary git head/tag reference.

This makes some things easier:
 * Importing git history into a brand new SVN branch.
 * Tracking multiple SVN branches via GIT_SVN_ID, even from multiple
   repositories.
 * Adding tags from SVN (still need to use GIT_SVN_ID, though).
 * Even merge tracking is supported, if and only the heads end up with
   100% equivalent tree objects.  This is more stricter but more robust
   and foolproof than parsing commit messages, imho.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:10 -08:00
Shawn Pearce
a41c175d6f Prevent --index-info from ignoring -z.
If git-update-index --index-info -z is used only the first
record given to the process will actually be updated as
the -z option is ignored until after all index records
have been read and processed.  This meant that multiple
null terminated records were seen as a single record which
was lacking a trailing LF, however since the first record
ended in a null the C string handling functions ignored the
trailing garbage.  So --index-info should be required to be
the last command line option, much as --stdin is required
to be the last command line option.  Because --index-info
implies --stdin this isn't an issue as the user shouldn't
be passing --stdin when also passing --index-info.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 23:07:42 -08:00
Jonas Fonseca
c7569b1e00 manpages: insert two missing [verse] markers for multi-line SYNOPSIS
Found with:

	for i in *.txt; do
		grep -A 2 "SYNOPSIS" "$i" | grep -q "^\[verse\]$" && continue
		multiline=$(grep -A 3 "SYNOPSIS" "$i" | tail -n 1)
		test -n "$multiline" && echo "$i: $multiline"
	done

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 23:07:34 -08:00
Aneesh Kumar K.V
9645da330f gitview: pass the missing argument _show_clicked_cb.
In our last update to use the encoding while showing the commit
diff we added a new argument to this function. But we missed
updating all the callers.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 23:07:01 -08:00
Johannes Schindelin
d5dddccaa0 Fix test case for some sed
Some versions of sed lack the "-i" option.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 23:06:47 -08:00
Eric Wong
fd8fc4ade5 git-branch: add -r switch to list refs/remotes/*
If we decide to use refs/remotes/, having a convenient way to
list them would be nice.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 23:06:04 -08:00
Martin Langhoff
e74ee784c7 cvsserver: fix checkouts with -d <somedir>
A recent Eclipse compat fix broke checkouts with -d. Fix it so that the server
sends the correct module name instead of the destination directory name.
2006-03-02 22:56:28 -08:00
Martin Langhoff
501c7372c7 cvsserver: checkout faster by sending files in a sensible order
Just by sending the files in an ordered fashion, clients can process them
much faster. And we can optimize our check of whether we created this
directory already -- faster.

Timings for a checkout on a commandline cvs client for a project with
~13K files totalling ~100MB:

Unsorted:
  603.12 real        16.89 user        42.88 sys

Sorted:
  298.19 real        26.37 user        42.42 sys
2006-03-02 22:56:27 -08:00
Junio C Hamano
b8310152bc git-commit: make sure we protect against races.
An earlier commit 8098a178b2
accidentally lost race protection from git-commit command.
This commit reinstates it.  When something else updates HEAD
pointer while you were editing your commit message, the command
would notice and abort the commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 21:13:24 -08:00
Junio C Hamano
b4019f0456 git-commit --amend
The new flag is used to amend the tip of the current branch.  Prepare
the tree object you would want to replace the latest commit as usual
(this includes the usual -i/-o and explicit paths), and the commit log
editor is seeded with the commit message from the tip of the current
branch.  The commit you create replaces the current tip -- if it was a
merge, it will have the parents of the current tip as parents -- so the
current top commit is discarded.

It is a rough equivalent for:

	$ git reset --soft HEAD^
	$ ... do something else to come up with the right tree ...
	$ git commit -c ORIG_HEAD

but can be used to amend a merge commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 21:08:33 -08:00
Martin Langhoff
cfcbd3427e cvsserver: fix checkouts with -d <somedir>
A recent Eclipse compat fix broke checkouts with -d. Fix it so that the server
sends the correct module name instead of the destination directory name.
2006-03-03 16:57:03 +13:00
Martin Langhoff
5398fed966 cvsserver: checkout faster by sending files in a sensible order
Just by sending the files in an ordered fashion, clients can process them
much faster. And we can optimize our check of whether we created this
directory already -- faster.

Timings for a checkout on a commandline cvs client for a project with
~13K files totalling ~100MB:

Unsorted:
  603.12 real        16.89 user        42.88 sys

Sorted:
  298.19 real        26.37 user        42.42 sys
2006-03-03 16:38:03 +13:00
Junio C Hamano
d320a5437f show-branch --topics
This adds a new flag, --topics, to help managing topic
branches.  When you have topic branches forked some time ago
from your primary line of development, show-branch would show
many "uninteresting" things that happend on the primary line of
development when trying to see what are still not merged from
the topic branches.

With this flag, the first ref given to show-branch is taken as
the primary branch, and the rest are taken as the topic
branches.  Output from the command is modified so that commits
only on the primary branch are not shown.  In other words,

	$ git show-branch --topics master topic1 topic2 ...

shows an (almost) equivalent of

	$ git rev-list ^master topic1 topic2 ...

The major differences are that (1) you can tell which commits
are on which branch, and (2) the commit at the fork point is
shown.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 17:16:08 -08:00
Junio C Hamano
0b8b051cd5 GIT-VERSION-GEN: squelch unneeded error from "cat version"
Now this is really a corner case, but if you have the git source
tree from somewhere other than the official tarball, you do not
have version file.  And if git-describe does not work for you
(maybe you do not have git yet), we spilled an error message
from "cat version".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 16:42:39 -08:00
Junio C Hamano
64bc6e3db5 setup_revisions(): handle -n<n> and -<n> internally.
This moves the handling of max-count shorthand from the internal
implementation of "git log" to setup_revisions() so other users
of setup_revisions() can use it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 15:24:01 -08:00
Fredrik Kuivinen
fc675b8cd5 git-blame, take 2
Here is an updated version of git-blame. The main changes compared to
the first version are:

* Use the new revision.h interface to do the revision walking
* Do the right thing in a lot of more cases than before. In particular
  parallel development tracks are hopefully handled sanely.
* Lots of clean-up

It still won't follow file renames though.

There are still some differences in the output between git-blame and
git-annotate. For example, in 'Makefile' git-blame assigns lines
354-358 to 455a7f3275 and git-annotate
assigns the same lines to 79a9d8ea0d.

I think git-blame is correct in this case. This patterns occur in
several other places, git-annotate seems to sometimes assign lines to
merge commits when the lines actually changed in some other commit
which precedes the merge.

[jc: I have conned Ryan into doing test cases, so that it would
help development and fixes on both implementations.  Let the
battle begin! ;-) ]

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 15:10:39 -08:00
Junio C Hamano
c40610422e Merge part of 'lt/rev-list' into 'fk/blame'
Now blame will depend on the new revision walker infrastructure,
we need to make it depend on earlier parts of Linus' rev-list
topic branch, hence this merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 15:10:05 -08:00
Junio C Hamano
0cd5da56fa Merge branch 'ml/cvsserver'
* ml/cvsserver:
  cvsserver: Eclipse compat -- now "compare with latest from HEAD" works
  cvsserver: Checkout correctly on Eclipse
2006-03-02 14:19:33 -08:00
Junio C Hamano
d920e18f53 annotate: resurrect raw timestamps.
For scripted use this is quite useful.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 01:50:09 -08:00
Junio C Hamano
ec579767e7 Documentation: rev-list --objects-edge
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 01:11:31 -08:00
Junio C Hamano
afaa8d66ab Documentation: read-tree --aggressive
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 01:11:05 -08:00
Junio C Hamano
8273c79ae2 war on whitespaces: documentation.
We were missing the --whitespace option in the usage string for
git-apply and git-am, so this commit adds them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 00:52:59 -08:00
Junio C Hamano
df45467ec9 Merge branch 'master' into next
* master:
  contrib/git-svn: use refs/remotes/git-svn instead of git-svn-HEAD
  Merge branch 'maint'
  read-tree --aggressive: remove deleted entry from the working tree.
  Merge branch 'jc/tag'
  Merge part of 'jc/diff'
2006-03-02 00:02:27 -08:00
Eric Wong
2beb3cdd18 contrib/git-svn: use refs/remotes/git-svn instead of git-svn-HEAD
After reading a lengthy discussion on the list, I've come to the
conclusion that creating a 'remotes' directory in refs isn't
such a bad idea.

You can still branch from it by specifying remotes/git-svn (not
needing the leading 'refs/'), and the documentation has been
updated to reflect that.

The 'git-svn' part of the ref can of course be set to whatever
you want by using the GIT_SVN_ID environment variable, as
before.

I'm using refs/remotes/git-svn, and not going with something
like refs/remotes/git-svn/HEAD as it's redundant for Subversion
where there's zero distinction between branches and directories.

Run git-svn rebuild --upgrade to upgrade your repository to use
the new head.  git-svn-HEAD must be manually deleted for safety
reasons.

Side note: if you ever (and I hope you never) want to run
git-update-refs on a 'remotes/' ref, make sure you have the
'refs/' prefix as you don't want to be clobbering your
'remotes/' in $GIT_DIR (where remote URLs are stored).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 00:01:36 -08:00
Junio C Hamano
2486927d2e Merge branch 'maint'
* maint:
  read-tree --aggressive: remove deleted entry from the working tree.
2006-03-01 23:20:31 -08:00
Junio C Hamano
1142038098 read-tree --aggressive: remove deleted entry from the working tree.
When both heads deleted, or our side deleted while the other
side did not touch, we did not have to update the working tree.

However, we forgot to remove existing working tree file when we
did not touch and the other side did.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 23:20:01 -08:00
Junio C Hamano
0c1fc940ee Merge branch 'ml/cvsserver' into next
* ml/cvsserver:
  cvsserver: Eclipse compat -- now "compare with latest from HEAD" works
2006-03-01 22:27:06 -08:00
Junio C Hamano
70e1cca388 Merge branch 'jc/tag'
* jc/tag:
  Pretty-print tagger dates.
2006-03-01 22:17:44 -08:00
Junio C Hamano
379156e1dc Merge part of 'jc/diff' 2006-03-01 22:15:38 -08:00
Junio C Hamano
b485db9896 Merge branch 'np/delta' into next
* np/delta:
  diff-delta: allow reusing of the reference buffer index
  diff-delta: bound hash list length to avoid O(m*n) behavior
  diff-delta: produce optimal pack data
  Merge branch 'kh/svnimport'
  Merge branch 'js/refs'
  annotate: fix -S parameter to take a string
  annotate: Add a basic set of test cases.
  annotate: handle \No newline at end of file.
  gitview: Use horizontal scroll bar in the tree view
2006-03-01 22:08:12 -08:00
Nicolas Pitre
38fd0721d0 diff-delta: allow reusing of the reference buffer index
When a reference buffer is used multiple times then its index can be
computed only once and reused multiple times.  This patch adds an extra
pointer to a pointer argument (from_index) to diff_delta() for this.

If from_index is NULL then everything is like before.

If from_index is non NULL and *from_index is NULL then the index is
created and its location stored to *from_index.  In this case the caller
has the responsibility to free the memory pointed to by *from_index.

If from_index and *from_index are non NULL then the index is reused as
is.

This currently saves about 10% of CPU time to repack the git archive.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:53:22 -08:00
Nicolas Pitre
5bb86b82ba diff-delta: bound hash list length to avoid O(m*n) behavior
The diff-delta code can exhibit O(m*n) behavior with some patological
data set where most hash entries end up in the same hash bucket.

The latest code rework reduced the block size making it particularly
vulnerable to this issue, but the issue was always there and can be
triggered regardless of the block size.

This patch does two things:

1) the hashing has been reworked to offer a better distribution to
   atenuate the problem a bit, and

2) a limit is imposed to the number of entries that can exist in the
   same hash bucket.

Because of the above the code is a bit more expensive on average, but
the problematic samples used to diagnoze the issue are now orders of
magnitude less expensive to process with only a slight loss in
compression.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:51:14 -08:00
Nicolas Pitre
cc5c59a30c diff-delta: produce optimal pack data
Indexing based on adler32 has a match precision based on the block size
(currently 16).  Lowering the block size would produce smaller deltas
but the indexing memory and computing cost increases significantly.

For optimal delta result the indexing block size should be 3 with an
increment of 1 (instead of 16 and 16).  With such low params the adler32
becomes a clear overhead increasing the time for git-repack by a factor
of 3.  And with such small blocks the adler 32 is not very useful as the
whole of the block bits can be used directly.

This patch replaces the adler32 with an open coded index value based on
3 characters directly.  This gives sufficient bits for hashing and
allows for optimal delta with reasonable CPU cycles.

The resulting packs are 6% smaller on average.  The increase in CPU time
is about 25%.  But this cost is now hidden by the delta reuse patch
while the saving on data transfers is always there.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:51:00 -08:00
Junio C Hamano
5343cf1082 Merge branch 'kh/svnimport'
* kh/svnimport:
  Save username -> Full Name <email@addr.es> map file
2006-03-01 21:46:01 -08:00
Junio C Hamano
b6b626fad7 Merge branch 'js/refs'
* js/refs:
  Warn about invalid refs
2006-03-01 21:45:56 -08:00
Martin Langhoff
ec58db15a9 cvsserver: Eclipse compat -- now "compare with latest from HEAD" works
The Eclipse client uses cvs update when that menu option is triggered.
And doesn't like the standard cvs update response. Give it *exactly* what
it wants.

And hope the other clients don't lose the plot too badly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:41:58 -08:00
Martin Langhoff
009315499e annotate: fix -S parameter to take a string
In the conversion to Getopt::Long, the -S / --rev-list parameter stopped
working. We need to tell Getopt::Long that it is a string.

As a bonus, the open() now does some useful error handling.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:33:27 -08:00
Ryan Anderson
7c3ecb65ee annotate: Add a basic set of test cases.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:32:20 -08:00
Ryan Anderson
e5971d7d13 annotate: handle \No newline at end of file.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:32:17 -08:00
Aneesh Kumar K.V
5aa44d50f4 gitview: Use horizontal scroll bar in the tree view
Earlier we set up the window to never scroll
horizontally, which made it harder to use on a narrow screen.
This patch allows scrollbar to be used as needed by Gtk

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:32:00 -08:00
Junio C Hamano
09a278e6b9 Merge branch 'ml/cvsserver' into next
* ml/cvsserver:
  cvsserver: Checkout correctly on Eclipse
2006-03-01 17:45:09 -08:00
Martin Langhoff
c8c4f22025 cvsserver: Checkout correctly on Eclipse
Initial checkouts were failing to create Entries files under Eclipse.
Eclipse was waiting for two non-standard directory-resets to prepare for a new
directory from the server.

This patch is tricky, because the same directory resets tend to confuse other
clients. It's taken a bit of fiddling to get the commandline cvs client and
Eclipse to get a good, clean checkout.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 17:44:58 -08:00
Junio C Hamano
ed50804e54 Merge branch 'jc/tag' into next
* jc/tag:
  Pretty-print tagger dates.
2006-03-01 17:43:02 -08:00
Junio C Hamano
3bddd7dbba Pull GIT 1.2.4 fixes from master 2006-03-01 17:42:30 -08:00
Luck, Tony
2b74cffa91 Re-fix compilation warnings.
Commit 8fcf1ad9c6 has a
combination of double cast and Andreas' switch to using
unsigned long ... just the latter is sufficient (and a lot less
ugly than using the double cast).

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 17:42:00 -08:00
Junio C Hamano
1114b68f25 Merge branch 'jc/diff' into next
* jc/diff:
  diffcore-delta: stop using deltifier for packing.
2006-03-01 17:09:50 -08:00