Commit Graph

4435 Commits

Author SHA1 Message Date
Junio C Hamano
05f743f328 Merge branch 'lt/diff'
* lt/diff:
  git diff: support "-U" and "--unified" options properly
2006-05-15 18:09:15 -07:00
Junio C Hamano
d55aaefa3e Merge branch 'fix'
* fix:
  Fix pack-index issue on 64-bit platforms a bit more portably.
  Install git-send-email by default
  Fix compilation on newer NetBSD systems
  git config syntax updates
  Another config file parsing fix.
  checkout: use --aggressive when running a 3-way merge (-m).
2006-05-15 13:48:22 -07:00
Junio C Hamano
1b9bc5a7b7 Fix pack-index issue on 64-bit platforms a bit more portably.
Apparently <stdint.h> is not enough for uint32_t on OpenBSD; use
"unsigned int" -- hopefully that would stay 32-bit on every
platform we care about, at least until we update the pack-index
file format.

Our sha1 routines optimized for architectures use uint32_t and
expects '#include <stdint.h>' to be enough, so OpenBSD on arm or
ppc might have similar issues down the road, I dunno.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:01:37 -07:00
Eric Wong
f3dd5eae58 Install git-send-email by default
After 567ffeb772 and
4bc87a28be, git-send-email no
longer requires any non-standard Perl modules, so there's no
reason to special-case it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:00:28 -07:00
Dennis Stosberg
e88856b485 Fix compilation on newer NetBSD systems
NetBSD >=2.0 has iconv() in libc.  A libiconv is not required and
does not exist.

See: http://netbsd.gw.com/cgi-bin/man-cgi?iconv+3+NetBSD-2.0

[jc: with a bit of simplification later discussed on the list.]

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:00:01 -07:00
Junio C Hamano
de1d4fa2a1 Merge branch 'fix'
* fix:
  Ensure author & committer before asking for commit message.
2006-05-15 00:51:37 -07:00
Junio C Hamano
c8df633b4e Merge branch 'fix' into maint
* fix:
  Ensure author & committer before asking for commit message.
2006-05-15 00:49:25 -07:00
Eric Wong
15739c89fb Install git-send-email by default
After 567ffeb772 and
4bc87a28be, git-send-email no
longer requires any non-standard Perl modules, so there's no
reason to special-case it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14 22:37:00 -07:00
Eric Wong
994d6c66d3 send-email: address expansion for common mailers
mutt, gnus, pine, mailrc formats should be supported.

Testing and feedback for correctness and completeness of all formats
and support for additional formats would be good.

Nested expansions are also supported.

More than one alias file to be used.

All alias file formats must still of be the same type, though.

Two git repo-config keys are required for this
(as suggested by Ryan Anderson):

    sendemail.aliasesfile = <filename of aliases file>
    sendemail.aliasfiletype = (mutt|gnus|pine|mailrc)

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Acked-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14 22:36:27 -07:00
Junio C Hamano
cc908b82a4 diffstat rename squashing fix.
When renaming leading/a/filename to leading/b/filename (and
"filename" is sufficiently long), we tried to squash the rename
to "leading/{a => b}/filename".  However, when "/a" or "/b" part
is empty, we underflowed and tried to print a substring of
length -1.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14 22:07:28 -07:00
Sean
ec4e69c06a Ensure author & committer before asking for commit message.
It's better to find out you need to fix your author and
committer information before you enter a long commit message.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14 16:27:03 -07:00
Linus Torvalds
ee1e5412a7 git diff: support "-U" and "--unified" options properly
We used to parse "-U" and "--unified" as part of the GIT_DIFF_OPTS
environment variable, but strangely enough we would _not_ parse them as
part of the normal diff command line (where we only accepted "-u").

This adds parsing of -U and --unified, both with an optional numeric
argument. So now you can just say

	git diff --unified=5

to get a unified diff with a five-line context, instead of having to do
something silly like

	GIT_DIFF_OPTS="--unified=5" git diff -u

