OSDN Git Service

git-core/git.git
10 years agoMerge branch 'sk/mingw-uni-fix'
Junio C Hamano [Mon, 21 Jul 2014 18:18:50 +0000 (11:18 -0700)]
Merge branch 'sk/mingw-uni-fix'

* sk/mingw-uni-fix:
  Win32: Unicode file name support (dirent)
  Win32: Unicode file name support (except dirent)

10 years agoMerge branch 'ek/alt-odb-entry-fix'
Junio C Hamano [Mon, 21 Jul 2014 18:18:46 +0000 (11:18 -0700)]
Merge branch 'ek/alt-odb-entry-fix'

* ek/alt-odb-entry-fix:
  sha1_file: do not add own object directory as alternate

10 years agoMerge branch 'kb/hashmap-updates'
Junio C Hamano [Mon, 21 Jul 2014 18:18:44 +0000 (11:18 -0700)]
Merge branch 'kb/hashmap-updates'

* kb/hashmap-updates:
  hashmap: add string interning API
  hashmap: add simplified hashmap_get_from_hash() API
  hashmap: improve struct hashmap member documentation
  hashmap: factor out getting a hash code from a SHA1

10 years agoMerge branch 'jk/remote-curl-squelch-extra-errors'
Junio C Hamano [Mon, 21 Jul 2014 18:18:40 +0000 (11:18 -0700)]
Merge branch 'jk/remote-curl-squelch-extra-errors'

* jk/remote-curl-squelch-extra-errors:
  remote-curl: mark helper-protocol errors more clearly
  remote-curl: use error instead of fprintf(stderr)
  remote-curl: do not complain on EOF from parent git

10 years agoMerge branch 'rs/ref-transaction-0'
Junio C Hamano [Mon, 21 Jul 2014 18:18:37 +0000 (11:18 -0700)]
Merge branch 'rs/ref-transaction-0'

Early part of the "ref transaction" topic.

* rs/ref-transaction-0:
  refs.c: change ref_transaction_update() to do error checking and return status
  refs.c: remove the onerr argument to ref_transaction_commit
  update-ref: use err argument to get error from ref_transaction_commit
  refs.c: make update_ref_write update a strbuf on failure
  refs.c: make ref_update_reject_duplicates take a strbuf argument for errors
  refs.c: log_ref_write should try to return meaningful errno
  refs.c: make resolve_ref_unsafe set errno to something meaningful on error
  refs.c: commit_packed_refs to return a meaningful errno on failure
  refs.c: make remove_empty_directories always set errno to something sane
  refs.c: verify_lock should set errno to something meaningful
  refs.c: make sure log_ref_setup returns a meaningful errno
  refs.c: add an err argument to repack_without_refs
  lockfile.c: make lock_file return a meaningful errno on failurei
  lockfile.c: add a new public function unable_to_lock_message
  refs.c: add a strbuf argument to ref_transaction_commit for error logging
  refs.c: allow passing NULL to ref_transaction_free
  refs.c: constify the sha arguments for ref_transaction_create|delete|update
  refs.c: ref_transaction_commit should not free the transaction
  refs.c: remove ref_transaction_rollback

10 years agoMerge branch 'jl/submodule-tests'
Junio C Hamano [Mon, 21 Jul 2014 18:18:30 +0000 (11:18 -0700)]
Merge branch 'jl/submodule-tests'

* jl/submodule-tests:
  revert: add t3513 for submodule updates
  stash: add t3906 for submodule updates
  am: add t4255 for submodule updates
  cherry-pick: add t3512 for submodule updates
  pull: add t5572 for submodule updates
  rebase: add t3426 for submodule updates
  merge: add t7613 for submodule updates
  bisect: add t6041 for submodule updates
  reset: add t7112 for submodule updates
  read-tree: add t1013 for submodule updates
  apply: add t4137 for submodule updates
  checkout: call the new submodule update test framework
  submodules: add the lib-submodule-update.sh test library
  test-lib: add test_dir_is_empty()

10 years agoMerge branch 'ak/profile-feedback-build'
Junio C Hamano [Mon, 21 Jul 2014 18:17:47 +0000 (11:17 -0700)]
Merge branch 'ak/profile-feedback-build'

* ak/profile-feedback-build:
  Fix profile feedback with -jN and add profile-fast
  Run the perf test suite for profile feedback too
  Don't define away __attribute__ on gcc
  Use BASIC_FLAGS for profile feedback

10 years agoMerge branch 'cc/for-each-mergetag'
Junio C Hamano [Mon, 21 Jul 2014 18:17:45 +0000 (11:17 -0700)]
Merge branch 'cc/for-each-mergetag'

* cc/for-each-mergetag:
  commit: add for_each_mergetag()

10 years agoFix contrib/subtree Makefile to patch #! line
Charles Bailey [Sat, 19 Jul 2014 16:08:57 +0000 (17:08 +0100)]
Fix contrib/subtree Makefile to patch #! line

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years ago.mailmap: map different names with the same email address together
Stefan Beller [Thu, 10 Jul 2014 12:48:26 +0000 (14:48 +0200)]
.mailmap: map different names with the same email address together

Pretty much one year ago (94b410bba864, Jul 12 2013, .mailmap: Map
email addresses to names) I cleaned up the output of `git shortlog
-sne` of git.git by writing a .mailmap file fot the git.git project.

During the year Jens, Kazuki and Trần contributed to git.git using
different names, but the same email address; unify them.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoSync with 2.0.2
Junio C Hamano [Wed, 16 Jul 2014 18:48:16 +0000 (11:48 -0700)]
Sync with 2.0.2

* maint:
  Git 2.0.2
  annotate: use argv_array

