Commit Graph

14031 Commits

Author SHA1 Message Date
Junio C Hamano
5ad9db3d04 Merge branch 'mr/autoconf-fread'
* mr/autoconf-fread:
  autoconf: Test FREAD_READS_DIRECTORIES
2008-03-14 00:27:59 -07:00
Junio C Hamano
16007f3916 Merge branch 'maint'
* maint:
  merge-file: handle empty files gracefully
  merge-recursive: handle file mode changes
  Minor wording changes in the keyboard descriptions in git-add --interactive.
  git fetch: Take '-n' to mean '--no-tags'
  quiltimport: fix misquoting of parsed -p<num> parameter
  git-quiltimport: better parser to grok "enhanced" series files.
2008-03-14 00:16:42 -07:00
Junio C Hamano
1b56bc9a15 Merge branch 'ph/maint-quiltimport' into maint
* ph/maint-quiltimport:
  quiltimport: fix misquoting of parsed -p<num> parameter
  git-quiltimport: better parser to grok "enhanced" series files.
2008-03-14 00:16:26 -07:00
Junio C Hamano
ca885a4fe6 read-tree() and unpack_trees(): use consistent limit
read-tree -m can read up to MAX_TREES, which was arbitrarily set to 8 since
August 2007 (4 is needed to deal with 2 merge-base case).

However, the updated unpack_trees() code had an advertised limit of 4
(which it enforced).  In reality the code was prepared to take only 3
trees and giving 4 caused it to stomp on its stack.  Rename the MAX_TREES
constant to MAX_UNPACK_TREES, move it to the unpack-trees.h common header
file, and use it from both places to avoid future confusion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 23:56:36 -07:00
Johannes Schindelin
381b851c9b merge-file: handle empty files gracefully
Earlier, it would error out while trying to read and/or writing them.
Now, calling merge-file with empty files is neither interesting nor
useful, but it is a bug that needed fixing.

Noticed by Clemens Buchacher.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2008-03-13 23:43:56 -07:00
Clemens Buchacher
1affea4f62 merge-recursive: handle file mode changes
File mode changes should be handled similarly to changes of content.
That is, if the file mode changed in only one branch, keep the changed
version, and if both branch changed to different mode, mark it as a
conflict.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 23:41:16 -07:00
Peter Karlsson
9065c36ea3 git-gui: updated Swedish translation
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-14 02:36:44 -04:00
Peter Karlsson
0212242d66 git-gui: Regenerated po template and merged translations with it
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-14 02:36:18 -04:00
Nicolas Pitre
f746bae84e pack-objects: proper pack time stamping with --max-pack-size
Runtime pack access is done in the pack file mtime order since recent
packs are more likely to contain frequently used objects than old packs.
However the --max-pack-size option can produce multiple packs with mtime
in the reversed order as newer objects are always written first.

Let's modify mtime of later pack files (when any) so they appear older
than preceding ones when a repack creates multiple packs.

Signed-off-by: Nicolas Pitre <nico@cam.org>
2008-03-13 22:51:30 -07:00
Vineet Kumar
bb12ac5120 Minor wording changes in the keyboard descriptions in git-add --interactive.
The wording of the interactive help text from git-add--interactive.perl is
clearer.  Just duplicate that text here.

Signed-off-by: Vineet Kumar <vineet@doorstop.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 22:46:56 -07:00
Junio C Hamano
63f671a440 Documentation/git-help: typofix
Noticed by Xavier Maillard

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 19:15:30 -07:00
Miklos Vajna
48ed49f2eb Update Hungarian translation. 100% completed. 2008-03-13 13:31:10 +01:00
Jeff King
462f8caf24 t7505: use SHELL_PATH in hook
The hook doesn't run properly under Solaris /bin/sh. Let's
use the SHELL_PATH the user told us about already instead.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:53 -07:00
Jeff King
32aedd5496 t9112: add missing #!/bin/sh header
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:53 -07:00
Jeff King
4bf9f27dfb filter-branch: use $SHELL_PATH instead of 'sh'
On some systems, 'sh' isn't very friendly. In particular,
t7003 fails on Solaris because it doesn't understand $().
Instead, use the specified SHELL_PATH to run shell code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:53 -07:00
Jeff King
d89c1dfac9 filter-branch: don't use xargs -0
Some versions of xargs don't understand "-0"; fortunately in
this case we can get the same effect by using "git clean".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:53 -07:00
Jeff King
5f7c643afe add NO_EXTERNAL_GREP build option
Previously, we just chose whether to allow external grep
based on the __unix__ define. However, there are systems
which define this macro but which have an inferior group
(e.g., one that does not support all options used by t7002).
This allows users to accept the potential speed penalty to
get a more consistent grep experience (and to pass the
testsuite).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:53 -07:00
Jeff King
cde2ed25ad t6000lib: tr portability fix
Some versions of tr complain if the number of characters in
both sets isn't the same. So here we must manually expand
the dashes in set2.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:53 -07:00
Jeff King
53a5b443b4 t4020: don't use grep -a
Solaris /usr/bin/grep doesn't understand "-a". In this case
we can just include the expected output with the test, which
is a better test anyway.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:53 -07:00
Jeff King
82ebb0b6ec add test_cmp function for test scripts
Many scripts compare actual and expected output using
"diff -u". This is nicer than "cmp" because the output shows
how the two differ. However, not all versions of diff
understand -u, leading to unnecessary test failure.

