1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-28 08:06:23 +02:00
Commit Graph

23307 Commits

Author SHA1 Message Date
Ævar Arnfjörð Bjarmason 3328acedc6 perl: use "use warnings" instead of -w
Change the Perl scripts to turn on lexical warnings instead of setting
the global $^W variable via the -w switch.

The -w sets warnings for all code that interpreter runs, while "use
warnings" is lexically scoped. The former is probably not what the
authors wanted.

As an auxiliary benefit it's now possible to build Git with:

    PERL_PATH='/usr/bin/env perl'

Which would previously result in failures, since "#!/usr/bin/env perl -w"
doesn't work as a shebang.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27 12:37:56 -07:00
Ævar Arnfjörð Bjarmason d48b284183 perl: bump the required Perl version to 5.8 from 5.6.[21]
Formalize our dependency on perl 5.8, bumped from 5.6.[12]. We already
used the three-arg form of open() which was introduced in 5.6.1, but
t/t9700/test.pl explicitly depended on 5.6.2.

However git-add--interactive.pl has been failing on the 5.6 line since
it was introduced in v1.5.0-rc0~12^2~2 back in 2006 due to this open
syntax:

    sub run_cmd_pipe {
           my $fh = undef;
           open($fh, '-|', @_) or die;
           return <$fh>;
    }

Which when executed dies on "Can't use an undefined value as
filehandle reference". Several of our tests also fail on 5.6 (even
more when compiled with NO_PERL_MAKEMAKER=1):

    t2016-checkout-patch.sh
    t3904-stash-patch.sh
    t3701-add-interactive.sh
    t7105-reset-patch.sh
    t7501-commit.sh
    t9700-perl-git.sh

Our code is bitrotting on 5.6 with no-one interested in fixing it, and
pinning us to such an ancient release of Perl is keeping us from using
useful features introduced in the 5.8 release.

The 5.6 series is now over 10 years old, and the 5.6.2 maintenance
release almost 7. 5.8 on the other hand is more than 8 years old.

All the modern Unix-like operating systems have now upgraded to it or
a later version, and 5.8 packages are available for old IRIX, AIX
Solaris and Tru64 systems.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Tor Arntsen <tor@spacetec.no>
Acked-by: Randal L. Schwartz <merlyn@stonehenge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27 12:37:41 -07:00
Brian Gernhardt 9027fa9eb7 git-stash: fix flag parsing
Currently git-stash uses `git rev-parse --no-revs -- "$@"` to set its
FLAGS variable.  This is the same as `FLAGS="-- $@"`.  It should use
`git rev-parse --no-revs --flags "$@"`, but that eats any "-q" or
"--quiet" argument.  So move the check for quiet before rev-parse.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-26 21:27:37 -07:00
Brandon Casey 3fcb88785d t/t3903-stash: improve testing of git-stash show
Recently, the 'stash show' functionality was broken for the case when a
stash-like argument was supplied.  Since, commit 9bf09e, 'stash show' when
supplied a stash-like argument prints nothing and still exists with a zero
status.  Unfortunately, the flaw slipped through the test suite cracks
since the output of 'stash show' was not verified to be correct.

Improve and expand on the existing tests so that this flaws is detected.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-26 21:25:40 -07:00
Junio C Hamano 87b50542a0 Git 1.7.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-18 14:55:08 -07:00
Junio C Hamano 1125297ca1 Merge branch 'js/ls-files-x-doc'
* js/ls-files-x-doc:
  ls-files documentation: reword for consistency
  git-ls-files.txt: clarify -x/--exclude option

Conflicts:
	Documentation/git-ls-files.txt
2010-09-18 14:46:44 -07:00
Chris Johnsen 14d872987a git-rebase--interactive.sh: replace cut with ${v%% *}
Some versions of cut do not cope well with lines that do not end in
an LF. In this case, we can completely avoid cut by using the
${var%% *} parameter expansion (suggested by Brandon Casey).

I found this problem when t3404's "avoid unnecessary reset" failed
due to the "rebase -i" not avoiding updating the tested timestamp.

On a Mac OS X 10.4.11 system:

    % printf '%s' 'foo bar' | /usr/bin/cut -d ' ' -f 1
    cut: stdin: Illegal byte sequence

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-17 14:58:08 -07:00
Brandon Casey 84d694027f t/t7300: workaround ancient touch by rearranging arguments
The ancient touch on Solaris 7 thinks that a decimal number supplied as
the first argument specifies a date_time to give to the files specified by
the remaining arguments.  In this case, it fails to parse '1' as a proper
date_time and exits with a failure status.  Workaround this flaw by
rearranging the arguments supplied to touch so that a non-digit appears
first and touch will not be confused.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-17 14:42:13 -07:00
Junio C Hamano 02567e88ee Merge branch 'bg/fix-t7003'
* bg/fix-t7003:
  t7003: Use test_commit instead of custom function