10 years agoEighth batch for 2.1
Junio C Hamano [Wed, 16 Jul 2014 18:47:32 +0000 (11:47 -0700)]
Eighth batch for 2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'ah/fix-http-push'
Junio C Hamano [Wed, 16 Jul 2014 18:33:11 +0000 (11:33 -0700)]
Merge branch 'ah/fix-http-push'

An ancient rewrite passed a wrong pointer to a curl library
function in a rarely used code path.

* ah/fix-http-push:
  http-push.c: make CURLOPT_IOCTLDATA a usable pointer

10 years agoMerge branch 'rs/code-cleaning'
Junio C Hamano [Wed, 16 Jul 2014 18:33:09 +0000 (11:33 -0700)]
Merge branch 'rs/code-cleaning'

* rs/code-cleaning:
  fsck: simplify fsck_commit_buffer() by using commit_list_count()
  commit: use commit_list_append() instead of duplicating its code
  merge: simplify merge_trivial() by using commit_list_append()
  use strbuf_addch for adding single characters
  use strbuf_addbuf for adding strbufs

10 years agoMerge branch 'jk/skip-prefix'
Junio C Hamano [Wed, 16 Jul 2014 18:33:06 +0000 (11:33 -0700)]
Merge branch 'jk/skip-prefix'

One more to an already graduated topic.

* jk/skip-prefix:
  tag: use skip_prefix instead of magic numbers

10 years agoMerge branch 'po/error-message-style'
Junio C Hamano [Wed, 16 Jul 2014 18:33:03 +0000 (11:33 -0700)]
Merge branch 'po/error-message-style'

* po/error-message-style:
  doc: give some guidelines for error messages

10 years agoMerge branch 'jl/test-lint-scripts'
Junio C Hamano [Wed, 16 Jul 2014 18:33:01 +0000 (11:33 -0700)]
Merge branch 'jl/test-lint-scripts'

* jl/test-lint-scripts:
  t/Makefile: always test all lint targets when running tests
  t/Makefile: check helper scripts for non-portable shell commands too

10 years agoMerge branch 'zk/log-graph-showsig'
Junio C Hamano [Wed, 16 Jul 2014 18:32:57 +0000 (11:32 -0700)]
Merge branch 'zk/log-graph-showsig'

The "--show-signature" option did not pay much attention to
"--graph".

* zk/log-graph-showsig:
  log: fix indentation for --graph --show-signature

10 years agoMerge branch 'mg/fix-log-mergetag-color'
Junio C Hamano [Wed, 16 Jul 2014 18:32:36 +0000 (11:32 -0700)]
Merge branch 'mg/fix-log-mergetag-color'

* mg/fix-log-mergetag-color:
  log: correctly identify mergetag signature verification status

10 years agoMerge branch 'kb/path-max-must-go'
Junio C Hamano [Wed, 16 Jul 2014 18:32:33 +0000 (11:32 -0700)]
Merge branch 'kb/path-max-must-go'

* kb/path-max-must-go:
  cache.h: rename cache_def_free to cache_def_clear

10 years agoMerge branch 'cb/filter-branch-prune-empty-degenerate-merges'
Junio C Hamano [Wed, 16 Jul 2014 18:29:06 +0000 (11:29 -0700)]
Merge branch 'cb/filter-branch-prune-empty-degenerate-merges'

"filter-branch" left an empty single-parent commit that results when
all parents of a merge commit gets mapped to the same commit, even
under "--prune-empty".

* cb/filter-branch-prune-empty-degenerate-merges:
  filter-branch: eliminate duplicate mapped parents

10 years agoMerge branch 'mk/merge-incomplete-files'
Junio C Hamano [Wed, 16 Jul 2014 18:26:04 +0000 (11:26 -0700)]
Merge branch 'mk/merge-incomplete-files'

Merging changes into a file that ends in an incomplete line made the
last line into a complete one, even when the other branch did not
change anything around the end of file.

* mk/merge-incomplete-files:
  git-merge-file: do not add LF at EOF while applying unrelated change
  t6023-merge-file.sh: fix and mark as broken invalid tests

10 years agoMerge branch 'jk/strip-suffix'
Junio C Hamano [Wed, 16 Jul 2014 18:25:59 +0000 (11:25 -0700)]
Merge branch 'jk/strip-suffix'

* jk/strip-suffix:
  prepare_packed_git_one: refactor duplicate-pack check
  verify-pack: use strbuf_strip_suffix
  strbuf: implement strbuf_strip_suffix
  index-pack: use strip_suffix to avoid magic numbers
  use strip_suffix instead of ends_with in simple cases
  replace has_extension with ends_with
  implement ends_with via strip_suffix
  add strip_suffix function
  sha1_file: replace PATH_MAX buffer with strbuf in prepare_packed_git_one()

10 years agoMerge branch 'ep/submodule-code-cleanup'
Junio C Hamano [Wed, 16 Jul 2014 18:25:57 +0000 (11:25 -0700)]
Merge branch 'ep/submodule-code-cleanup'

* ep/submodule-code-cleanup:
  submodule.c: use the ARRAY_SIZE macro

10 years agoMerge branch 'jk/replace-edit-raw'
Junio C Hamano [Wed, 16 Jul 2014 18:25:55 +0000 (11:25 -0700)]
Merge branch 'jk/replace-edit-raw'

Teach "git replace --edit" mode a "--raw" option to allow
editing the bare-metal representation data of objects.

* jk/replace-edit-raw:
  replace: add a --raw mode for --edit

10 years agoMerge branch 'cc/replace-edit'
Junio C Hamano [Wed, 16 Jul 2014 18:25:47 +0000 (11:25 -0700)]
Merge branch 'cc/replace-edit'

Teach "git replace" an "--edit" mode.

* cc/replace-edit:
  replace: use argv_array in export_object
  avoid double close of descriptors handed to run_command
  replace: replace spaces with tabs in indentation