(that silly format does continue to still work, of course).

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14 16:26:27 -07:00
Junio C Hamano
975bf9cf5a Merge branch 'fix'
* fix:
  include header to define uint32_t, necessary on Mac OS X
2006-05-14 16:20:15 -07:00
Junio C Hamano
3f22deb7f5 Merge branch 'fix' into maint
* fix:
  include header to define uint32_t, necessary on Mac OS X
2006-05-14 16:20:09 -07:00
Ben Clifford
d9635e9c53 include header to define uint32_t, necessary on Mac OS X
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14 16:19:52 -07:00
Junio C Hamano
5f7f211a54 Merge branch 'ml/cvs'
* ml/cvs:
  Change to allow subdir updates from Eclipse
  Many fixes for most operations in Eclipse.
  Added logged warnings for CVS error returns
  cvsserver: use git-rev-list instead of git-log
  git-cvsexportcommit: Add -f(orce) and -m(essage prefix) flags, small cleanups.
2006-05-14 00:42:16 -07:00
Junio C Hamano
3a3e89b897 Merge branch 'fix'
* fix:
  Fix git-pack-objects for 64-bit platforms
2006-05-13 22:24:18 -07:00
Linus Torvalds
d14f776402 git config syntax updates
This updates the hierarchical section name syntax to

	[section<space>+"<randomstring>"]

where the only rule for "randomstring" is that it can't contain a newline,
and if you really want to insert a double-quote, you do it with \".

It turns that into the section name "secion.randomstring".  The
"section" part is still case insensitive, but the "randomstring"
part is case sensitive.

So you could use this for things like

	[email "torvalds@osdl.org"]
		name = Linus Torvalds

if you wanted to do the "email->name" conversion as part of the config
file format (I'm not claiming that is sensible, I'm just giving it as an
insane example). That would show up as the association

	email.torvalds@osdl.org.name -> Linus Torvalds

which is easy to parse (the "." in the email _looks_ ambiguous, but it
isn't: you know that there will always be a single key-name, so you find
the key name with "strrchr(name, '.')" and things are entirely
unambiguous).

Repo-config is updated to be able to parse the new format, and also
write things out in the new format.