2010-09-16 07:43:41 -07:00
Junio C Hamano 4c608520ed ls-files documentation: reword for consistency
Similar to descriptions of other options, state what -x does in imperative
mood.  Start sentences for -X and --exclude-per-directory options in
capital letters.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-15 17:38:50 -07:00
Jay Soffian 75609a0d44 git-ls-files.txt: clarify -x/--exclude option
Since b5227d8, -x/--exclude does not apply to cached files.
This is easy to miss unless you read the discussion in the
EXCLUDE PATTERNS section. Clarify that the option applies
to untracked files and direct the reader to EXCLUDE PATTERNS.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-15 17:30:36 -07:00
Junio C Hamano 7e100effc6 Git 1.7.3 rc2 2010-09-15 12:47:37 -07:00
Junio C Hamano 2e1e96126f Merge branch 'dr/maint-ls-tree-prefix-recursion-fix'
* dr/maint-ls-tree-prefix-recursion-fix:
  ls-tree $di $dir: do not mistakenly recurse into directories
2010-09-15 12:41:13 -07:00
Junio C Hamano 0c61c6de34 Merge branch 'os/fix-rebase-diff-no-prefix'
* os/fix-rebase-diff-no-prefix:
  Add --src/dst-prefix to git-formt-patch in git-rebase.sh
2010-09-15 12:40:33 -07:00
Junio C Hamano e3f213c7af Merge branch 'jl/fix-test'
* jl/fix-test:
  t1020: Get rid of 'cd "$HERE"' at the start of each test
  t2016 (checkout -p): add missing &&
  t1302 (core.repositoryversion): style tweaks
  t2105 (gitfile): add missing &&
  t1450 (fsck): remove dangling objects
  tests: subshell indentation stylefix
  Several tests: cd inside subshell instead of around
2010-09-15 12:40:12 -07:00
Junio C Hamano 43d268e9dd Merge branch 'ch/filter-branch-deprecate-remap-to-ancestor'
* ch/filter-branch-deprecate-remap-to-ancestor:
  filter-branch: retire --remap-to-ancestor
2010-09-15 12:39:32 -07:00
Junio C Hamano d42cb5804f Merge branch 'ch/maint-cannot-create-bundle-error'
* ch/maint-cannot-create-bundle-error:
  bundle: detect if bundle file cannot be created
2010-09-15 12:39:22 -07:00
Junio C Hamano 9f0ccb5b0a Merge branch 'ks/recursive-rename-add-identical'
* ks/recursive-rename-add-identical:
  RE: [PATCH] Avoid rename/add conflict when contents are identical
2010-09-15 12:39:12 -07:00
Junio C Hamano 12644fa99f Merge git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui:
  git-gui 0.13
  git-gui: avoid mis-encoding the copyright message on Windows.
  git-gui: Update Swedish translation (521t).
  git-gui: ensure correct application termination in git-gui--askpass
  git-gui: handle textconv filter on Windows and in development
  git-gui: use shell to launch textconv filter in "blame"
  git-gui: display error launching blame as a message box.
  git-gui: Make usage statement visible on Windows.
2010-09-15 12:34:48 -07:00
Pat Thoyts 00e9de72c8 git-gui 0.13
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-09-14 22:42:37 +01:00
Pat Thoyts 2473543caa git-gui: avoid mis-encoding the copyright message on Windows.
On Windows the tcl script file will use the system encoding and attempting
to convert the copyright mis-encodes the string. Instead, keep the message
as ASCII and substitute in the correct unicode character when running.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-09-13 20:41:42 +01:00
Peter Krefting 421a31e22d git-gui: Update Swedish translation (521t).
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-09-13 19:25:55 +01:00
Brian Gernhardt 77f2e4f5f3 t7003: Use test_commit instead of custom function
t7003-filter-branch.sh had a make_commit() function that was identical
to test_commit() in test-lib.sh except that it used tr to create a
lowercase file name from the uppercase branch name instead of
appending ".t".

Not only is this unneeded code duplication, it also was something
simply waiting to fail on case-insensitive file systems.  So replace
all uses of make_commit with test_commit.

While we're editing the setup, chain it together with && so that
failures early in the sequence don't get lost and add a commit graph.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-13 10:59:06 -07:00
Junio C Hamano 5879b6bbca Merge branch 'maint'
* maint:
  t3101: modernise style
  compat/nedmalloc: don't force NDEBUG on the rest of git

Conflicts:
	Makefile
2010-09-12 13:53:03 -07:00
Junio C Hamano b294ed637d ls-tree $di $dir: do not mistakenly recurse into directories
When applying two pathspecs, one of which is named as a prefix to the
other, we mistakenly recursed into the shorter one.