10 years agoMerge branch 'tb/crlf-tests'
Junio C Hamano [Wed, 16 Jul 2014 18:25:45 +0000 (11:25 -0700)]
Merge branch 'tb/crlf-tests'

* tb/crlf-tests:
  t0027: combinations of core.autocrlf, core.eol and text
  t0025: rename the test files

10 years agoMerge branch 'nd/split-index'
Junio C Hamano [Wed, 16 Jul 2014 18:25:40 +0000 (11:25 -0700)]
Merge branch 'nd/split-index'

An experiment to use two files (the base file and incremental
changes relative to it) to represent the index to reduce I/O cost
of rewriting a large index when only small part of the working tree
changes.

* nd/split-index: (32 commits)
  t1700: new tests for split-index mode
  t2104: make sure split index mode is off for the version test
  read-cache: force split index mode with GIT_TEST_SPLIT_INDEX
  read-tree: note about dropping split-index mode or index version
  read-tree: force split-index mode off on --index-output
  rev-parse: add --shared-index-path to get shared index path
  update-index --split-index: do not split if $GIT_DIR is read only
  update-index: new options to enable/disable split index mode
  split-index: strip pathname of on-disk replaced entries
  split-index: do not invalidate cache-tree at read time
  split-index: the reading part
  split-index: the writing part
  read-cache: mark updated entries for split index
  read-cache: save deleted entries in split index
  read-cache: mark new entries for split index
  read-cache: split-index mode
  read-cache: save index SHA-1 after reading
  entry.c: update cache_changed if refresh_cache is set in checkout_entry()
  cache-tree: mark istate->cache_changed on prime_cache_tree()
  cache-tree: mark istate->cache_changed on cache tree update
  ...

10 years agoGit 2.0.2 v2.0.2
Junio C Hamano [Wed, 16 Jul 2014 18:19:56 +0000 (11:19 -0700)]
Git 2.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'jc/fix-clone-single-starting-at-a-tag' into maint
Junio C Hamano [Wed, 16 Jul 2014 18:17:36 +0000 (11:17 -0700)]
Merge branch 'jc/fix-clone-single-starting-at-a-tag' into maint

"git clone -b brefs/tags/bar" would have mistakenly thought we were
following a single tag, even though it was a name of the branch,
because it incorrectly used strstr().

* jc/fix-clone-single-starting-at-a-tag:
  builtin/clone.c: detect a clone starting at a tag correctly

10 years agoMerge branch 'jk/pretty-G-format-fixes' into maint
Junio C Hamano [Wed, 16 Jul 2014 18:17:21 +0000 (11:17 -0700)]
Merge branch 'jk/pretty-G-format-fixes' into maint

"%G" (nothing after G) is an invalid pretty format specifier, but
the parser did not notice it as garbage.

* jk/pretty-G-format-fixes:
  move "%G" format test from t7510 to t6006
  pretty: avoid reading past end-of-string with "%G"
  t7510: check %G* pretty-format output
  t7510: test a commit signed by an unknown key
  t7510: use consistent &&-chains in loop
  t7510: stop referring to master in later tests

10 years agoMerge branch 'rs/fix-alt-odb-path-comparison' into maint
Junio C Hamano [Wed, 16 Jul 2014 18:17:08 +0000 (11:17 -0700)]
Merge branch 'rs/fix-alt-odb-path-comparison' into maint

Code to avoid adding the same alternate object store twice was
subtly broken for a long time, but nobody seems to have noticed.

* rs/fix-alt-odb-path-comparison:
  sha1_file: avoid overrunning alternate object base string

10 years agoMerge branch 'jk/commit-buffer-length' into maint
Junio C Hamano [Wed, 16 Jul 2014 18:16:38 +0000 (11:16 -0700)]
Merge branch 'jk/commit-buffer-length' into maint

A handful of code paths had to read the commit object more than
once when showing header fields that are usually not parsed.  The
internal data structure to keep track of the contents of the commit
object has been updated to reduce the need for this double-reading,
and to allow the caller find the length of the object.

* jk/commit-buffer-length:
  reuse cached commit buffer when parsing signatures
  commit: record buffer length in cache
  commit: convert commit->buffer to a slab
  commit-slab: provide a static initializer
  use get_commit_buffer everywhere
  convert logmsg_reencode to get_commit_buffer
  use get_commit_buffer to avoid duplicate code
  use get_cached_commit_buffer where appropriate
  provide helpers to access the commit buffer
  provide a helper to set the commit buffer
  provide a helper to free commit buffer
  sequencer: use logmsg_reencode in get_message
  logmsg_reencode: return const buffer
  do not create "struct commit" with xcalloc
  commit: push commit_index update into alloc_commit_node
  alloc: include any-object allocations in alloc_report
  replace dangerous uses of strbuf_attach
  commit_tree: take a pointer/len pair rather than a const strbuf

10 years agoMerge branch 'bc/fix-rebase-merge-skip' into maint
Junio C Hamano [Wed, 16 Jul 2014 18:16:16 +0000 (11:16 -0700)]
Merge branch 'bc/fix-rebase-merge-skip' into maint

During "git rebase --merge", a conflicted patch could not be
skipped with "--skip" if the next one also conflicted.

* bc/fix-rebase-merge-skip:
  rebase--merge: fix --skip with two conflicts in a row

10 years agoMerge branch 'maint-1.9' into maint
Junio C Hamano [Wed, 16 Jul 2014 18:11:06 +0000 (11:11 -0700)]
Merge branch 'maint-1.9' into maint

* maint-1.9:
  annotate: use argv_array

10 years agoMerge branch 'maint-1.8.5' into maint-1.9
Junio C Hamano [Wed, 16 Jul 2014 18:10:30 +0000 (11:10 -0700)]
Merge branch 'maint-1.8.5' into maint-1.9

