1
0
mirror of https://github.com/git/git.git synced 2024-10-23 06:19:22 +02:00
Commit Graph

7035 Commits

Author SHA1 Message Date
Junio C Hamano
b88cb88158 Merge branch 'as/test-name-alias-uniquely' into maint
* as/test-name-alias-uniquely:
  Use longer alias names in subdirectory tests
2013-01-11 16:47:34 -08:00
Junio C Hamano
22fd1c8410 Merge branch 'ja/directory-attrs' into maint
The attribute mechanism didn't allow limiting attributes to be
applied to only a single directory itself with "path/" like the
exclude mechanism does.

* ja/directory-attrs:
  Add directory pattern matching to attributes
2013-01-11 16:46:46 -08:00
Junio C Hamano
c039f35b8a Merge branch 'jc/fetch-ignore-symref' into maint
"git fetch --mirror" and fetch that uses other forms of refspec with
wildcard used to attempt to update a symbolic ref that match the
wildcard on the receiving end, which made little sense (the real ref
that is pointed at by the symbolic ref would be updated anyway).

Symbolic refs no longer are affected by such a fetch.

* jc/fetch-ignore-symref:
  fetch: ignore wildcarded refspecs that update local symbolic refs
2013-01-11 16:45:44 -08:00
Junio C Hamano
3a0ee3eb2e Merge branch 'tb/test-t9810-no-sed-i' into maint
* tb/test-t9810-no-sed-i:
  t9810: Do not use sed -i
2013-01-10 14:10:40 -08:00
Junio C Hamano
1493bcc775 Merge branch 'tb/test-t9020-no-which' into maint
* tb/test-t9020-no-which:
  t9020: which is not portable
2013-01-10 14:10:36 -08:00
Junio C Hamano
74474a94f2 Merge branch 'sp/shortlog-missing-lf' into maint
* sp/shortlog-missing-lf:
  strbuf_add_wrapped*(): Remove unused return value
  shortlog: fix wrapping lines of wraplen
2013-01-10 14:04:23 -08:00
Junio C Hamano
c12a978a35 Merge branch 'nd/invalidate-i-t-a-cache-tree' into maint
* nd/invalidate-i-t-a-cache-tree:
  cache-tree: invalidate i-t-a paths after generating trees
  cache-tree: fix writing cache-tree when CE_REMOVE is present
  cache-tree: replace "for" loops in update_one with "while" loops
  cache-tree: remove dead i-t-a code in verify_cache()
2013-01-10 14:04:19 -08:00
René Scharfe
283b365e45 t1402: work around shell quoting issue on NetBSD
The test fails for me on NetBSD 6.0.1 and reports:

	ok 1 - ref name '' is invalid
	ok 2 - ref name '/' is invalid
	ok 3 - ref name '/' is invalid with options --allow-onelevel
	ok 4 - ref name '/' is invalid with options --normalize
	error: bug in the test script: not 2 or 3 parameters to test-expect-success

The alleged bug is in this line:

	invalid_ref NOT_MINGW '/' '--allow-onelevel --normalize'

