Commit graph

36853 commits

Author SHA1 Message Date
Cezary Zawadka c2369bdf7f Windows: allow using UNC path for git repository
[efl: moved MinGW-specific part to compat/]
[jes: fixed compilation on non-Windows]

Eric Sunshine fixed mingw_offset_1st_component() to return
consistently "foo" for UNC "//machine/share/foo", cf

http://groups.google.com/group/msysgit/browse_thread/thread/c0af578549b5dda0

Author: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Cezary Zawadka <czawadka@gmail.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10 13:30:04 -07:00
Michael S. Tsirkin 8f2514e95f patch-id-test: test stable and unstable behaviour
Verify that patch ID supports an algorithm
that is stable against diff split and reordering.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10 13:09:39 -07:00
Michael S. Tsirkin 30e12b924b patch-id: make it stable against hunk reordering
Patch id changes if users reorder file diffs that make up a patch.

As the result is functionally equivalent, a different patch id is
surprising to many users.
In particular, reordering files using diff -O is helpful to make patches
more readable (e.g. API header diff before implementation diff).

Add an option to change patch-id behaviour making it stable against
these kinds of patch change:
calculate SHA1 hash for each hunk separately and sum all hashes
(using a symmetrical sum) to get patch id

We use a 20byte sum and not xor - since xor would give 0 output
for patches that have two identical diffs, which isn't all that
unlikely (e.g. append the same line in two places).

The new behaviour is enabled
- when patchid.stable is true
- when --stable flag is present

Using a new flag --unstable or setting patchid.stable to false force
the historical behaviour.

In the documentation, clarify that patch ID can now be a sum of hashes,
not a hash.
Document how command line and config options affect the
behaviour.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10 13:09:24 -07:00
Jonathan Nieder bb98b01ee8 test doc: test_write_lines does not split its arguments
test_write_lines carefully quotes its arguments as "$@", so

	test_write_lines "a b" c

writes two lines as requested, not three.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10 13:09:05 -07:00
Michael S. Tsirkin ac9afcc31c test: add test_write_lines helper
API and implementation as suggested by Junio.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10 13:09:00 -07:00
Torsten Bögershausen 35ec002cf7 t9001: avoid non-portable '\n' with sed
t9001 used a '\n' in a sed expression to split one line into two
lines, but the usage of '\n' in the "replacement string" is not
portable.

The '\n' can be used to match a newline in the "pattern space",
but otherwise the meaning of '\n' is unspecified in POSIX.

- Gnu versions of sed will treat '\n' as a newline character.
- Other versions of sed (like /usr/bin/sed under Mac OS X)
  simply ignore the '\' before the 'n', treating '\n' as 'n'.

For reference see:
pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
http://www.gnu.org/software/sed/manual/sed.html

As the test already requires perl as a prerequisite, use perl
instead of sed.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10 08:39:06 -07:00
Fabian Ruch 43dee070eb sequencer: signal failed ff as an aborted, not a conflicted merge
`do_pick_commit` handles three situations if it is not fast-forwarding.
In order for `do_pick_commit` to identify the situation, it examines the
return value of the selected merge command.

1. return value 0 stands for a clean merge
2. 1 is passed in case of a failed merge due to conflict
3. any other return value means that the merge did not even start

So far, the sequencer returns 1 in case of a failed fast-forward, which
would mean "failed merge due to conflict". However, a fast-forward
either starts and succeeds or does not start at all. In particular, it
cannot fail in between like a merge with a dirty index due to conflicts.

In order to signal the three possible situations (not only success and
failure to complete) after a pick through porcelain commands such as
`cherry-pick`, exit with a return value that is neither 0 nor 1. 128 was
chosen in line with the other situations in which the sequencer
encounters an error. In such situations, the sequencer returns a
negative value and `cherry-pick` translates this into a call to `die`.
`die` then terminates the process with exit status 128.

Signed-off-by: Fabian Ruch <bafain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:55:43 -07:00
Jeremiah Mahler 97ea0d1043 api-strbuf.txt minor typos
Fixed some minor typos in api-strbuf.txt: 'A' instead of 'An', 'have'
instead of 'has', a overlong line, and 'another' instead of 'an other'.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:54:52 -07:00
Junio C Hamano e3fa568cb3 revision: parse "git log -<count>" more carefully
This mistyped command line simply ignores "master" and ends up
showing two commits from the current HEAD:

    $ git log -2master