* maint-1.8.5:
  annotate: use argv_array
  t7300: repair filesystem permissions with test_when_finished
  enums: remove trailing ',' after last item in enum

10 years agoannotate: use argv_array
René Scharfe [Wed, 16 Jul 2014 08:51:33 +0000 (10:51 +0200)]
annotate: use argv_array

Simplify the code and get rid of some magic constants by using
argv_array to build the argument list for cmd_blame.  Be lazy and let
the OS release our allocated memory, as before.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMinGW: fix compile error due to missing ELOOP
Karsten Blees [Tue, 15 Jul 2014 22:53:27 +0000 (00:53 +0200)]
MinGW: fix compile error due to missing ELOOP

MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many
links") instead.

Signed-off-by: Karsten Blees <blees@dcon.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosha1_file: do not add own object directory as alternate
Ephrim Khong [Tue, 15 Jul 2014 11:29:45 +0000 (13:29 +0200)]
sha1_file: do not add own object directory as alternate

When adding alternate object directories, we try not to add the
directory of the current repository to avoid cycles.  Unfortunately,
that test was broken, since it compared an absolute with a relative
path.

Signed-off-by: Ephrim Khong <dr.khong@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoWin32: Unicode file name support (dirent)
Karsten Blees [Sat, 14 Jan 2012 21:01:09 +0000 (22:01 +0100)]
Win32: Unicode file name support (dirent)

Changes opendir/readdir to use Windows Unicode APIs and convert between
UTF-8/UTF-16.

Removes parameter checks that are already covered by xutftowcs_path. This
changes detection of ENAMETOOLONG from MAX_PATH - 2 to MAX_PATH (matching
is_dir_empty in mingw.c). If name + "/*" or the resulting absolute path is
too long, FindFirstFile fails and errno is set through err_win_to_posix.

Increases the size of dirent.d_name to accommodate the full
WIN32_FIND_DATA.cFileName converted to UTF-8 (UTF-16 to UTF-8 conversion
may grow by factor three in the worst case).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoWin32: Unicode file name support (except dirent)
Karsten Blees [Thu, 15 Mar 2012 17:21:28 +0000 (18:21 +0100)]
Win32: Unicode file name support (except dirent)

Replaces Windows "ANSI" APIs dealing with file- or path names with their
Unicode equivalent, adding UTF-8/UTF-16LE conversion as necessary.

The dirent API (opendir/readdir/closedir) is updated in a separate commit.

Adds trivial wrappers for access, chmod and chdir.

Adds wrapper for mktemp (needed for both mkstemp and mkdtemp).

The simplest way to convert a repository with legacy-encoded (e.g. Cp1252)
file names to UTF-8 ist to checkout with an old msysgit version and
"git add --all & git commit" with the new version.

Includes a fix for bug reported by John Chen:
On Windows XP (not Win7), directories cannot be deleted while a find handle
is open, causing "Deletion of directory '...' failed. Should I try again?"
prompts.

Prior to this commit, these failures were silently ignored due to
strbuf_free in is_dir_empty resetting GetLastError to ERROR_SUCCESS.

Close the find handle in is_dir_empty so that git doesn't block deletion
of the directory even after all other applications have released it.

Reported-by: John Chen <john0312@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years ago.gitignore: "git-verify-commit" is a generated file
Øyvind A. Holm [Tue, 15 Jul 2014 13:40:24 +0000 (15:40 +0200)]
.gitignore: "git-verify-commit" is a generated file