This adds a test_cmp function to the test scripts and
switches all "diff -u" invocations to use it. The function
uses the contents of "$GIT_TEST_CMP" to compare its
arguments; the default is "diff -u".

On systems with a less-capable diff, you can do:

  GIT_TEST_CMP=cmp make test

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:52 -07:00
Jeff King
b4ce54fc61 remove use of "tail -n 1" and "tail -1"
The "-n" syntax is not supported by System V versions of
tail (which prefer "tail -1"). Unfortunately "tail -1" is
not actually POSIX.  We had some of both forms in our
scripts.

Since neither form works everywhere, this patch replaces
both with the equivalent sed invocation:

  sed -ne '$p'

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:52 -07:00
Jeff King
aadbe44f88 grep portability fix: don't use "-e" or "-q"
System V versions of grep (such as Solaris /usr/bin/grep)
don't understand either of these options. git's usage of
"grep -e pattern" fell into one of two categories:

 1. equivalent to "grep pattern". -e is only useful here if
    the pattern begins with a "-", but all of the patterns
    are hardcoded and do not begin with a dash.

 2. stripping comments and blank lines with

      grep -v -e "^$" -e "^#"

    We can fortunately do this in the affirmative as

      grep '^[^#]'

Uses of "-q" can be replaced with redirection to /dev/null.
In many tests, however, "grep -q" is used as "if this string
is in the expected output, we are OK". In this case, it is
fine to just remove the "-q" entirely; it simply makes the
"verbose" mode of the test slightly more verbose.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:52 -07:00
Jeff King
e85fe4d85b more tr portability test script fixes
Dealing with NULs is not always safe with tr. On Solaris,
incoming NULs are silently deleted by both the System V and
UCB versions of tr. When converting to NULs, the System V
version works fine, but the UCB version silently ignores the
request to convert the character.

This patch changes all instances of tr using NULs to use
"perl -pe 'y///'" instead.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:52 -07:00
Jeff King
e8e29c7b55 t0050: perl portability fix
Older versions of perl (such as 5.005) don't understand -CO, nor
do they understand the "U" pack specifier. Instead of using perl,
let's just printf the binary bytes we are interested in.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:57:40 -07:00
Shawn Bohrer
82cea9ffb1 git-p4: Use P4EDITOR environment variable when set
Perforce allows you to set the P4EDITOR environment variable to your
preferred editor for use in perforce.  Since we are displaying a
perforce changelog to the user we should use it when it is defined.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-03-13 08:57:29 +01:00
Shawn Bohrer
67abd41716 git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
A custom diffing utility can be specified for the 'p4 diff' command by
setting the P4DIFF environment variable.  However when using a custom
diffing utility such as 'vimdiff' passing options like -du can cause
unexpected behavior.

Since the goal is to generate a unified diff of the changes and attach
them to the bottom of the p4 submit log we should unset P4DIFF if it
has been set in order to generate the diff properly.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-03-13 08:57:29 +01:00
Marius Storm-Olsen
8ff45f2af5 git-p4: Optimize the fetching of data from perforce.
Use shallow copies in loop, and join content at the end. Then do the substitution, if needed.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-03-13 08:57:29 +01:00
Johannes Schindelin
e7951290f6 git fetch: Take '-n' to mean '--no-tags'
Prior to commit 8320199 (Rewrite builtin-fetch option parsing to use
parse_options().), we understood '-n' as a short option to mean "don't
fetch tags from the remote". This patch reinstates behaviour similar,
but not identical to the pre commit 8320199 times.

Back then, -n always overrode --tags, so if both --tags and -n was
given on command-line, no tags were fetched regardless of argument
ordering. Now we use a "last entry wins" strategy, so '-n --tags'
means "fetch tags".

Since it's patently absurd to say both --tags and --no-tags, this
shouldn't matter in practice.

Spotted-by: Artem Zolochevskiy <azol@altlinux.org>
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Tested-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:31:18 -07:00
Junio C Hamano
b75aaa546e Merge branch 'maint'
* maint:
  git-cvsimport: fix merging with remote parent branch
  gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form