because we feed "2master" to atoi() without making sure that the
whole string is parsed as an integer.

Use the strtol_i() helper function instead.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:53:49 -07:00
René Scharfe 50e19a8358 Use starts_with() for C strings instead of memcmp()
Convert three cases of checking for a constant prefix using memcmp() to
starts_with().  This way there is no need for magic string length
constants and we avoid running over the end of the string should it be
shorter than the prefix.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:38:12 -07:00
Junio C Hamano b687cd6aba t3419: drop unnecessary NOT_EXPENSIVE pseudo-prerequisite
This was only necessary because do_tests helper the script defines
took its parameters in a wrong order.  Just pass an empty string (or
not passing the optional EXPENSIVE prerequisite) when running the
test with a light-weight set of parameters and have the shell do the
right thing when parsing test_expect_success helper.

Also update coding style while we are at it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:18:55 -07:00
Junio C Hamano 19c8c4a9b7 t3302: drop unnecessary NOT_EXPENSIVE pseudo-prerequisite
This was only necessary because do_tests helper the script defines
took its parameters in a wrong order.  Just pass an empty string (or
not passing the optional EXPENSIVE prerequisite) when running the
test with a light-weight set of parameters and have the shell do the
right thing when parsing test_expect_success helper.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:18:55 -07:00
Junio C Hamano f23b1d06e5 t3302: do not chdir around in the primary test process
These days^Wyears we strive to do stuff in subdirectories inside
subshells to avoid mistakes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:18:55 -07:00
Junio C Hamano ac2803b962 t3302: coding style updates
Use "<<-END_OF_HERE_TEXT" to push the contents of here-text to the
right in order to show the loop structure better.

Use write_script when writing a script to be run.

Use "test" (not "[ ... ]") and avoid unnecessary ";" in the middle
of a line.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:18:55 -07:00
Junio C Hamano e1ecd9e3c8 test: turn USR_BIN_TIME into a lazy prerequisite
Two test scripts (t3302 and t3419) had copy & paste code to set
USR_BIN_TIME prerequisite.  Use the test_lazy_prereq helper to define
them in the common t/test-lib.sh.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:18:55 -07:00
Junio C Hamano 6219bb22ba test: turn EXPENSIVE into a lazy prerequisite
Two test scripts (t0021 and t5551) had copy & paste code to set
EXPENSIVE prerequisite.  Use the test_lazy_prereq helper to define
them in the common t/test-lib.sh.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 14:18:55 -07:00
Torsten Bögershausen 9e10e0b9a0 t5551: fix the 50,000 tag test
The first version of test 23 did simply check that no output was
sent to the standard error stream.  With 5e2c7cd2 (t5551: do not use
unportable sed '\+', 2013-05-12), we started to also verify that the
expected tags were actually cloned.

Since 68b939b2 (clone: send diagnostic messages to stderr,
2013-09-18), "git clone" shows "Cloning into 'too-many-refs'" to the
standard error stream (it used to do so to the standard output),
causing the test to fail.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 12:06:12 -07:00
Junio C Hamano 50f84e34a1 Update draft release notes to 2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09 11:39:43 -07:00
Junio C Hamano 07768e03b5 Merge branch 'jc/shortlog-ref-exclude'
"log --exclude=<glob> --all | shortlog" worked as expected, but
"shortlog --exclude=<glob> --all" was not accepted at the command
line argument parser level.

* jc/shortlog-ref-exclude:
  shortlog: allow --exclude=<glob> to be passed
2014-06-09 11:30:13 -07:00
Junio C Hamano 251cb96eab Merge branch 'mn/sideband-no-ansi'
Tools that read diagnostic output in our standard error stream do
not want to see terminal control sequence (e.g. erase-to-eol).
Detect them by checking if the standard error stream is connected to
a tty.

* mn/sideband-no-ansi:
  sideband.c: do not use ANSI control sequence on non-terminal
2014-06-09 11:27:56 -07:00
Junio C Hamano d37e8c54a6 Merge branch 'rs/mailinfo-header-cmp'
Avoid running over the end of header string while parsing an
incoming e-mail message to extract the patch.

* rs/mailinfo-header-cmp:
  mailinfo: use strcmp() for string comparison
2014-06-09 11:27:53 -07:00
Junio C Hamano 53b4d8387b Merge branch 'pb/trim-trailing-spaces'
Fix an error in parsing of .gitignore files that use a trailing
"\ " to mark pathnames that end with a SP.