builtin/verify-commit.c was added in commit d07b00b ("verify-commit:
scriptable commit signature verification", 2014-06-23), update
.gitignore to ignore the generated file.

Signed-off-by: Øyvind A. Holm <sunny@sunbase.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorevert: add t3513 for submodule updates
Jens Lehmann [Thu, 19 Jun 2014 20:12:56 +0000 (22:12 +0200)]
revert: add t3513 for submodule updates

Test that the revert command updates the work tree as expected (for
submodule changes which don't result in conflicts). Add a helper function
to first revert the checked out target commit to make the last revert
produce the to-be-tested work tree.

Set the KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT and
KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR switches to
document that revert has the similar failures.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agostash: add t3906 for submodule updates
Jens Lehmann [Thu, 19 Jun 2014 20:12:54 +0000 (22:12 +0200)]
stash: add t3906 for submodule updates

Test that the stash apply command updates the work tree as expected for
changes which don't result in conflicts. To make that work add a helper
function that uses read-tree to apply the changes of the target commit
to the work tree, then stashes these changes and at last applies that
stash.

Implement the KNOWN_FAILURE_STASH_DOES_IGNORE_SUBMODULE_CHANGES switch
and reuse two other already present switches to expect the known
failure that stash does ignore submodule changes.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoam: add t4255 for submodule updates
Jens Lehmann [Sun, 15 Jun 2014 17:03:53 +0000 (19:03 +0200)]
am: add t4255 for submodule updates

Test that the am command updates the work tree as expected (for submodule
changes which don't result in conflicts). To make that work add two
helper functions that use format-patch to create the input for am.

Add the KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES
switch to expect the known failure that --no-ff merges attempt to merge
the new files in the former submodule directory with those of the removed
submodule.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agocherry-pick: add t3512 for submodule updates
Jens Lehmann [Sun, 15 Jun 2014 17:03:18 +0000 (19:03 +0200)]
cherry-pick: add t3512 for submodule updates

Test that the cherry-pick command updates the work tree as expected (for
submodule changes which don't result in conflicts).

Set KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES
and KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR to
document that cherry-pick has the same --no-ff known failures merge has.

Implement the KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT switch to expect
the known failure that while cherry picking just a SHA-1 update for an
ignored submodule the commit incorrectly fails with "The previous
cherry-pick is now empty, possibly due to conflict resolution.".

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agopull: add t5572 for submodule updates
Jens Lehmann [Sun, 15 Jun 2014 17:02:47 +0000 (19:02 +0200)]
pull: add t5572 for submodule updates

Test that the pull command updates the work tree as expected (for
submodule changes which don't result in conflicts) when used without
arguments or with the '--ff', '--ff-only' and '--no-ff' flag each. Add
helper functions to reset the branch to be updated to to the current
HEAD so that pull is doing the transition from HEAD to the given branch.

Set KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES
and KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR to
document that pull has the same --no-ff known failures merge has.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorebase: add t3426 for submodule updates
Jens Lehmann [Thu, 19 Jun 2014 20:12:51 +0000 (22:12 +0200)]
rebase: add t3426 for submodule updates

Test that the rebase command updates the work tree as expected for
changes which don't result in conflicts. To make that work add two
helper functions that add a commit only touching files and then
revert it. This allows to rebase the target commit over these two
and to compare the result.

Set KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR to
document that "replace directory with submodule" fails for an
interactive rebase because a directory "sub1" already exists.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agomerge: add t7613 for submodule updates
Jens Lehmann [Sun, 15 Jun 2014 17:01:41 +0000 (19:01 +0200)]
merge: add t7613 for submodule updates

Test that the merge command updates the work tree as expected (for
submodule changes which don't result in conflicts) when used without
arguments or with the '--ff', '--ff-only' and '--no-ff' flag.

Implement the KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR
switch to expect the known failure that --no-ff merges do not create the
empty submodule directory.

The KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES
switch is also implemented to expect the known failure that --no-ff
merges attempt to merge the new files in the former submodule directory
with those of the removed submodule.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agobisect: add t6041 for submodule updates
Jens Lehmann [Thu, 19 Jun 2014 20:12:48 +0000 (22:12 +0200)]
bisect: add t6041 for submodule updates

Test that the bisect command updates the work tree as expected. To make
that work with the new submodule test framework a git_bisect helper
function is added. This adds a commit after the one given to be switched
to and makes that one the bad commit. The starting point is then given to
bisect as the good commit which makes bisect change the work tree to the
commit in between, which is the commit given.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoreset: add t7112 for submodule updates
Jens Lehmann [Sun, 15 Jun 2014 17:00:28 +0000 (19:00 +0200)]
reset: add t7112 for submodule updates

Test that the reset command updates the work tree as expected for changes
with '--keep', '--merge' (for changes which don't result in conflicts) and
'--hard'.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoread-tree: add t1013 for submodule updates
Jens Lehmann [Sun, 15 Jun 2014 16:59:51 +0000 (18:59 +0200)]
read-tree: add t1013 for submodule updates

Test that the read-tree command updates the work tree as expected for
changes which don't result in conflicts with the '-m' and '--reset' flag.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoapply: add t4137 for submodule updates
Jens Lehmann [Sun, 15 Jun 2014 16:59:20 +0000 (18:59 +0200)]
apply: add t4137 for submodule updates

Test that the apply command updates the work tree as expected for the
'--index' and the '--3way' options (for submodule changes which don't
result in conflicts).

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agocheckout: call the new submodule update test framework
Jens Lehmann [Sun, 15 Jun 2014 16:58:44 +0000 (18:58 +0200)]
checkout: call the new submodule update test framework

Test that the checkout command updates the work tree as expected with
and without the '-f' flag.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodules: add the lib-submodule-update.sh test library
Jens Lehmann [Tue, 1 Jul 2014 21:24:14 +0000 (23:24 +0200)]
submodules: add the lib-submodule-update.sh test library

Add this test library to simplify covering all combinations of submodule
update scenarios without having to add those to a test of each work tree
manipulating command over and over again.

The functions test_submodule_switch() and test_submodule_forced_switch()
are intended to be called from a test script with a single argument. This
argument is either a work tree manipulating command (including any command
line options) or a function (when more than a single git command is needed
to switch work trees from the current HEAD to another commit). This
command (or function) is passed a target branch as argument. The two new
functions check that each submodule transition is handled as expected,
which currently means that submodule work trees are not affected until
"git submodule update" is called. The "forced" variant is for commands
using their '-f' or '--hard' option and expects them to overwrite local
modifications as a result. Each of these two functions contains 14
tests_expect_* calls.

Calling one of these test functions the first time creates a repository
named "submodule_update_repo". At first it contains two files, then a
single submodule is added in another commit followed by commits covering
all relevant submodule modifications. This repository is newly cloned into
the "submodule_update" for each test_expect_* to avoid interference
between different parts of the test functions (some to-be-tested commands
also manipulate refs along with the work tree, e.g. "git reset").

Follow-up commits will then call these two test functions for all work
tree manipulating commands (with a combination of all their options
relevant to what they do with the work tree) making sure they work as
expected. Later this test library will be extended to cover merges
resulting in conflicts too. Also it is intended to be easily extendable
for the recursive update functionality, where even more combinations of
submodule modifications have to be tested for.

This version documents two bugs in current Git with expected failures:

*) When a submodule is replaced with a tracked file of the same name the
   submodule work tree including any local modifications (and even the
   whole history if it uses a .git directory instead of a gitfile!) is
   silently removed.

*) Forced work tree updates happily manipulate files in the directory of a
   submodule that has just been removed in the superproject (but is of
   course still present in the work tree due to the way submodules are
   currently handled). This becomes dangerous when files in the submodule
   directory are overwritten by files from the new superproject commit, as
   any modifications to the submodule files will be lost) and is expected
   to also destroy history in the - admittedly unlikely case - the new
   commit adds a file named ".git" to the submodule directory.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorefs.c: change ref_transaction_update() to do error checking and return status
Ronnie Sahlberg [Fri, 20 Jun 2014 14:43:00 +0000 (07:43 -0700)]
refs.c: change ref_transaction_update() to do error checking and return status

Update ref_transaction_update() do some basic error checking and return
non-zero on error. Update all callers to check ref_transaction_update() for
error. There are currently no conditions in _update that will return error but
there will be in the future. Add an err argument that will be updated on
failure. In future patches we will start doing both locking and checking
for name conflicts in _update instead of _commit at which time this function
will start returning errors for these conditions.

Also check for BUGs during update and die(BUG:...) if we are calling
_update with have_old but the old_sha1 pointer is NULL.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: remove the onerr argument to ref_transaction_commit
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:59 +0000 (07:42 -0700)]
refs.c: remove the onerr argument to ref_transaction_commit

Since all callers now use QUIET_ON_ERR we no longer need to provide an onerr
argument any more. Remove the onerr argument from the ref_transaction_commit
signature.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agoupdate-ref: use err argument to get error from ref_transaction_commit
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:58 +0000 (07:42 -0700)]
update-ref: use err argument to get error from ref_transaction_commit

Call ref_transaction_commit with QUIET_ON_ERR and use the strbuf that is
returned to print a log message if/after the transaction fails.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: make update_ref_write update a strbuf on failure
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:57 +0000 (07:42 -0700)]
refs.c: make update_ref_write update a strbuf on failure

Change update_ref_write to also update an error strbuf on failure.
This makes the error available to ref_transaction_commit callers if the
transaction failed due to update_ref_sha1/write_ref_sha1 failures.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: make ref_update_reject_duplicates take a strbuf argument for errors
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:56 +0000 (07:42 -0700)]
refs.c: make ref_update_reject_duplicates take a strbuf argument for errors