[jc: rolled two patches from Linus and one fix-up from Sean into one,
 with additional adjustments for t/t1300 test to check the case
 insensitiveness of section base and variable and case sensitiveness
 of the extended section part.  Then stripped some part off to make
 the result applicable to the stale 1.3.X series that does not have
 recent enhancements. ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-13 14:00:16 -07:00
sean
bdf0ef0824 Another config file parsing fix.
If the variable we need to store should go into a section
that currently only has a single variable (not matching
the one we're trying to insert), we will already be into
the next section before we notice we've bypassed the correct
location to insert the variable.

To handle this case we store the current location as soon
as we find a variable matching the section of our new
variable.

This breakage was brought up by Linus.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-13 14:00:16 -07:00
Junio C Hamano
618faa1dc7 checkout: use --aggressive when running a 3-way merge (-m).
After doing an in-index 3-way merge, we always do the stock
"merge-index merge-one-file" without doing anything fancy;
use of --aggressive helps performance quite a bit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-13 14:00:15 -07:00
Dennis Stosberg
66561f5a77 Fix git-pack-objects for 64-bit platforms
The offset of an object in the pack is recorded as a 4-byte integer
in the index file.  When reading the offset from the mmap'ed index
in prepare_pack_revindex(), the address is dereferenced as a long*.
This works fine as long as the long type is four bytes wide.  On
NetBSD/sparc64, however, a long is 8 bytes wide and so dereferencing
the offset produces garbage.

[jc: taking suggestion by Linus to use uint32_t]

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-13 10:43:16 -07:00
Nicolas Pitre
639ca54972 fix diff-delta bad memory access
It cannot be assumed that the given buffer will never be moved when
shrinking the allocated memory size with realloc().  So let's ignore
that optimization for now.

This patch makes Electric Fence happy on Linux.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Acked-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-10 10:53:59 -07:00
Junio C Hamano
f7a3276bab Merge branch 'fix'
* fix:
  checkout: use --aggressive when running a 3-way merge (-m).
  revert/cherry-pick: use aggressive merge.
2006-05-09 19:24:16 -07:00
Junio C Hamano
8d7a397aab checkout: use --aggressive when running a 3-way merge (-m).
After doing an in-index 3-way merge, we always do the stock
"merge-index merge-one-file" without doing anything fancy;
use of --aggressive helps performance quite a bit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-09 19:23:23 -07:00
Linus Torvalds
d1802851b0 revert/cherry-pick: use aggressive merge.
After doing an in-index 3-way merge, we always do the stock
"merge-index merge-one-file" without doing anything fancy;
use of --aggressive helps performance quite a bit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-09 19:22:25 -07:00
Junio C Hamano
8c2462dc5b Merge branch 'jc/clean'
* jc/clean:
  Teach git-clean optional <paths>... parameters.
2006-05-09 16:52:54 -07:00
Junio C Hamano
2c49009dbe Merge branch 'mw/alternates'
* mw/alternates:
  clone: don't clone the info/alternates file
  test case for transitive info/alternates
  Transitively read alternatives
2006-05-09 16:45:45 -07:00
Junio C Hamano
b9895c0688 Merge branch 'jc/xsha1'
* jc/xsha1:
  get_sha1() - fix infinite loop on nonexistent stage.
  get_sha1(): :path and :[0-3]:path to extract from index.
2006-05-09 16:44:59 -07:00
Junio C Hamano
143f4d94c6 Merge branch 'jc/again'
* jc/again:
  Fix users of prefix_path() to free() only when necessary
  update-index --again: take optional pathspecs
  update-index --again
2006-05-09 16:40:53 -07:00
Junio C Hamano
4edd44725c Merge branch 'np/delta'
* np/delta:
  improve diff-delta with sparse and/or repetitive data
  tiny optimization to diff-delta
  replace adler32 with Rabin's polynomial in diff-delta
  use delta index data when finding best delta matches
  split the diff-delta interface
2006-05-09 16:40:28 -07:00
Junio C Hamano
2fc240a7b2 Merge branch 'jc/bindiff'
* jc/bindiff:
  improve base85 generated assembly code
  binary diff and apply: testsuite.
  binary diff: further updates.
  binary patch.
2006-05-09 14:16:56 -07:00
Junio C Hamano
016cd9f665 Merge branch 'fix'
* fix:
  read-cache.c: use xcalloc() not calloc()
  apply: fix infinite loop with multiple patches with --index
2006-05-09 13:54:42 -07:00
Junio C Hamano
5c222ce2c4 Merge branch 'tojunio' of http://locke.catalyst.net.nz/git/git-martinlanghoff into ml/cvs
* 'tojunio' of http://locke.catalyst.net.nz/git/git-martinlanghoff:
  Change to allow subdir updates from Eclipse
  Many fixes for most operations in Eclipse.
  Added logged warnings for CVS error returns
  cvsserver: use git-rev-list instead of git-log
  git-cvsexportcommit: Add -f(orce) and -m(essage prefix) flags, small cleanups.
2006-05-09 12:25:21 -07:00
Yakov Lerner
28cc4ab422 read-cache.c: use xcalloc() not calloc()
Elsewhere we use xcalloc(); we should consistently do so.

Signed-off-by: Yakov Lerner <iler.ml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-09 06:28:59 -07:00
Eric Wong
dbd0f7d322 apply: fix infinite loop with multiple patches with --index
When multiple patches are passed to git-apply, it will attempt
to open multiple file descriptors to an index, which means
multiple entries will be in the circular cache_file_list.

This change makes git-apply only open the index once and
write the index at exit.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-09 01:29:38 -07:00
Junio C Hamano
393e3b1910 Teach git-clean optional <paths>... parameters.
When optional paths arguments are given, git-clean passes them
to underlying git-ls-files; with this, you can say:

	git clean 'temp-*'

to clean only the garbage files whose names begin with 'temp-'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Pavel Roskin <proski@gnu.org>
2006-05-08 16:40:45 -07:00
Junio C Hamano
45f75a0167 Merge branch 'fix'
* fix:
  Separate object name errors from usage errors
  Documentation: {caret} fixes (git-rev-list.txt)
  Fix "git diff --stat" with long filenames
  Fix repo-config set-multivar error return path.
2006-05-08 16:40:23 -07:00
Dmitry V. Levin
31fff305bc Separate object name errors from usage errors
Separate object name errors from usage errors.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-08 16:25:33 -07:00
Junio C Hamano
e7cef45fbc get_sha1() - fix infinite loop on nonexistent stage.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-08 15:44:06 -07:00
Junio C Hamano
afb4ff2069 Documentation: {caret} fixes (git-rev-list.txt)
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-08 13:46:53 -07:00
Nicolas Pitre
addaacab07 improve base85 generated assembly code
This code is arguably pretty hot, if you use binary patches of course.
This patch helps gcc generate both smaller and faster code especially in
the error free path.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-08 11:05:01 -07:00
Linus Torvalds
5d6a9f45e1 Fix "git diff --stat" with long filenames
When we cut off the front of a filename to make it fit on the line, we add
a "..." in front. However, the way the "git diff" code was written, we
will never reset the prefix back to the empty string, so every single
filename afterwards will have the "..." prefix, whether appropriate or
not.

You can see this with "git diff v2.6.16.." on the current kernel tree,
since there are filenames with long names that changed there:

 [ snip snip ]
 Documentation/filesystems/vfs.txt                  |  229
 .../firmware_class/firmware_sample_driver.c        |    3
 .../firmware_sample_firmware_class.c               |    1
 ...Documentation/fujitsu/frv/kernel-ABI.txt           |  192
 ...Documentation/hwmon/w83627hf                       |    4
 [ snip snip ]

notice how the two Documentation/firmware** filenames caused the "..." to
be added, but then the later filenames don't want it, and it also screws
up the alignment of the line numbering afterwards.

Trivially fixed by moving the declaration (and initial setting) of the
"prefix" variable into the for-loop where it is used.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-08 10:54:30 -07:00
Junio C Hamano
f8ba655ee4 Fix repo-config set-multivar error return path.
This hopefully fixes the problem an earlier commit 5d8ee9ceb attemted
to fix.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-07 21:27:30 -07:00
Martin Waitz
0438402271 clone: don't clone the info/alternates file
Now that the cloned alternates file is parsed, too we don't need to
copy it into our new repository, we just reference it.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-07 15:41:35 -07:00
Martin Waitz
dd05ea1799 test case for transitive info/alternates
Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-07 15:41:35 -07:00
Martin Waitz
c2f493a4ae Transitively read alternatives
When adding an alternate object store then add entries from its
info/alternates files, too.
Relative entries are only allowed in the current repository.
Loops and duplicate alternates through multiple repositories are ignored.
Just to be sure that nothing breaks it is not allow to build deep
nesting levels using info/alternates.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-07 15:41:35 -07:00
Martyn Smith
82000d7464 Change to allow subdir updates from Eclipse
(Now you can rightclick any directory and select team-update/team-commit) and it should work
2006-05-08 10:38:31 +12:00
Junio C Hamano
fd60acaced Merge branch 'fix'
* fix:
  repack: honor -d even when no new pack was created
  clone: keep --reference even with -l -s
  repo-config: document what value_regexp does a bit more clearly.
  Release config lock if the regex is invalid
  core-tutorial.txt: escape asterisk
2006-05-07 15:36:39 -07:00
Peter Hagervall
d92f1dc63f Sparse fix for builtin-diff
You gotta love sparse:

builtin-diff.c:88:4: error: Just how const do you want this type to be?

Signed-off-by: Peter Hagervall <hager@cs.umu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-07 15:36:10 -07:00
Martin Waitz
178613c737 repack: honor -d even when no new pack was created
If all objects are reachable via an alternate object store then we
still have to remove all obsolete local packs.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-07 15:35:50 -07:00