* pb/trim-trailing-spaces:
  dir.c:trim_trailing_spaces(): fix for " \ " sequence
2014-06-09 11:27:47 -07:00
Junio C Hamano 0908b6dfc3 Merge branch 'na/no-http-test-in-the-middle'
The mode to run tests with HTTP server tests disabled was broken.

* na/no-http-test-in-the-middle:
  t5538: move http push tests out to t5542
2014-06-09 11:26:51 -07:00
Junio C Hamano 0147602c2b Merge branch 'jc/rev-parse-argh-dashed-multi-words'
"update-index --cacheinfo" in 2.0 crashes on a malformed command line.

* jc/rev-parse-argh-dashed-multi-words:
  update-index: fix segfault with missing --cacheinfo argument
2014-06-09 11:26:49 -07:00
Junio C Hamano bfbdfa33f6 Merge branch 'lt/request-pull'
A brown-paper-bag bugfix to a test that turned out to be a no-op by
mistake.

* lt/request-pull:
  fix brown paper bag breakage in t5150-request-pull.sh
2014-06-09 11:26:23 -07:00
Tanay Abhra acb3d22264 string-list: spell all values out that are given to a string_list initializer
STRING_LIST_INIT_{NODUP,DUP} initializers list values only
for earlier structure members, relying on the usual
convention in C that the omitted members are initailized to
0, i.e. the former is expanded to the latter:

	struct string_list l = STRING_LIST_INIT_DUP;
	struct string_list l = { NULL, 0, 0, 1 };

and the last member that is not mentioned (i.e. 'cmp') is
initialized to NULL.

While there is nothing wrong in this construct, spelling out
all the values where the macros are defined will serve also
as a documentation, so let's do so.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-06 13:49:19 -07:00
Ramsay Jones 7e28c16fdb t0000-*.sh: fix the GIT_SKIP_TESTS sub-tests
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-06 13:48:00 -07:00
Ilya Bobyr 0445e6f0a1 test-lib: '--run' to run only specific tests
Allow better control of the set of tests that will be executed for a
single test suite.  Mostly useful while debugging or developing as it
allows to focus on a specific test.

Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-06 13:48:00 -07:00
Ilya Bobyr ef2ac68def test-lib: tests skipped by GIT_SKIP_TESTS say so
We used to show "(missing )" next to tests skipped because they are
specified in GIT_SKIP_TESTS.  Use "(GIT_SKIP_TESTS)" instead.

Plus tests that check basic GIT_SKIP_TESTS functions.

Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-06 13:48:00 -07:00
Ilya Bobyr 5e3b4fce42 test-lib: document short options in t/README
Most arguments that could be provided to a test have short forms.
Unless documented, the only way to learn them is to read the code.

Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-06 13:47:54 -07:00
Junio C Hamano 0953113bb5 Second batch for 2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-06 11:42:05 -07:00
Junio C Hamano 75866e6045 Merge branch 'ss/howto-manage-trunk'
* ss/howto-manage-trunk:
  How to keep a project's canonical history correct.
2014-06-06 11:39:12 -07:00
Junio C Hamano eb5398a891 Merge branch 'mc/git-p4-prepare-p4-only'
* mc/git-p4-prepare-p4-only:
  git-p4: Do not include diff in spec file when just preparing p4
2014-06-06 11:38:57 -07:00
Junio C Hamano 3784ba310f Merge branch 'jn/test-lint-unmoor'
* jn/test-lint-unmoor:
  test-lint: find unportable sed, echo, test, and export usage after &&
2014-06-06 11:38:54 -07:00
Junio C Hamano 3ea8ecc21e Merge branch 'ep/shell-assign-and-export-vars'
* ep/shell-assign-and-export-vars:
  scripts: more "export VAR=VALUE" fixes
  scripts: "export VAR=VALUE" construct is not portable
2014-06-06 11:38:51 -07:00
Junio C Hamano ed47bbd1d0 Merge branch 'jj/command-line-adjective'
* jj/command-line-adjective:
  Documentation: use "command-line" when used as a compound adjective, and fix other minor grammatical issues