Make ref_update_reject_duplicates return any error that occurs through a
new strbuf argument. This means that when a transaction commit fails in
this function we will now be able to pass a helpful error message back to the
caller.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: log_ref_write should try to return meaningful errno
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:55 +0000 (07:42 -0700)]
refs.c: log_ref_write should try to return meaningful errno

Making errno from write_ref_sha1() meaningful, which should fix

* a bug in "git checkout -b" where it prints strerror(errno)
  despite errno possibly being zero or clobbered

* a bug in "git fetch"'s s_update_ref, which trusts the result of an
  errno == ENOTDIR check to detect D/F conflicts

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: make resolve_ref_unsafe set errno to something meaningful on error
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:54 +0000 (07:42 -0700)]
refs.c: make resolve_ref_unsafe set errno to something meaningful on error

Making errno when returning from resolve_ref_unsafe() meaningful,
which should fix

 * a bug in lock_ref_sha1_basic, where it assumes EISDIR
   means it failed due to a directory being in the way

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: commit_packed_refs to return a meaningful errno on failure
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:53 +0000 (07:42 -0700)]
refs.c: commit_packed_refs to return a meaningful errno on failure

Making errno when returning from commit_packed_refs() meaningful,
which should fix

 * a bug in "git clone" where it prints strerror(errno) based on
   errno, despite errno possibly being zero and potentially having
   been clobbered by that point
 * the same kind of bug in "git pack-refs"

and prepares for repack_without_refs() to get a meaningful
error message when commit_packed_refs() fails without falling into
the same bug.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: make remove_empty_directories always set errno to something sane
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:52 +0000 (07:42 -0700)]
refs.c: make remove_empty_directories always set errno to something sane

Making errno when returning from remove_empty_directories() more
obviously meaningful, which should provide some peace of mind for
people auditing lock_ref_sha1_basic.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: verify_lock should set errno to something meaningful
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:51 +0000 (07:42 -0700)]
refs.c: verify_lock should set errno to something meaningful

Making errno when returning from verify_lock() meaningful, which
should almost but not completely fix

 * a bug in "git fetch"'s s_update_ref, which trusts the result of an
   errno == ENOTDIR check to detect D/F conflicts

ENOTDIR makes sense as a sign that a file was in the way of a
directory we wanted to create.  Should "git fetch" also look for
ENOTEMPTY or EEXIST to catch cases where a directory was in the way
of a file to be created?

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: make sure log_ref_setup returns a meaningful errno
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:50 +0000 (07:42 -0700)]
refs.c: make sure log_ref_setup returns a meaningful errno

Making errno when returning from log_ref_setup() meaningful,

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: add an err argument to repack_without_refs
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:49 +0000 (07:42 -0700)]
refs.c: add an err argument to repack_without_refs

Update repack_without_refs to take an err argument and update it if there
is a failure. Pass the err variable from ref_transaction_commit to this
function so that callers can print a meaningful error message if _commit
fails due to this function.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agolockfile.c: make lock_file return a meaningful errno on failurei
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:48 +0000 (07:42 -0700)]
lockfile.c: make lock_file return a meaningful errno on failurei

Making errno when returning from lock_file() meaningful, which should
fix

 * an existing almost-bug in lock_ref_sha1_basic where it assumes
   errno==ENOENT is meaningful and could waste some work on retries

 * an existing bug in repack_without_refs where it prints
   strerror(errno) and picks advice based on errno, despite errno
   potentially being zero and potentially having been clobbered by
   that point

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agolockfile.c: add a new public function unable_to_lock_message
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:47 +0000 (07:42 -0700)]
lockfile.c: add a new public function unable_to_lock_message

Introducing a new unable_to_lock_message helper, which has nicer
semantics than unable_to_lock_error and cleans up lockfile.c a little.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: add a strbuf argument to ref_transaction_commit for error logging
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:46 +0000 (07:42 -0700)]
refs.c: add a strbuf argument to ref_transaction_commit for error logging

Add a strbuf argument to _commit so that we can pass an error string back to
the caller. So that we can do error logging from the caller instead of from
_commit.