invalid_ref() constructs a test case description using its last argument,
but the shell seems to split it up into two pieces if it contains a
space.  Minimal test case:

	# on NetBSD with /bin/sh
	$ a() { echo $#-$1-$2; }
	$ t="x"; a "${t:+$t}"
	1-x-
	$ t="x y"; a "${t:+$t}"
	2-x-y
	$ t="x y"; a "${t:+x y}"
	1-x y-

	# and with bash
	$ t="x y"; a "${t:+$t}"
	1-x y-
	$ t="x y"; a "${t:+x y}"
	1-x y-

This may be a bug in the shell, but here's a simple workaround: Construct
the description string first and store it in a variable, and then use
that to call test_expect_success().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-08 13:18:49 -08:00
Junio C Hamano
9e3d58a333 Merge branch 'jc/test-portability' into maint
* jc/test-portability:
  t9020: use configured Python to run the test helper
  t3600: Avoid "cp -a", which is a GNUism
2013-01-08 11:17:03 -08:00
Junio C Hamano
59932be344 Merge branch 'jc/test-cvs-no-init-in-existing-dir' into maint
* jc/test-cvs-no-init-in-existing-dir:
  t9200: let "cvs init" create the test repository
2013-01-08 11:16:56 -08:00
Junio C Hamano
ee18de62b5 Merge branch 'jc/maint-test-portability' into maint
* jc/maint-test-portability:
  t4014: fix arguments to grep
  t9502: do not assume GNU tar
  t0200: "locale" may not exist
2013-01-08 11:16:52 -08:00
Torsten Bögershausen
279791445b t9020: which is not portable
Use type instead

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-01 16:44:57 -08:00
Torsten Bögershausen
6f4e5059a0 t9810: Do not use sed -i
sed -i is not portable on all systems.  Use sed with different input
and output files.  Utilize a tmp file whenever needed.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-01 16:40:34 -08:00
Aaron Schrab
d16ece2011 Use longer alias names in subdirectory tests
When testing aliases in t/t1020-subdirectory.sh use longer names so that
they're less likely to conflict with a git-* command somewhere in the
$PATH.

I have a git-ss command in my path which prevents the 'ss' alias from
being used.  This command will always fail for git.git, causing the test
to fail.  Even if the command succeeded, that would be a false success
for the test since the alias wasn't actually used.  A longer, more
descriptive name will make it much less likely that somebody has a
command in their $PATH which will shadow the alias created for the test.

While here, use a longer name for the 'test' alias as well since that is
also short and meaningful enough to make it not unlikely that somebody
would have a command in their $PATH which will shadow that as well.

Signed-off-by: Aaron Schrab <aaron@schrab.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-28 15:11:48 -08:00
Junio C Hamano
8666df02da t9200: let "cvs init" create the test repository
Some platforms (e.g. NetBSD 6.0) seem to configure their CVS to
allow "cvs init" in an existing directory only to members of
"cvsadmin".

Instead of preparing an empty directory and then running "cvs init"
on it, let's run "cvs init" and let it create the necessary
directory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-24 17:42:07 -08:00
Junio C Hamano
5a02966685 t9020: use configured Python to run the test helper
The test helper svnrdump_sim.py is used as "svnrdump" during the
execution of this test, but the arrangement was not optimal:

 - it relied on symbolic links;
 - unportable "export VAR=VAL" was used;
 - GIT_BUILD_DIR variable was not quoted correctly;
 - it assumed that the Python interpreter is in /usr/bin/ and
   called "python" (i.e. not "python2.7" etc.)

Rework this by writing a small shell script that spawns the right
Python interpreter, using the right quoting.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-19 07:46:59 -08:00
Junio C Hamano
2d3ac9ad67 t3600: Avoid "cp -a", which is a GNUism
With d4a7ffa (tests: "cp -a" is a GNUism, 2012-10-08), we got rid of
most of them, but the ones in a topic that was still in flight were
missed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-19 07:46:44 -08:00
Junio C Hamano
ecd3e2f425 Merge branch 'jc/maint-test-portability' into 'jc/test-portability'
* jc/maint-test-portability:
  t4014: fix arguments to grep
  t9502: do not assume GNU tar
  t0200: "locale" may not exist
2012-12-19 07:46:05 -08:00
Junio C Hamano
27f6342f61 t4014: fix arguments to grep
These "expect-failure" tests were not looking for the right string
in the patch file.  For example:

	grep "^ *"S. E. Cipient" <scipient@example.com>\$" patch5

was looking for "^ *S." in these three files:

    "E."
    "Cipient <scipient@example.com>$"
    "patch5"

With some implementations of grep, the lack of file "E." was
reported as an error, leading to the failure of the test.

With other implementations of grep, the pattern "^ *S." matched what
was in patch5, without diagnosing the missing files as an error, and
made these tests unexpectedly pass.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-19 07:45:13 -08:00
Junio C Hamano
2060ed50e7 t9502: do not assume GNU tar
The check_snapshot function makes sure that no cruft outside the
repository hierarchy is added to the tar archive.  The output from
"tar tf" on the resulting archive is inspected to see if there is
anything that does not begin with "$prefix/".

There are two issues with this implementation:

 - Traditional tar implemenations that do not understand
   pax_global_header will write it out as if it is a plain file at
   the top-level;

 - Some implementations of tar do not add trailing slash when
   showing a directory entry (i.e. the output line for the entire
   archive will show "$prefix", not "$prefix/").

Fix them so that what we want to validate can be tested with
traditional tar implementations.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-19 07:44:29 -08:00
Junio C Hamano
7b90363099 t0200: "locale" may not exist
On systems without "locale" installed, t0200-gettext-basic.sh leaked
error messages when checking if some test locales are available.
Hide them, as they are not very useful.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-19 07:44:20 -08:00
Junio C Hamano
252f922b19 Merge branch 'maint'
* maint:
  t7004: do not create unneeded gpghome/gpg.conf when GPG is not used
2012-12-18 15:35:01 -08:00
Junio C Hamano
086cb91153 t7004: do not create unneeded gpghome/gpg.conf when GPG is not used
These tests themselves are properly protected by the GPG
prerequisite, but one of the set-up steps outside the
test_expect_success block unconditionally assumed that there is a
gpghome/ directory, which is not true if GPG is not being used.

It may be a good idea to move the whole set-up steps in the test but
that is a follow-up topic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-18 11:26:24 -08:00
Junio C Hamano
8e8c8817cd Merge branch 'jk/pickaxe-textconv' into maint
"git log -p -S<string>" now looks for the <string> after applying
the textconv filter (if defined); earlier it inspected the contents
of the blobs without filtering.
2012-12-18 10:50:07 -08:00
Jean-Noël AVILA
94bc671a1f Add directory pattern matching to attributes
The manpage of gitattributes says: "The rules how the pattern
matches paths are the same as in .gitignore files" and the gitignore
pattern matching has a pattern ending with / for directory matching.

This rule is specifically relevant for the 'export-ignore' rule used
for git archive.

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-17 22:07:23 -08:00
Nguyễn Thái Ngọc Duy
eec3e7e406 cache-tree: invalidate i-t-a paths after generating trees
Intent-to-add entries used to forbid writing trees so it was not a
problem. After commit 3f6d56d (commit: ignore intent-to-add entries
instead of refusing - 2012-02-07), we can generate trees from an index
with i-t-a entries.

However, the commit forgets to invalidate all paths leading to i-t-a
entries. With fully valid cache-tree (e.g. after commit or
write-tree), diff operations may prefer cache-tree to index and not
see i-t-a entries in the index, because cache-tree does not have them.

Reported-by: Jonathon Mah <me@JonathonMah.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-15 23:04:22 -08:00
Junio C Hamano
f8fb971eac fetch: ignore wildcarded refspecs that update local symbolic refs
In a repository cloned from somewhere else, you typically have a
symbolic ref refs/remotes/origin/HEAD pointing at the 'master'
remote-tracking ref that is next to it.  When fetching into such a
repository with "git fetch --mirror" from another repository that
was similarly cloned, the implied wildcard refspec refs/*:refs/*
will end up asking to update refs/remotes/origin/HEAD with the
object at refs/remotes/origin/HEAD at the remote side, while asking
to update refs/remotes/origin/master the same way.  Depending on the
order the two updates happen, the latter one would find that the
value of the ref before it is updated has changed from what the code
expects.

When the user asks to update the underlying ref via the symbolic ref
explicitly without using a wildcard refspec, e.g. "git fetch $there
refs/heads/master:refs/remotes/origin/HEAD", we should still let him
do so, but when expanding wildcard refs, it will result in a more
intuitive outcome if we simply ignore local symbolic refs.

As the purpose of the symbolic ref refs/remotes/origin/HEAD is to
follow the ref it points at (e.g. refs/remotes/origin/master), its
value would change when the underlying ref is updated.

Earlier commit da3efdb (receive-pack: detect aliased updates which
can occur with symrefs, 2010-04-19) fixed a similar issue for "git
push".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-11 14:53:32 -08:00
Steffen Prohaska
5b59708268 shortlog: fix wrapping lines of wraplen
A recent commit [1] fixed a off-by-one wrapping error.  As a
side-effect, the conditional in add_wrapped_shortlog_msg() to decide
whether to append a newline needs to be removed.  The function
should always append a newline, which was the case before the
off-by-one fix, because strbuf_add_wrapped_text() never returns a
value of wraplen; when it returns wraplen, the string does not end
with a newline, so this caller needs to add one anyway.

[1] 14e1a4e1ff70aff36db3f5d2a8b806efd0134d50 utf8: fix off-by-one
    wrapping of text

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-11 10:01:44 -08:00
Stefano Lattarini
dd6fc7ca91 Makefile: whitespace style fixes in macro definitions
Consistently use a single space before and after the "=" (or ":=", "+=",
etc.) in assignments to make macros.  Granted, this was not a big deal,
but I did find the needless inconsistency quite distracting.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-10 08:35:56 -08:00
Junio C Hamano
6a402843c2 Merge branch 'lt/diff-stat-show-0-lines' into maint
"git diff --stat" miscounted the total number of changed lines when
binary files were involved and hidden beyond --stat-count.  It also
miscounted the total number of changed files when there were
unmerged paths.

* lt/diff-stat-show-0-lines:
  t4049: refocus tests
  diff --shortstat: do not count "unmerged" entries
  diff --stat: do not count "unmerged" entries
  diff --stat: move the "total count" logic to the last loop
  diff --stat: use "file" temporary variable to refer to data->files[i]
  diff --stat: status of unmodified pair in diff-q is not zero
  test: add failing tests for "diff --stat" to t4049
  Fix "git diff --stat" for interesting - but empty - file changes
2012-12-07 14:10:17 -08:00
Junio C Hamano
7e2ef8b049 Merge branch 'rr/t4041-cleanup'
* rr/t4041-cleanup:
  t4041 (diff-submodule-option): modernize style
  t4041 (diff-submodule-option): rewrite add_file() routine
  t4041 (diff-submodule-option): parse digests sensibly
  t4041 (diff-submodule-option): don't hardcode SHA-1 in expected outputs
2012-12-07 10:31:19 -08:00
Ramkumar Ramachandra
a1549f9b85 t4041 (diff-submodule-option): modernize style
- Enclose tests in single quotes as opposed to double quotes.  This is
  the prevalent style in other tests.
- Remove the unused variable $head4_full.
- Indent the expected output so that it lines up with the rest of the
  test text.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-02 02:02:15 -08:00
Ramkumar Ramachandra
2934975f2d t4041 (diff-submodule-option): rewrite add_file() routine
Instead of "cd there and then come back", use the "cd there in a
subshell" pattern.  Also fix '&&' chaining in one place.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-02 02:02:05 -08:00
Ramkumar Ramachandra
20fa53855e t4041 (diff-submodule-option): parse digests sensibly
`git rev-list --max-count=1 HEAD` is a roundabout way of saying `git
rev-parse --verify HEAD`; replace a bunch of instances of the former
with the latter.  Also, don't unnecessarily `cut -c1-7` the rev-parse
output when the `--short` option is available.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-02 01:58:40 -08:00
Junio C Hamano
15470c604d Merge branch 'pw/p4-various-fixes'
* pw/p4-various-fixes:
  git p4: remove unneeded cmd initialization
  git p4: fix labelDetails typo in exception
  git p4 test: display unresolvable host error
  git p4: catch p4 errors when streaming file contents
  git p4: handle servers without move support
  git p4: catch p4 describe errors
2012-11-29 13:44:28 -08:00
Junio C Hamano
a4eab8f38e Merge branch 'lt/diff-stat-show-0-lines'
"git diff --stat" miscounted the total number of changed lines when
binary files were involved and hidden beyond --stat-count.  It also
miscounted the total number of changed files when there were
unmerged paths.

* lt/diff-stat-show-0-lines:
  t4049: refocus tests
  diff --shortstat: do not count "unmerged" entries
  diff --stat: do not count "unmerged" entries
  diff --stat: move the "total count" logic to the last loop
  diff --stat: use "file" temporary variable to refer to data->files[i]
  diff --stat: status of unmodified pair in diff-q is not zero
  test: add failing tests for "diff --stat" to t4049
2012-11-29 12:53:54 -08:00
Junio C Hamano
545492f078 Merge branch 'fc/remote-hg'
New remote helper for hg.

* fc/remote-hg: (22 commits)
  remote-hg: fix for older versions of python
  remote-hg: fix for files with spaces
  remote-hg: avoid bad refs
  remote-hg: try the 'tip' if no checkout present
  remote-hg: fix compatibility with older versions of hg
  remote-hg: add missing config for basic tests
  remote-hg: the author email can be null
  remote-hg: add option to not track branches
  remote-hg: add extra author test
  remote-hg: add tests to compare with hg-git
  remote-hg: add bidirectional tests
  test-lib: avoid full path to store test results
  remote-hg: add basic tests
  remote-hg: fake bookmark when there's none
  remote-hg: add compat for hg-git author fixes
  remote-hg: add support for hg-git compat mode
  remote-hg: match hg merge behavior
  remote-hg: make sure the encoding is correct
  remote-hg: add support to push URLs
  remote-hg: add support for remote pushing
  ...
2012-11-29 12:53:50 -08:00
Junio C Hamano
16e6e7284f Merge branch 'jk/send-email-sender-prompt'
General clean-ups in various areas, originally written to support a
patch that later turned out to be unneeded.

* jk/send-email-sender-prompt:
  t9001: check send-email behavior with implicit sender
  t: add tests for "git var"
  ident: keep separate "explicit" flags for author and committer
  ident: make user_ident_explicitly_given static
  t7502: factor out autoident prerequisite
  test-lib: allow negation of prerequisites
2012-11-29 12:52:45 -08:00
Junio C Hamano
175bd3b0d0 Merge branch 'fc/send-email-no-sender-prompt'
* fc/send-email-no-sender-prompt:
  send-email: avoid questions when user has an ident
2012-11-29 12:52:42 -08:00
Junio C Hamano
276d709305 Merge branch 'jl/submodule-rm'
Finishing touches to "git rm $submodule" that removes the working
tree of a submodule.

* jl/submodule-rm:
  Teach rm to remove submodules when given with a trailing '/'
2012-11-29 12:52:30 -08:00
Junio C Hamano
1cab289026 Merge branch 'fc/completion-test-simplification'
Clean up completion tests.  Use of conslidated helper may make
instrumenting one particular test during debugging of the test
itself, but I think that issue should be addressed in some other
way (e.g. making sure individual tests in 9902 can be skipped).

* fc/completion-test-simplification:
  completion: simplify __gitcomp() test helper
  completion: refactor __gitcomp related tests
  completion: consolidate test_completion*() tests
  completion: simplify tests using test_completion_long()
  completion: standardize final space marker in tests
  completion: add comment for test_completion()
2012-11-29 12:52:10 -08:00
Junio C Hamano
de9095955c t4049: refocus tests
The primary thing Linus's patch wanted to change was to make sure
that 0-line change appears for a mode-only change.  Update the
first test to chmod a file that we can see in the output (limited
by --stat-count) to demonstrate it.  Also make sure to use test_chmod
and compare the index and the tree, so that we can run this test
even on a filesystem without permission bits.

Later two tests are about fixes to separate issues that were
introduced and/or uncovered by Linus's patch as a side effect, but
the issues are not related to mode-only changes.  Remove chmod from
the tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-29 09:46:30 -08:00
Junio C Hamano
b893e88191 Merge branch 'mm/status-push-pull-advise'
* mm/status-push-pull-advise:
  status: add advice on how to push/pull to tracking branch
2012-11-28 13:42:30 -08:00
Junio C Hamano
682098b847 Merge branch 'jk/pickaxe-textconv'
Use textconv filters when searching with "log -S".

* jk/pickaxe-textconv:
  pickaxe: use textconv for -S counting
  pickaxe: hoist empty needle check
2012-11-28 13:42:25 -08:00
Jeff King
59defcc368 t9001: check send-email behavior with implicit sender
We allow send-email to use an implicitly-defined identity
for the sender (because there is still a confirmation step),
but we abort when we cannot generate such an identity. Let's
make sure that we test this.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-28 12:23:24 -08:00
Junio C Hamano
2a7f6ffb91 Merge branch 'pw/maint-p4-rcs-expansion-newline' into maint
"git p4" used to try expanding malformed "$keyword$" that spans
across multiple lines.

* pw/maint-p4-rcs-expansion-newline:
  git p4: RCS expansion should not span newlines
2012-11-28 12:04:50 -08:00
Junio C Hamano
3b16b3702a Merge branch 'fc/send-email-no-sender-prompt' into jk/send-email-sender-prompt
* fc/send-email-no-sender-prompt:
  send-email: avoid questions when user has an ident
2012-11-28 10:50:20 -08:00
Jeff King
879ed75393 t: add tests for "git var"
We do not currently have any explicit tests for "git var" at
all (though we do exercise it to some degree as a part of
other tests). Let's add a few basic sanity checks.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-28 10:49:13 -08:00
Junio C Hamano
ed20513c8d Merge branch 'jh/update-ref-d-through-symref' into maint
* jh/update-ref-d-through-symref:
  Fix failure to delete a packed ref through a symref
  t1400-update-ref: Add test verifying bug with symrefs in delete_ref()
2012-11-27 13:28:45 -08:00
Junio C Hamano
82dfc2c44e diff --stat: do not count "unmerged" entries
Even though we show a separate *UNMERGED* entry in the patch and
diffstat output (or in the --raw format, for that matter) in
addition to and separately from the diff against the specified stage
(defaulting to #2) for unmerged paths, they should not be counted in
the total number of files affected---that would lead to counting the
same path twice.

The separation done by the previous step makes this fix simple and
straightforward.  Among the filepairs in diff_queue, paths that
weren't modified, and the extra "unmerged" entries do not count as
total number of files.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-27 13:21:15 -08:00