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

4360 commits

Author SHA1 Message Date
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
Junio C Hamano
2495ca0447 Up to date with GIT 1.2.4 fixes 2006-03-01 17:07:42 -08:00
Junio C Hamano
a0f15fa502 Pretty-print tagger dates.
We can show commit objects with human readable dates using
various --pretty options, but there was no way to do so with
tags.  This introduces two such ways:

$ git-cat-file -p v1.2.3

shows the tag object with tagger dates in human readable format.

$ git-verify-tag --verbose v1.2.3

uses it to show the contents of the tag object as well as doing
GPG verification.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 17:06:20 -08:00
Junio C Hamano
e1a0c8b148 Merge branch 'lt/fix-apply' into maint
* lt/fix-apply:
  git-am: --whitespace=x option.
  git-apply: war on whitespace -- finishing touches.
  git-apply --whitespace=nowarn
  apply --whitespace: configuration option.
  apply: squelch excessive errors and --whitespace=error-all
  apply --whitespace fixes and enhancements.
  The war on trailing whitespace
2006-03-01 17:06:12 -08:00
Junio C Hamano
145c9a60ad Merge branch 'lt/apply'
* lt/apply:
  git-am: --whitespace=x option.
  git-apply: war on whitespace -- finishing touches.
  git-apply --whitespace=nowarn
  apply --whitespace: configuration option.
  apply: squelch excessive errors and --whitespace=error-all
  apply --whitespace fixes and enhancements.
  The war on trailing whitespace
2006-03-01 17:05:57 -08:00
Junio C Hamano
6be65bbc95 Merge early parts of 'np/delta' branch 2006-03-01 16:55:51 -08:00
Junio C Hamano
4d569a2c42 Merge git-mv fixes from 'maint' 2006-03-01 12:16:25 -08:00
Josef Weidendorfer
9e7c73de0b git-mv: fixes for path handling
Moving a directory ending in a slash was not working as the
destination was not calculated correctly.
E.g. in the git repo,

 git-mv t/ Documentation

gave the error

 Error: destination 'Documentation' already exists

To get rid of this problem, strip trailing slashes from all arguments.
The comment in cg-mv made me curious about this issue; Pasky, thanks!
As result, the workaround in cg-mv is not needed any more.

Also, another bug was shown by cg-mv. When moving files outside of
a subdirectory, it typically calls git-mv with something like

 git-mv Documentation/git.txt Documentation/../git-mv.txt

which triggers the following error from git-update-index:

 Ignoring path Documentation/../git-mv.txt

The result is a moved file, removed from git revisioning, but not
added again. To fix this, the paths have to be normalized not have ".."
in the middle. This was already done in git-mv, but only for
a better visual appearance :(

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 12:13:46 -08:00
Josef Weidendorfer
5e6f85f6c1 git-mv: Allow -h without repo & fix error message
This fixes "git-mv -h" to output the usage without the need
to be in a git repository.
Additionally:
- fix confusing error message when only one arg was given
- fix typo in error message

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 12:13:44 -08:00
Junio C Hamano
573464319f Allow git-mv to accept ./ in paths.
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 9a0e6731c6 commit)
2006-03-01 12:12:53 -08:00
Mark Wooding
feffaddce0 combine-diff: Honour -z option correctly.
Combined diffs don't null terminate things in the same way as standard
diffs.  This is presumably wrong.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 6baf0484ef commit)
2006-03-01 04:09:41 -08:00
Mark Wooding
b9003c06a8 combine-diff: Honour --full-index.
For some reason, combined diffs don't honour the --full-index flag when
emitting patches.  Fix this.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from e70c6b3574 commit)
2006-03-01 04:09:40 -08:00
Junio C Hamano
a64dd34d8c diffcore-break: micro-optimize by avoiding delta between identical files.
We did not check if we have the same file on both sides when
computing break score.  This is usually not a problem, but if
the user said --find-copies-harde with -B, we ended up trying a
delta between the same data even when we know the SHA1 hash of
both sides match.

Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from aeecd23ae2 commit)
2006-03-01 04:08:12 -08:00
Junio C Hamano
2b443e0fc3 Merge branch 'lt/rev-list' into next
* lt/rev-list:
  git-log (internal): more options.
  git-log (internal): add approxidate.