2014-06-06 11:38:48 -07:00
Junio C Hamano aa4bffa235 Merge branch 'jc/coding-guidelines'
* jc/coding-guidelines:
  CodingGuidelines: avoid "test <cond> -a/-o <cond>"
  CodingGuidelines: on splitting a long line
  CodingGuidelines: on comparison
  CodingGuidelines: do not call the conditional statement "if()"
  CodingGuidelines: give an example for shell function preamble
  CodingGuidelines: give an example for control statements
  CodingGuidelines: give an example for redirection
  CodingGuidelines: give an example for case/esac statement
  CodingGuidelines: once it is in, it is not worth the code churn
2014-06-06 11:38:45 -07:00
Junio C Hamano 1e2600dd6a Merge branch 'nd/status-auto-comment-char'
* nd/status-auto-comment-char:
  commit: allow core.commentChar=auto for character auto selection
  config: be strict on core.commentChar
2014-06-06 11:36:10 -07:00
Junio C Hamano 0756529537 Merge branch 'mt/rebase-i-keep-empty-test'
* mt/rebase-i-keep-empty-test:
  rebase --keep-empty -i: add test
2014-06-06 11:36:06 -07:00
Junio C Hamano e7cc0ede18 Merge branch 'mk/show-s-no-extra-blank-line-for-merges'
* mk/show-s-no-extra-blank-line-for-merges:
  git-show: fix 'git show -s' to not add extra terminator after merge commit
2014-06-06 11:35:02 -07:00
Junio C Hamano 7e03f41663 Merge branch 'sk/spawn-less-case-insensitively-from-grep-O-i'
* sk/spawn-less-case-insensitively-from-grep-O-i:
  git grep -O -i: if the pager is 'less', pass the '-I' option
2014-06-06 11:32:49 -07:00
Junio C Hamano 7173ad76ed Merge branch 'jd/subtree'
* jd/subtree:
  contrib/subtree: allow adding an annotated tag
  contrib/subtree/Makefile: clean up rule for "clean"
  contrib/subtree/Makefile: clean up rules to generate documentation
  contrib/subtree/Makefile: s/libexecdir/gitexecdir/
  contrib/subtree/Makefile: use GIT-VERSION-FILE
  contrib/subtree/Makefile: scrap unused $(gitdir)
2014-06-06 11:32:21 -07:00
Junio C Hamano c8704ad335 Merge branch 'wk/doc-clarify-upstream'
* wk/doc-clarify-upstream:
  Documentation: mention config sources for @{upstream}
2014-06-06 11:32:14 -07:00
Junio C Hamano 334d40e951 Merge branch 'tb/unicode-6.3-zero-width'
Update the logic to compute the display width needed for utf8
strings and allow us to more easily maintain the tables used in
that logic.

We may want to let the users choose if codepoints with ambiguous
widths are treated as a double or single width in a follow-up patch.

* tb/unicode-6.3-zero-width:
  utf8: make it easier to auto-update git_wcwidth()
  utf8.c: use a table for double_width
2014-06-06 11:29:38 -07:00
Junio C Hamano a0460132a7 Merge branch 'jk/index-pack-report-missing'
* jk/index-pack-report-missing:
  index-pack: distinguish missing objects from type errors
2014-06-06 11:28:13 -07:00
Junio C Hamano e934c67b66 Merge branch 'bc/blame-crlf-test'
If a file contained CRLF line endings in a repository with
core.autocrlf=input, then blame always marked lines as "Not
Committed Yet", even if they were unmodified.

* bc/blame-crlf-test:
  blame: correctly handle files regardless of autocrlf
2014-06-06 11:26:50 -07:00
Junio C Hamano ee8213951a Merge branch 'sk/submodules-absolute-path-on-windows'
* sk/submodules-absolute-path-on-windows:
  Revert "submodules: fix ambiguous absolute paths under Windows"
2014-06-06 11:26:38 -07:00
Junio C Hamano c7be99ea51 Merge branch 'dk/blame-reorg'
"git blame" has been optimized greatly by reorganising the data
structure that is used to keep track of the work to be done, thanks
to David Karstrup <dak@gnu.org>.

* dk/blame-reorg:
  blame: large-scale performance rewrite
2014-06-06 11:24:44 -07:00
Junio C Hamano ff0b8753a1 Merge branch 'wg/svn-fe-style-fixes'
* wg/svn-fe-style-fixes:
  svn-fe: conform to pep8
2014-06-06 11:24:32 -07:00
Junio C Hamano e318b83511 Merge branch 'jn/contrib-remove-vim'
Spring cleaning of contrib/.

* jn/contrib-remove-vim:
  contrib: remove vim support instructions
2014-06-06 11:24:30 -07:00