Noticed and fixed by David Reis.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12 13:52:03 -07:00
Junio C Hamano e22148f406 t3101: modernise style
Also add a few " &&" cascade that were missing.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12 13:46:58 -07:00
Ramsay Jones 5418d96ddc vcs-svn: Fix some printf format compiler warnings
In particular, on systems that define uint32_t as an unsigned long,
gcc complains as follows:

      CC vcs-svn/fast_export.o
  vcs-svn/fast_export.c: In function `fast_export_modify':
  vcs-svn/fast_export.c:28: warning: unsigned int format, uint32_t arg (arg 2)
  vcs-svn/fast_export.c:28: warning: int format, uint32_t arg (arg 3)
  vcs-svn/fast_export.c: In function `fast_export_commit':
  vcs-svn/fast_export.c:42: warning: int format, uint32_t arg (arg 5)
  vcs-svn/fast_export.c:62: warning: int format, uint32_t arg (arg 2)
  vcs-svn/fast_export.c: In function `fast_export_blob':
  vcs-svn/fast_export.c:72: warning: int format, uint32_t arg (arg 2)
  vcs-svn/fast_export.c:72: warning: int format, uint32_t arg (arg 3)
      CC vcs-svn/svndump.o
  vcs-svn/svndump.c: In function `svndump_read':
  vcs-svn/svndump.c:260: warning: int format, uint32_t arg (arg 3)

In order to suppress the warnings we use the C99 format specifier
macros PRIo32 and PRIu32 from <inttypes.h>.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12 10:24:55 -07:00
René Scharfe d555ff5482 compat/nedmalloc: don't force NDEBUG on the rest of git
Define the nedmalloc feature configuration macros for nedmalloc.o, only.
This keeps assert(3) working for the rest of the git source; it was
turned off for nedmalloc users before by defining NDEBUG globally.

Also remove -DUSE_NED_ALLOCATOR as this macro isn't used anywhere.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-11 10:23:03 -07:00
Junio C Hamano 3b3a8ed4be Git 1.7.3 rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-10 11:55:55 -07:00
Junio C Hamano 5b45c55545 Merge branch 'np/relnotes-in-subdir'
* np/relnotes-in-subdir:
  install-webdoc: keep installed RelNotes-*.txt
  Documentation: move RelNotes into a directory of their own
2010-09-10 11:54:58 -07:00
Junio C Hamano 6070bac82a Prepare for 1.7.3 rc1 2010-09-10 11:54:34 -07:00
Junio C Hamano 9ab5a338fc Merge branch 'maint'
* maint:
  config.txt: fix placement of diff.noprefix
2010-09-10 09:39:08 -07:00
Mark Lodato 9904fadfea config.txt: fix placement of diff.noprefix
In git-config(1), diff.noprefix was placed in between
diff.mnemonicprefix and the list of mnemonic prefixes, which is
obviously incorrect and very confusing to readers.  Now, it is located
after the end of the explanation of mnemonicprefix, which makes much
more sense.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-10 09:31:13 -07:00
Brandon Casey 99f55ebc67 t/t4018: avoid two unnecessary sub-shell invocations
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-10 09:30:14 -07:00
Junio C Hamano 8ac8cf5bc1 Merge branch 'maint'
* maint:
  xdiff-interface.c: always trim trailing space from xfuncname matches
  diff.c: call regfree to free memory allocated by regcomp when necessary