2006-03-01 03:17:13 -08:00
Junio C Hamano
7ae0b0cb65 git-log (internal): more options.
This ports the following options from rev-list based git-log
implementation:

 * -<n>, -n<n>, and -n <n>.  I am still wondering if we want
    this natively supported by setup_revisions(), which already
    takes --max-count.  We may want to move them in the next
    round.  Also I am not sure if we can get away with not
    setting revs->limited when we set max-count.  The latest
    rev-list.c and revision.c in this series do not, so I left
    them as they are.

 * --pretty and --pretty=<fmt>.

 * --abbrev=<n> and --no-abbrev.

The previous commit already handles time-based limiters
(--since, --until and friends).  The remaining things that
rev-list based git-log happens to do are not useful in a pure
log-viewing purposes, and not ported:

 * --bisect (obviously).

 * --header.  I am actually in favor of doing the NUL
   terminated record format, but rev-list based one always
   passed --pretty, which defeated this option.  Maybe next
   round.

 * --parents.  I do not think of a reason a log viewer wants
   this.  The flag is primarily for feeding squashed history
   via pipe to downstream tools.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 03:16:34 -08:00
Junio C Hamano
fd751667a2 git-log (internal): add approxidate.
Next will be the pretty-print format.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 03:16:34 -08:00
Junio C Hamano
1025fe51bf Merge branch 'lt/rev-list' into next
* lt/rev-list:
  Rip out merge-order and make "git log <paths>..." work again.
  Tie it all together: "git log"
  Introduce trivial new pager.c helper infrastructure
  git-rev-list libification: rev-list walking

blame.c #include's epoch.h; it needed to be killed.
2006-03-01 02:55:56 -08:00
Junio C Hamano
c436eb8cf1 diff-delta: cull collided hash bucket more aggressively.
This tries to limit collided hash buckets by removing identical
three-byte prefix from the same hashbucket.
2006-03-01 01:57:45 -08:00
Linus Torvalds
765ac8ec46 Rip out merge-order and make "git log <paths>..." work again.
Well, assuming breaking --merge-order is fine, here's a patch (on top of
the other ones) that makes

	git log <filename>

actually work, as far as I can tell.

I didn't add the logic for --before/--after flags, but that should be
pretty trivial, and is independent of this anyway.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 01:45:50 -08:00
Junio C Hamano
213523f46c Merge part of 'jc/diff' into next 2006-03-01 01:36:29 -08:00
Junio C Hamano
d54000ca3e Merge part of 'sp/checkout' into next 2006-03-01 01:35:51 -08:00
Junio C Hamano
f64c429ff7 Merge branch 'lt/apply' into next
* lt/apply:
  git-am: --whitespace=x option.
2006-03-01 01:35:00 -08:00
Junio C Hamano
dcf7e417c6 Merge branch 'js/refs' into next
* js/refs:
  Warn about invalid refs
2006-03-01 01:34:00 -08:00
Junio C Hamano
6ecc321ba5 Merge branch 'cvsserver' of http://locke.catalyst.net.nz/git/git-martinlanghoff; branch 'master' into next
Conflicts:

	Documentation/git-cvsserver.txt
	git-cvsserver.perl

Originally Martin's tree was based on "next", which meant that all
the other things that I am not ready to push out to "master" were
contained in it.  His changes looked good, and I wanted to have them
in "master".

So, here is what I did:

 - fetch Martin's tree into a temporary topic branch.
   $ git fetch $URL $remote:ml/cvsserver
   $ git checkout ml/cvsserver

 - rebase it on top of "master".
   $ git rebase --onto master next

 - pull that master into "next", recording Martin's head as well.
   $ git pull --append . master

