1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-18 15:04:49 +01:00
Commit graph

4097 commits

Author SHA1 Message Date
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
Junio C Hamano
cd1333db4f Merge branch 'cvsserver' of http://locke.catalyst.net.nz/git/git-martinlanghoff; branch 'ml/cvsserver' into next
* 'cvsserver' of http://locke.catalyst.net.nz/git/git-martinlanghoff:
  cvsserver: fix checkouts with -d <somedir>
  cvsserver: checkout faster by sending files in a sensible order

* ml/cvsserver:
  cvsserver: fix checkouts with -d <somedir>
  cvsserver: checkout faster by sending files in a sensible order
2006-03-02 23:00:45 -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
539d84fe0a Merge branch 'jc/delta' into next
* jc/delta:
  diff-delta: cull collided hash bucket more aggressively.
2006-03-02 22:13:11 -08:00
Junio C Hamano
d4c9982f8e Merge branch 'jc/diff' into next
* jc/diff:
  diffcore-rename: similarity estimator fix.
2006-03-02 22:13:08 -08:00
Junio C Hamano
1706306a54 diffcore-rename: similarity estimator fix.
The "similarity" logic was giving added material way too much
negative weight.  What we wanted to see was how similar the
post-change image was compared to the pre-change image, so the
natural definition of similarity is how much common things are
there, relative to the post-change image's size.

This simplifies things a lot.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 22:12:33 -08:00
Junio C Hamano
262cc77dab Merge branch 'fk/blame' into next
* fk/blame:
  git-blame, take 2
  Merge part of 'lt/rev-list' into 'fk/blame'
2006-03-02 21:15:56 -08:00
Junio C Hamano
6f85a78df6 Merge branch 'lt/rev-list' into next
* lt/rev-list:
  setup_revisions(): handle -n<n> and -<n> internally.
2006-03-02 21:15:52 -08:00
Junio C Hamano
810e300d4c Merge branch 'master' into next
* master:
  Merge branch 'jc/diff'
  git-commit: make sure we protect against races.
  git-commit --amend
  show-branch --topics
  GIT-VERSION-GEN: squelch unneeded error from "cat version"
  Merge branch 'ml/cvsserver'
  annotate: resurrect raw timestamps.
  Documentation: rev-list --objects-edge
  Documentation: read-tree --aggressive
  war on whitespaces: documentation.
2006-03-02 21:15:26 -08:00
Junio C Hamano
0825f96cd0 Merge branch 'jc/diff'
* jc/diff:
  diffcore-delta: stop using deltifier for packing.
2006-03-02 21:15:06 -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
Martin Mares
9f841cf1fb [PATCH] gitk: Make error_popup react to Return
The error popup window can be now closed not only by clicking
the button, but also by pressing Return.

Signed-Off-By: Martin Mares <mj@ucw.cz>

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-03-03 09:56:32 +11: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
Paul Mackerras
c934a8a3a3 gitk: Fix a bug in drawing the selected line as a thick line
If you clicked on a line, so that it was drawn double-thickness,
and then scrolled to bring on-screen a child that hadn't previously
been drawn, the lines from it to the selected line were drawn
single-thickness.  This fixes it so they are drawn double-thickness.
This also removes an unnecessary setting of phase in drawrest.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-03-02 23:00:44 +11:00
Paul Mackerras
8ed1648415 gitk: Further speedups
Now we don't parse the commits as we are reading them, we just put
commit data on a list as a blob, and instead parse the commit when
we need the various parts of it, such as when a commit is drawn on
the canvas.  This makes searching a bit more interesting: now we
scan through the commit blobs doing a string or regexp match to find
commits that might match, then for those that might match, we parse
the commit info (if it isn't already parsed) and do the matching
for the various fields as before.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-03-02 22:56:44 +11: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