2008-03-12 23:47:31 -07:00
Johannes Schindelin
25ee9731c1 gc: call "prune --expire 2.weeks.ago" by default
The only reason we did not call "prune" in git-gc was that it is an
inherently dangerous operation: if there is a commit going on, you will
prune loose objects that were just created, and are, in fact, needed by the
commit object just about to be created.

Since it is dangerous, we told users so.  That led to many users not even
daring to run it when it was actually safe. Besides, they are users, and
should not have to remember such details as when to call git-gc with
--prune, or to call git-prune directly.

Of course, the consequence was that "git gc --auto" gets triggered much
more often than we would like, since unreferenced loose objects (such as
left-overs from a rebase or a reset --hard) were never pruned.

Alas, git-prune recently learnt the option --expire <minimum-age>, which
makes it a much safer operation.  This allows us to call prune from git-gc,
with a grace period of 2 weeks for the unreferenced loose objects (this
value was determined in a discussion on the git list as a safe one).

If you want to override this grace period, just set the config variable
gc.pruneExpire to a different value; an example would be

	[gc]
		pruneExpire = 6.months.ago

or even "never", if you feel really paranoid.

Note that this new behaviour makes "--prune" be a no-op.

While adding a test to t5304-prune.sh (since it really tests the implicit
call to "prune"), also the original test for "prune --expire" was moved
there from t1410-reflog.sh, where it did not belong.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2008-03-12 23:47:01 -07:00
Junio C Hamano
dbdbfec441 Documentation/config: typofix
Each heading of enumerated list should end with double-colon, not single.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 23:44:42 -07:00
Christian Couder
5fb0b3e007 help: warn if specified 'man.viewer' is unsupported, instead of erroring out
When a document viewer that is unknown to the current version of git is
specified in the .git/config file, instead of erroring out the process
entirely, just issue a warning.  It might be that the user usually is
using a newer git that supports it (and the configuration is written for
that version) but is temporarily using an older git that does not know the
viewer.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 23:23:27 -07:00
Christian Couder
b8322ea83b Documentation: help: explain 'man.viewer' multiple values
Also add titles to paragraphs under "CONFIGURATION VARIABLES".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 23:03:35 -07:00
Michele Ballabio
0c87a951c2 git-gui: update Italian translation
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-13 01:23:22 -04:00
Jeff King
40a7ce64e1 tr portability fixes
Specifying character ranges in tr differs between System V
and POSIX. In System V, brackets are required (e.g.,
'[A-Z]'), whereas in POSIX they are not.

We can mostly get around this by just using the bracket form
for both sets, as in:

  tr '[A-Z] '[a-z]'

in which case POSIX interpets this as "'[' becomes '['",
which is OK.

However, this doesn't work with multiple sequences, like:

  # rot13
  tr '[A-Z][a-z]' '[N-Z][A-M][n-z][a-m]'

where the POSIX version does not behave the same as the
System V version. In this case, we must simply enumerate the
sequence.

This patch fixes problematic uses of tr in git scripts and
test scripts in one of three ways:

  - if a single sequence, make sure it uses brackets
  - if multiple sequences, enumerate
  - if extra brackets (e.g., tr '[A]' 'a'), eliminate
    brackets

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 21:10:00 -07:00
Junio C Hamano
18d077c1bf quiltimport: fix misquoting of parsed -p<num> parameter
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 21:07:19 -07:00
Marc-Andre Lureau
c36c5b845e git-cvsimport: fix merging with remote parent branch
commit-tree fails when specifying a remote name (via -r option) and
one of the parent branch has a name. Prefixing with "$remote/" fix it.

Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 21:03:39 -07:00
Jakub Narebski
7863c612f4 gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form
URLs generated by href(..., -replay=>1) (which includes 'next page'
links and alternate view links) didn't set project info correctly
when current page URL is in pathinfo form.

This resulted in broken links such like:

  http://www.example.com/w/ARRAY(0x85a5318)?a=shortlog;pg=1

if the 'pathinfo' feature was used, or

  http://www.example.com/w/?a=shortlog;pg=1

if it wasn't, instead of correct:

  http://www.example.com/w/project.git?a=shortlog;pg=1

This was caused by the fact that href() always replays params in the
arrayref form, were they multivalued or singlevalued, and the code
dealing with 'pathinfo' feature couldn't deal with $params{'project'}
being arrayref.

Setting $params{'project'} is moved before replaying params; this
ensures that 'project' parameter is processed correctly.