Longer term plan is to first convert all callers to use onerr==QUIET_ON_ERR
and craft any log messages from the callers themselves and finally remove the
onerr argument completely.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: allow passing NULL to ref_transaction_free
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:45 +0000 (07:42 -0700)]
refs.c: allow passing NULL to ref_transaction_free

Allow ref_transaction_free(NULL) as a no-op. This makes ref_transaction_free
easier to use and more similar to plain 'free'.

In particular, it lets us rollback unconditionally as part of cleanup code
after setting 'transaction = NULL' if a transaction has been committed or
rolled back already.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: constify the sha arguments for ref_transaction_create|delete|update
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:44 +0000 (07:42 -0700)]
refs.c: constify the sha arguments for ref_transaction_create|delete|update

ref_transaction_create|delete|update has no need to modify the sha1
arguments passed to it so it should use const unsigned char* instead
of unsigned char*.

Some functions, such as fast_forward_to(), already have its old/new
sha1 arguments as consts. This function will at some point need to
use ref_transaction_update() in which case this change is required.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: ref_transaction_commit should not free the transaction
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:43 +0000 (07:42 -0700)]
refs.c: ref_transaction_commit should not free the transaction

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agorefs.c: remove ref_transaction_rollback
Ronnie Sahlberg [Fri, 20 Jun 2014 14:42:42 +0000 (07:42 -0700)]
refs.c: remove ref_transaction_rollback

We do not yet need both a rollback and a free function for transactions.
Remove ref_transaction_rollback and use ref_transaction_free instead.

At a later stage we may reintroduce a rollback function if we want to start
adding reusable transactions and similar.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
10 years agohttp-push.c: make CURLOPT_IOCTLDATA a usable pointer
Abbaad Haider [Sun, 6 Jul 2014 00:43:48 +0000 (20:43 -0400)]
http-push.c: make CURLOPT_IOCTLDATA a usable pointer

Fixes a small bug affecting push to remotes which use some sort of
multi-pass authentication. In particular the bug affected SabreDAV as
configured by Box.com [1].

It must be a weird server configuration for the bug to have survived
this long. Someone should write a test for it.

[1] http://marc.info/?l=git&m=140460482604482

Signed-off-by: Abbaad Haider <abbaad@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agocache.h: rename cache_def_free to cache_def_clear
Karsten Blees [Fri, 11 Jul 2014 23:02:34 +0000 (01:02 +0200)]
cache.h: rename cache_def_free to cache_def_clear

Rename cache_def_free to cache_def_clear as it doesn't free the struct
cache_def, but just clears its content.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agolog: correctly identify mergetag signature verification status
Michael J Gruber [Fri, 27 Jun 2014 13:18:36 +0000 (15:18 +0200)]
log: correctly identify mergetag signature verification status

A wrong '}' made our code record the results of mergetag signature
verification incorrectly.

Fix it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agofsck: simplify fsck_commit_buffer() by using commit_list_count()
René Scharfe [Thu, 10 Jul 2014 09:48:26 +0000 (11:48 +0200)]
fsck: simplify fsck_commit_buffer() by using commit_list_count()

fsck_commit_buffer() checks that the number of items in the parents
list of a commit matches the number of parent lines in its buffer or --
if a graft is used -- the number of parents in that graft.  Simplify
the code by using commit_list_count() instead of counting by hand.
Also use different variables for the number of lines and the number of
list items, making it easier to compare them.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agocommit: use commit_list_append() instead of duplicating its code
René Scharfe [Thu, 10 Jul 2014 09:47:47 +0000 (11:47 +0200)]
commit: use commit_list_append() instead of duplicating its code

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agomerge: simplify merge_trivial() by using commit_list_append()
René Scharfe [Thu, 10 Jul 2014 09:41:40 +0000 (11:41 +0200)]
merge: simplify merge_trivial() by using commit_list_append()

Build the commit_list of parents by calling commit_list_append() twice
instead of allocating and linking the items by hand.  This makes the
code shorter and simpler.  Rename the commit_list from parent to parents
(plural) while at it because there are two of them.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agouse strbuf_addch for adding single characters
René Scharfe [Thu, 10 Jul 2014 08:54:24 +0000 (10:54 +0200)]
use strbuf_addch for adding single characters

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agouse strbuf_addbuf for adding strbufs
René Scharfe [Thu, 10 Jul 2014 08:52:21 +0000 (10:52 +0200)]
use strbuf_addbuf for adding strbufs

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agodoc: give some guidelines for error messages
Philip Oakley [Mon, 16 Jun 2014 12:55:57 +0000 (13:55 +0100)]
doc: give some guidelines for error messages

Clarify error message puntuation to reduce review workload.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot/Makefile: always test all lint targets when running tests
Jens Lehmann [Wed, 9 Jul 2014 19:34:42 +0000 (21:34 +0200)]
t/Makefile: always test all lint targets when running tests

Only the two targets "test-lint-duplicates" and "test-lint-executable" are
currently executed when running the test target. This was done on purpose
when the TEST_LINT variable was added in 81127d74 to avoid twisted shell
scripting by developers only to avoid false positives that might result
from the rather simple minded tests, e.g. test-lint-shell-syntax. But it
looks like it might be better to include all lint tests to help developers
to detect non portable shell constructs before the patch is sent to the
list and reviewed there.

Change the TEST_LINT variable to run all lint test unless the TEST_LINT
variable is overridden. If we hit false positives more often than helping
developers to avoid non-portable code (or add less accurate or slow tests
later) we could still fall back to exclude them like 81127d74 proposed.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot/Makefile: check helper scripts for non-portable shell commands too
Jens Lehmann [Wed, 9 Jul 2014 19:34:12 +0000 (21:34 +0200)]
t/Makefile: check helper scripts for non-portable shell commands too