2010-09-09 17:29:40 -07:00
Brandon Casey bff4206121 t/t4018: test whether the word_regex patterns compile
Previously (e3bf5e43), a test was added to test whether the builtin
xfuncname regular expressions could be compiled without error by regcomp.
Let's do the same for the word_regex patterns.  This should help catch any
cross-platform incompatibilities that exist between the pattern creator's
system and the various platforms that the test suite is commonly run on.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:19:18 -07:00
Brandon Casey 1b6ecbad35 xdiff-interface.c: always trim trailing space from xfuncname matches
Generally, trailing space is removed from the string matched by the
xfuncname patterns.  The exception is when the matched string exceeds the
length of the fixed-size buffer that it will be copied in to.  But, a
string that exceeds the buffer can still contain trailing space in the
portion of the string that will be copied into the buffer.  So, simplify
this code slightly, and just perform the trailing space removal always.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:18:29 -07:00
Brandon Casey ef5644ea6e diff.c: call regfree to free memory allocated by regcomp when necessary
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:18:04 -07:00
Brandon Casey 042cca3886 t/t5510-fetch.sh: improve testing with explicit URL and merge spec
Commit 6106ce46 introduced a test to demonstrate fetch's failure to
retrieve any objects or update FETCH_HEAD when it was supplied a repository
URL and the current branch had a configured merge spec.  This commit
expands the original test based on comments from Junio Hamano.  In addition
to actually verifying that the fetch updates FETCH_HEAD correctly, and does
not update the current branch, two more tests are added to ensure that the
merge configuration is ignored even when the supplied URL matches the URL
of the remote configured for the branch.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:16:08 -07:00
Brandon Casey f31dbdc7da builtin/fetch.c: comment that branch->remote_name is usable when has_merge
Save future readers the trouble of tracing code to determine that the two
uses of branch->remote_name are safe when has_merge is set, by adding a
comment explaining that it is so.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:15:58 -07:00
Brandon Casey a1d558d254 Makefile: use compat regex on IRIX 6.5
The IRIX 6.5 regex.h header file defines REG_STARTEND, but the feature does
not appear to work.  Since REG_STARTEND is required for proper functioning
of git-grep, set NO_REGEX and use the alternative regex libraries in compat/

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:11:06 -07:00
Brandon Casey f98548764e t/t7008: workaround broken handling of \000 by printf on IRIX
On IRIX 6.5, the printf utility in /usr/bin does not appear to handle the
\ddd notation according to POSIX.  This printf appears to halt processing
of the string argument and ignore any additional characters in the string.
Work around this flaw by replacing the \000's with 'Q' and using the
q_to_nul helper function provided by test-lib.sh

This problem with printf is not apparent when using the Bash shell since
Bash implements a POSIX compatible printf function internally.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:11:06 -07:00
Oded Shimon 5b220a6876 Add --src/dst-prefix to git-formt-patch in git-rebase.sh
For the case of "diff.noprefix" in git-config, git-format-patch should
still output diff with standard prefixes for git-am

Signed-off-by: Oded Shimon <ods15@ods15.dyndns.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:09:44 -07:00
Junio C Hamano 3a4e6c727f install-webdoc: keep installed RelNotes-*.txt
Otherwise URLs in the wild that point at older release notes will become
dangling.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 16:17:59 -07:00
Jens Lehmann fd3c32c981 t1020: Get rid of 'cd "$HERE"' at the start of each test
To achieve that, all cd commands which weren't inside a subshell had to
be put into a new one.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 16:03:11 -07:00
Jonathan Nieder a814615a6a t2016 (checkout -p): add missing &&
Although the set_state command is not likely to fail, it is best to
stay in the habit of checking for failures.

Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 16:02:47 -07:00
Jonathan Nieder 8fe5aeddcb t1302 (core.repositoryversion): style tweaks
This test is from 2007, which is late enough for the style to be
recognizably modern but still a while ago.  Freshen it up to
follow new best practices:

 - guard setup commands with test_expect_setup, so errors at
   that stage can be caught;
 - use <<\EOF in preference to <<EOF, to save reviewers the
   trouble of looking for variable interpolations;
 - use test_cmp instead of test "$foo" = "$bar", for better
   output with -v on failure;
 - indent commands in subshells and let them span multiple lines;
 - combine the two "gitdir required mode" tests that do not make
   as much sense alone.

Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 16:01:10 -07:00
Jonathan Nieder 76bbcd4382 t2105 (gitfile): add missing &&
Make sure early failures are not masked by later successes.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 15:58:45 -07:00
Jonathan Nieder dbedf8bf42 t1450 (fsck): remove dangling objects
The fsck test is generally careful to remove the corrupt objects
it inserts, but dangling objects are left behind due to some typos
and omissions.  It is better to clean up more completely, to
simplify the addition of later tests.  So:

 - guard setup and cleanup with test_expect_success to catch
   typos and errors;
 - check both stdout and stderr when checking for empty fsck
   output;
 - use test_cmp empty file in place of test $(wc -l <file) = 0,
   for better debugging output when running tests with -v;
 - add a remove_object () helper and use it to replace broken
   object removal code that forgot about the fanout in
   .git/objects;
 - disable gc.auto, to avoid tripping up object removal if the
   number of objects ever reaches that threshold.
 - use test_when_finished to ensure cleanup tasks are run and
   succeed when tests fail;
 - add a new final test that no breakage or dangling objects
   was left behind.

While at it, add a brief description to test_description of the
history that is expected to persist between tests.

Part of a campaign to clean up subshell usage in tests.

Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 15:58:32 -07:00
Jonathan Nieder 18a8269242 tests: subshell indentation stylefix
Format the subshells introduced by the previous patch (Several tests:
cd inside subshell instead of around, 2010-09-06) like so:

	(
		cd subdir &&
		...
	) &&

This is generally easier to read and has the nice side-effect that
this patch will show what commands are used in the subshell, making
it easier to check for lost environment variables and similar
behavior changes.

Cc: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 15:56:20 -07:00