Noticed-by: Peter Oberndorfer <kumbayo84@arcor.de>
Noticed-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 09:43:08 -07:00
Junio C Hamano
74ca5e6d7c Makefile: flatten enumeration of headers, objects and programs
With flattened one-line-per-item list that is sorted, hopefully we will
have less merge conflicts when various topics are merged.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 01:55:48 -07:00
Junio C Hamano
bd92cd0f74 Makefile: DIFF_OBJS is not special at all these days
It used to make sense back when nothing but diff-files, diff-index and
friends depended on diffcore infrastructure, but pretty much everything
depends on revision infrastructure which in turn depends on DIFF_OBJS.

There is no reason to treat them any differently in the Makefile.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 01:55:46 -07:00
Johannes Sixt
eed3559575 git-submodule summary: fix that some "wc" flavors produce leading spaces
We print the number of commits in parentheses, but without this change
we would get an oddly looking line like this:

    * sm1 4c8d358...41fbea9 (      4):

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 01:53:30 -07:00
Ping Yin
2da2ddc664 git-submodule summary: test
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 23:20:06 -07:00
Ping Yin
925e7f622d git-submodule summary: documentation
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 23:20:06 -07:00
Ping Yin
f2dc06a344 git-submodule summary: limit summary size
This patch teaches git-submodule an option '--summary-limit|-n <number>'
to limit number of commits in total for the summary of each submodule in
the modified case (only a single commit is shown in other cases).

Giving 0 will disable the summary; a negative number means unlimted, which
is the default.

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 23:20:06 -07:00
Ping Yin
1cb639e6b0 git-submodule summary: show commit summary
This patch does the hard work to show submodule commit summary.

For a modified submodule, a series of commits will be shown with
the following command:

    git log --pretty='format:%m %s' \
        --first-parent sha1_src...sha1_dst

where the sha1_src is from the given super project commit and the
sha1_dst is from the index or working tree (switched by --cached).

For a deleted, added, or typechanged (blob<->submodule) submodule,
only one single newest commit from the existing end (for example,
src end for submodule deleted or type changed from submodule to blob)
will be shown.

If the src/dst sha1 for a submodule is missing in the submodule
directory, a warning will be issued except in two cases where the
submodule directory is deleted (type 'D') or typechanged to blob
(one case of type 'T').

In the title line for a submodule, the src/dst sha1 and the number
of commits (--first-parent) between the two commits will be shown.

The following example demonstrates most cases.

    Example: commit summary for modified submodules sm1-sm5.
    --------------------------------------------
    $ git submodule summary
    * sm1 354cd45...3f751e5 (4):
      < one line message for C
      < one line message for B
      > one line message for D
      > one line message for E

    * sm2 5c8bfb5...000000 (3):
      < one line message for F

    * sm3 354cd45...3f751e5:
      Warn: sm3 doesn't contain commit 354cd45

    * sm4 354cd34(submodule)-> 235efa(blob) (1):
      < one line message for G

    * sm5 354cd34(blob)-> 235efa(submodule) (5):
      > one line message for H

    --------------------------------------------

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 23:20:03 -07:00
Christian Couder
69099d6bed help: implement multi-valued "man.viewer" config option
This allows multiple viewer candidates to be listed in the configuration
file, like this:

        [man]
                viewer = woman
                viewer = konqueror
                viewer = man

The candidates are tried in the order listed in the configuration file,
and the first suitable one (e.g. konqueror cannot be used outside windowed
environment) is used.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Tested-by: Xavier Maillard <xma@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 23:02:01 -07:00
Christian Couder
b5578f3335 Documentation: help: describe 'man.viewer' config variable
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Tested-by: Xavier Maillard <xma@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 23:02:01 -07:00
Christian Couder
649499845c help: add "man.viewer" config var to use "woman" or "konqueror"
This patch makes it possible to view man pages using other tools
than the "man" program. It also implements support for emacs'
"woman" and konqueror with the man KIO slave to view man pages.

Note that "emacsclient" is used with option "-e" to launch "woman"
on emacs and this works only on versions >= 22.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Tested-by: Xavier Maillard <xma@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 23:02:01 -07:00
Junio C Hamano
a6828f5361 Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
  git-gui: Simplify MSGFMT setting in Makefile
  git-gui: Add option for changing the width of the commit message text box
  git-gui: if a background colour is set, set foreground colour as well
  git-gui: translate the remaining messages in zh_cn.po to chinese
2008-03-11 22:59:35 -07:00
Junio C Hamano
7276607886 git-gui: Simplify MSGFMT setting in Makefile
To prepare msg files for Tcl scripts, the command that is set to MSGFMT
make variable needs to be able to grok "--tcl -l <lang> -d <here>" options
correctly.  This patch simplifies the tests done in git-gui's Makefile to
directly test this condition.  If the test run does not exit properly with
zero status (either because you do not have "msgfmt" itself, or your
"msgfmt" is too old to grok --tcl option --- the reason does not matter),
have it fall back to po/po2msg.sh

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-12 01:48:32 -04:00