Currently only the "t[0-9][0-9][0-9][0-9]-*.sh" scripts are tested for
shell incompatibilities using the check-non-portable-shell.pl script. This
makes it easy to miss non-POSIX constructs added to one of the t/*lib*.sh
helper scripts, as they aren't automatically detected.

Fix that by adding a THELPERS variable containing all shell scripts that
aren't tests and add these to the "test-lint-shell-syntax" target too.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'maint'
Junio C Hamano [Thu, 10 Jul 2014 18:37:56 +0000 (11:37 -0700)]
Merge branch 'maint'

* maint:
  Start preparing for 2.0.2

10 years agoSeventh batch for 2.1
Junio C Hamano [Thu, 10 Jul 2014 18:37:30 +0000 (11:37 -0700)]
Seventh batch for 2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'dt/refs-check-refname-component-sse-fix'
Junio C Hamano [Thu, 10 Jul 2014 18:27:55 +0000 (11:27 -0700)]
Merge branch 'dt/refs-check-refname-component-sse-fix'

Fixes to a topic that is already in 'master'.

* dt/refs-check-refname-component-sse-fix:
  refs: fix valgrind suppression file
  refs.c: handle REFNAME_REFSPEC_PATTERN at end of page

10 years agoMerge branch 'rs/simplify-archive-tests'
Junio C Hamano [Thu, 10 Jul 2014 18:27:53 +0000 (11:27 -0700)]
Merge branch 'rs/simplify-archive-tests'

* rs/simplify-archive-tests:
  t5000, t5003: simplify commit

10 years agoMerge branch 'rs/fix-alt-odb-path-comparison'
Junio C Hamano [Thu, 10 Jul 2014 18:27:52 +0000 (11:27 -0700)]
Merge branch 'rs/fix-alt-odb-path-comparison'

* rs/fix-alt-odb-path-comparison:
  sha1_file: avoid overrunning alternate object base string

10 years agoMerge branch 'rs/status-code-clean-up'
Junio C Hamano [Thu, 10 Jul 2014 18:27:50 +0000 (11:27 -0700)]
Merge branch 'rs/status-code-clean-up'

* rs/status-code-clean-up:
  wt-status: simplify building of summary limit argument
  wt-status: use argv_array for environment

10 years agoMerge branch 'kb/path-max-must-go'
Junio C Hamano [Thu, 10 Jul 2014 18:27:47 +0000 (11:27 -0700)]
Merge branch 'kb/path-max-must-go'

* kb/path-max-must-go:
  symlinks: remove PATH_MAX limitation

10 years agoMerge branch 'mg/verify-commit'
Junio C Hamano [Thu, 10 Jul 2014 18:27:33 +0000 (11:27 -0700)]
Merge branch 'mg/verify-commit'

Add 'verify-commit' to be used in a way similar to 'verify-tag' is
used.  Further work on verifying the mergetags might be needed.

* mg/verify-commit:
  t7510: test verify-commit
  t7510: exit for loop with test result
  verify-commit: scriptable commit signature verification
  gpg-interface: provide access to the payload
  gpg-interface: provide clear helper for struct signature_check

10 years agoMerge branch 'jc/fix-clone-single-starting-at-a-tag'
Junio C Hamano [Thu, 10 Jul 2014 18:17:24 +0000 (11:17 -0700)]
Merge branch 'jc/fix-clone-single-starting-at-a-tag'

"git clone -b brefs/tags/bar" would have mistakenly thought we were
following a single tag, even though it was a name of the branch,
because it incorrectly used strstr().

* jc/fix-clone-single-starting-at-a-tag:
  builtin/clone.c: detect a clone starting at a tag correctly

10 years agoStart preparing for 2.0.2
Junio C Hamano [Thu, 10 Jul 2014 18:15:10 +0000 (11:15 -0700)]
Start preparing for 2.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'pb/trim-trailing-spaces' into maint
Junio C Hamano [Thu, 10 Jul 2014 18:10:52 +0000 (11:10 -0700)]
Merge branch 'pb/trim-trailing-spaces' into maint

* pb/trim-trailing-spaces:
  t0008: do not depend on 'echo' handling backslashes specially
  dir.c:trim_trailing_spaces(): fix for " \ " sequence

10 years agoMerge branch 'jk/repack-pack-keep-objects' into maint
Junio C Hamano [Thu, 10 Jul 2014 18:10:05 +0000 (11:10 -0700)]
Merge branch 'jk/repack-pack-keep-objects' into maint

* jk/repack-pack-keep-objects:
  repack: s/write_bitmap/&s/ in code
  repack: respect pack.writebitmaps
  repack: do not accidentally pack kept objects by default

10 years agoMerge branch 'mc/doc-submodule-sync-recurse' into maint
Junio C Hamano [Thu, 10 Jul 2014 18:08:31 +0000 (11:08 -0700)]
Merge branch 'mc/doc-submodule-sync-recurse' into maint

* mc/doc-submodule-sync-recurse:
  submodule: document "sync --recursive"

10 years agotag: use skip_prefix instead of magic numbers
Jeff King [Thu, 10 Jul 2014 04:07:32 +0000 (00:07 -0400)]
tag: use skip_prefix instead of magic numbers

We can make the parsing of the --sort parameter a bit more
readable by having skip_prefix keep our pointer up to date.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoremote-curl: mark helper-protocol errors more clearly
Jeff King [Wed, 9 Jul 2014 21:47:20 +0000 (17:47 -0400)]
remote-curl: mark helper-protocol errors more clearly

When we encounter an error in remote-curl, we generally just
report it to stderr. There is no need for the user to care
that the "could not connect to server" error was generated
by git-remote-https rather than a function in the parent
git-fetch process.

However, when the error is in the protocol between git and
the helper, it makes sense to clearly identify which side is
complaining. These cases shouldn't ever happen, but when
they do, we can make them less confusing by being more
verbose.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>