Since I have apply.whitespace=strip in my configuration file, the
rebased cvsserver changes have trailing whitespaces introduced by
Martin's tree cleansed out.  Hence the above conflicts.

The reason I made this octopus is to make sure that next time Martin
pulls from my "next" branch, it results in a fast forward.  There is
no reason to force him do the same conflict resolution I did with this
merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 01:33:23 -08:00
Shawn Pearce
9debe63d10 Teach git-checkout-index to read filenames from stdin.
Since git-checkout-index is often used from scripts which
may have a stream of filenames they wish to checkout it is
more convenient to use --stdin than xargs.  On platforms
where fork performance is currently sub-optimal and
the length of a command line is limited (*cough* Cygwin
*cough*) running a single git-checkout-index process for
a large number of files beats spawning it multiple times
from xargs.

File names are still accepted on the command line if
--stdin is not supplied.  Nothing is performed if no files
are supplied on the command line or by stdin.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 01:15:31 -08:00
Johannes Schindelin
c401cb48e7 Warn about invalid refs
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 01:15:12 -08:00
Martin Langhoff
858cbfbabe cvsserver: Eclipse compat - browsing 'modules' (heads in our case) works
Eclipse CVS clients have an odd way of perusing the top level of
the repository, by calling update on module "". So reproduce cvs'
odd behaviour in the interest of compatibility.

It makes it much easier to get a checkout when using Eclipse.
2006-03-01 01:10:27 -08:00
Martin Langhoff
7172aabb4b cvsserver: Eclipse compat fixes - implement Questionable, alias rlog, add a space after the U
A few things to satisfy Eclipse's strange habits as a cvs client:

- Implement Questionable
- Aliased rlog to log, but more work may be needed
- Add a space after the U that indicates updated
2006-03-01 01:10:26 -08:00
Martin Langhoff
ee75d4cd31 cvsserver: add notes on how to get a checkout under Eclipse 2006-03-01 01:10:26 -08:00
Martin Langhoff
f0bcd511ee cvsserver: Eclipse compat - browsing 'modules' (heads in our case) works
Eclipse CVS clients have an odd way of perusing the top level of
the repository, by calling update on module "". So reproduce cvs'
odd behaviour in the interest of compatibility.

It makes it much easier to get a checkout when using Eclipse.
2006-03-01 21:07:55 +13:00
Martin Langhoff
5793aa1cc0 cvsserver: Eclipse compat fixes - implement Questionable, alias rlog, add a space after the U
A few things to satisfy Eclipse's strange habits as a cvs client:

- Implement Questionable
- Aliased rlog to log, but more work may be needed
- Add a space after the U that indicates updated
2006-03-01 21:07:55 +13:00
Martin Langhoff
49cc27bb46 cvsserver: add notes on how to get a checkout under Eclipse 2006-03-01 21:07:40 +13:00
Junio C Hamano
12cbbdc40b git-am: --whitespace=x option.
This is passed down to git-apply to override the built-in
default and per-repository configuration at runtime.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 22:38:40 -08:00
Junio C Hamano
8c31cb822f git-am: --whitespace=x option.
This is passed down to git-apply to override the built-in
default and per-repository configuration at runtime.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 22:34:57 -08:00
Junio C Hamano
e29e1147e4 diffcore-delta: stop using deltifier for packing.
This switches the change estimation logic used by break, rename
and copy detection from delta packing code to a more line
oriented one.  This way, thee performance-density tradeoff by
delta packing code can be made without worrying about breaking
the rename detection.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 20:20:04 -08:00
Junio C Hamano
65416758cd diffcore-rename: split out the delta counting code.
This is to rework diffcore break/rename/copy detection code
so that it does not affected when deltifier code gets improved.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 20:20:04 -08:00