git
10 years agoMerge branch 'nd/upload-pack-shallow'
Junio C Hamano [Fri, 21 Mar 2014 19:49:08 +0000 (12:49 -0700)] 
Merge branch 'nd/upload-pack-shallow'

Serving objects from a shallow repository needs to write a
temporary file to be used, but the serving upload-pack may not have
write access to the repository which is meant to be read-only.

Instead feed these temporary shallow bounds from the standard input
of pack-objects so that we do not have to use a temporary file.

* nd/upload-pack-shallow:
  upload-pack: send shallow info over stdin to pack-objects

10 years agoMerge branch 'jn/wt-status'
Junio C Hamano [Fri, 21 Mar 2014 19:48:59 +0000 (12:48 -0700)] 
Merge branch 'jn/wt-status'

Unify the codepaths that format new/modified/changed sections and
conflicted paths in the "git status" output and make it possible to
properly internationalize their output.

* jn/wt-status:
  wt-status: lift the artificual "at least 20 columns" floor
  wt-status: i18n of section labels
  wt-status: extract the code to compute width for labels
  wt-status: make full label string to be subject to l10n

10 years agoMerge branch 'jc/stash-pop-not-popped'
Junio C Hamano [Fri, 21 Mar 2014 19:48:51 +0000 (12:48 -0700)] 
Merge branch 'jc/stash-pop-not-popped'

"stash pop", upon failing to apply the stash, refrains from
discarding the stash to avoid information loss.  Be more explicit
in the error message.

The wording may want to get a bit more bikeshedding.

* jc/stash-pop-not-popped:
  stash pop: mention we did not drop the stash upon failing to apply

10 years agoMerge branch 'dk/skip-prefix-scan-only-once'
Junio C Hamano [Fri, 21 Mar 2014 19:47:41 +0000 (12:47 -0700)] 
Merge branch 'dk/skip-prefix-scan-only-once'

Update implementation of skip_prefix() to scan only once; given
that most "prefix" arguments to the inline function are constant
strings whose strlen() can be determined at the compile time, this
might actually make things worse with a compiler with sufficient
intelligence.

* dk/skip-prefix-scan-only-once:
  skip_prefix(): scan prefix only once

10 years agoMerge branch 'nd/tag-version-sort'
Junio C Hamano [Fri, 21 Mar 2014 19:47:38 +0000 (12:47 -0700)] 
Merge branch 'nd/tag-version-sort'

Allow v1.9.0 sorted before v1.10.0 in "git tag --list" output.

* nd/tag-version-sort:
  tag: support --sort=<spec>

10 years agoMerge branch 'jk/shallow-update-fix'
Junio C Hamano [Fri, 21 Mar 2014 19:33:29 +0000 (12:33 -0700)] 
Merge branch 'jk/shallow-update-fix'

Serving objects from a shallow repository needs to write a
new file to hold the temporary shallow boundaries but it was not
cleaned when we exit due to die() or a signal.

* jk/shallow-update-fix:
  shallow: verify shallow file after taking lock
  shallow: automatically clean up shallow tempfiles
  shallow: use stat_validity to check for up-to-date file

10 years agoMerge branch 'tc/commit-dry-run-exit-status-tests'
Junio C Hamano [Fri, 21 Mar 2014 19:33:25 +0000 (12:33 -0700)] 
Merge branch 'tc/commit-dry-run-exit-status-tests'

* tc/commit-dry-run-exit-status-tests:
  demonstrate git-commit --dry-run exit code behaviour

10 years agoSync with 1.9.1
Junio C Hamano [Tue, 18 Mar 2014 21:34:25 +0000 (14:34 -0700)] 
Sync with 1.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoUpdate draft release notes to Git 2.0
Junio C Hamano [Tue, 18 Mar 2014 21:33:34 +0000 (14:33 -0700)] 
Update draft release notes to Git 2.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoGit 1.9.1 v1.9.1
Junio C Hamano [Tue, 18 Mar 2014 21:06:49 +0000 (14:06 -0700)] 
Git 1.9.1

The version numbering scheme has changed since Git 1.9 and we
dropped the third dewey-decimal from the traditional numbering
(e.g. both 1.8.4 and 1.8.5 were major feature releases).  This
release 1.9.1 is the first maintenance relase for Git 1.9.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'jk/clean-d-pathspec' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:04:59 +0000 (14:04 -0700)] 
Merge branch 'jk/clean-d-pathspec' into maint

"git clean -d pathspec" did not use the given pathspec correctly
and ended up cleaning too much.

* jk/clean-d-pathspec:
  clean: simplify dir/not-dir logic
  clean: respect pathspecs with "-d"

10 years agoMerge branch 'da/difftool-git-files' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:04:36 +0000 (14:04 -0700)] 
Merge branch 'da/difftool-git-files' into maint

"git difftool" misbehaved when the repository is bound to the
working tree with the ".git file" mechanism, where a textual file
".git" tells us where it is.

* da/difftool-git-files:
  t7800: add a difftool test for .git-files
  difftool: support repositories with .git-files

10 years agoMerge branch 'jk/remote-pushremote-config-reading' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:04:16 +0000 (14:04 -0700)] 
Merge branch 'jk/remote-pushremote-config-reading' into maint

"git push" did not pay attention to branch.*.pushremote if it is
defined earlier than remote.pushdefault; the order of these two
variables in the configuration file should not matter, but it did by
mistake.

* jk/remote-pushremote-config-reading:
  remote: handle pushremote config in any order

10 years agoMerge branch 'jk/commit-dates-parsing-fix' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:04:01 +0000 (14:04 -0700)] 
Merge branch 'jk/commit-dates-parsing-fix' into maint

Codepaths that parse timestamps in commit objects have been
tightened.

* jk/commit-dates-parsing-fix:
  show_ident_date: fix tz range check
  log: do not segfault on gmtime errors
  log: handle integer overflow in timestamps
  date: check date overflow against time_t
  fsck: report integer overflow in author timestamps
  t4212: test bogus timestamps with git-log

10 years agoMerge branch 'tr/diff-submodule-no-reuse-worktree' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:03:41 +0000 (14:03 -0700)] 
Merge branch 'tr/diff-submodule-no-reuse-worktree' into maint

"git diff --external-diff" incorrectly fed the submodule directory
in the working tree to the external diff driver when it knew it is
the same as one of the versions being compared.

* tr/diff-submodule-no-reuse-worktree:
  diff: do not reuse_worktree_file for submodules

10 years agoMerge branch 'nd/reset-setup-worktree' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:03:24 +0000 (14:03 -0700)] 
Merge branch 'nd/reset-setup-worktree' into maint

"git reset" needs to refresh the index when working in a working
tree (it can also be used to match the index to the HEAD in an
otherwise bare repository), but it failed to set up the working
tree properly, causing GIT_WORK_TREE to be ignored.

* nd/reset-setup-worktree:
  reset: optionally setup worktree and refresh index on --mixed

10 years agoMerge branch 'jc/check-attr-honor-working-tree' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:03:03 +0000 (14:03 -0700)] 
Merge branch 'jc/check-attr-honor-working-tree' into maint

"git check-attr" when working on a repository with a working tree
did not work well when the working tree was specified via the
--work-tree (and obviously with --git-dir) option.

* jc/check-attr-honor-working-tree:
  check-attr: move to the top of working tree when in non-bare repository
  t0003: do not chdir the whole test process

10 years agoMerge branch 'bk/refresh-missing-ok-in-merge-recursive' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:02:37 +0000 (14:02 -0700)] 
Merge branch 'bk/refresh-missing-ok-in-merge-recursive' into maint

"merge-recursive" was broken in 1.7.7 era and stopped working in an
empty (temporary) working tree, when there are renames involved.
This has been corrected.

* bk/refresh-missing-ok-in-merge-recursive:
  merge-recursive.c: tolerate missing files while refreshing index
  read-cache.c: extend make_cache_entry refresh flag with options
  read-cache.c: refactor --ignore-missing implementation
  t3030-merge-recursive: test known breakage with empty work tree

10 years agoMerge branch 'ds/rev-parse-required-args' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:01:05 +0000 (14:01 -0700)] 
Merge branch 'ds/rev-parse-required-args' into maint

"git rev-parse" was loose in rejecting command line arguments that
do not make sense, e.g. "--default" without the required value for
that option.

* ds/rev-parse-required-args:
  rev-parse: check i before using argv[i] against argc

10 years agoMerge branch 'jk/config-path-include-fix' into maint
Junio C Hamano [Tue, 18 Mar 2014 21:00:15 +0000 (14:00 -0700)] 
Merge branch 'jk/config-path-include-fix' into maint

include.path variable (or any variable that expects a path that can
use ~username expansion) in the configuration file is not a boolean,
but the code failed to check it.

* jk/config-path-include-fix:
  handle_path_include: don't look at NULL value
  expand_user_path: do not look at NULL path

10 years agoMerge branch 'nd/diff-quiet-stat-dirty' into maint
Junio C Hamano [Tue, 18 Mar 2014 20:59:55 +0000 (13:59 -0700)] 
Merge branch 'nd/diff-quiet-stat-dirty' into maint

"git diff --quiet -- pathspec1 pathspec2" sometimes did not return
correct status value.

* nd/diff-quiet-stat-dirty:
  diff: do not quit early on stat-dirty files
  diff.c: move diffcore_skip_stat_unmatch core logic out for reuse later

10 years agoMerge branch 'nd/http-fetch-shallow-fix' into maint
Junio C Hamano [Tue, 18 Mar 2014 20:59:37 +0000 (13:59 -0700)] 
Merge branch 'nd/http-fetch-shallow-fix' into maint

Attempting to deepen a shallow repository by fetching over smart
HTTP transport failed in the protocol exchange, when no-done
extension was used.  The fetching side waited for the list of
shallow boundary commits after the sending end stopped talking to
it.

* nd/http-fetch-shallow-fix:
  t5537: move http tests out to t5539
  fetch-pack: fix deepen shallow over smart http with no-done cap
  protocol-capabilities.txt: document no-done
  protocol-capabilities.txt: refer multi_ack_detailed back to pack-protocol.txt
  pack-protocol.txt: clarify 'obj-id' in the last ACK after 'done'
  test: rename http fetch and push test files
  tests: auto-set LIB_HTTPD_PORT from test name

10 years agoMerge branch 'nd/submodule-pathspec-ending-with-slash' into maint
Junio C Hamano [Tue, 18 Mar 2014 20:58:58 +0000 (13:58 -0700)] 
Merge branch 'nd/submodule-pathspec-ending-with-slash' into maint

Allow "git cmd path/", when the 'path' is where a submodule is
bound to the top-level working tree, to match 'path', despite the
extra and unnecessary trailing slash (such a slash is often
given by command line completion).

* nd/submodule-pathspec-ending-with-slash:
  clean: use cache_name_is_other()
  clean: replace match_pathspec() with dir_path_match()
  pathspec: pass directory indicator to match_pathspec_item()
  match_pathspec: match pathspec "foo/" against directory "foo"
  dir.c: prepare match_pathspec_item for taking more flags
  pathspec: rename match_pathspec_depth() to match_pathspec()
  pathspec: convert some match_pathspec_depth() to dir_path_match()
  pathspec: convert some match_pathspec_depth() to ce_path_match()

10 years agoMerge branch 'rs/grep-h-c'
Junio C Hamano [Tue, 18 Mar 2014 20:51:20 +0000 (13:51 -0700)] 
Merge branch 'rs/grep-h-c'

"git grep" learns to handle combination of "-h (no header)" and "-c
(counts)".

* rs/grep-h-c:
  grep: support -h (no header) with --count
  t7810: add missing variables to tests in loop

10 years agoMerge branch 'rm/strchrnul-not-strlen'
Junio C Hamano [Tue, 18 Mar 2014 20:51:18 +0000 (13:51 -0700)] 
Merge branch 'rm/strchrnul-not-strlen'

* rm/strchrnul-not-strlen:
  use strchrnul() in place of strchr() and strlen()

10 years agoMerge branch 'jc/tag-contains-with'
Junio C Hamano [Tue, 18 Mar 2014 20:51:14 +0000 (13:51 -0700)] 
Merge branch 'jc/tag-contains-with'

* jc/tag-contains-with:
  tag: grok "--with" as synonym to "--contains"

10 years agoMerge branch 'bg/install-branch-config-skip-prefix'
Junio C Hamano [Tue, 18 Mar 2014 20:51:09 +0000 (13:51 -0700)] 
Merge branch 'bg/install-branch-config-skip-prefix'

* bg/install-branch-config-skip-prefix:
  branch: use skip_prefix() in install_branch_config()
  t3200-branch: test setting branch as own upstream

10 years agoMerge branch 'jc/no-need-for-env-in-sh-scripts'
Junio C Hamano [Tue, 18 Mar 2014 20:51:07 +0000 (13:51 -0700)] 
Merge branch 'jc/no-need-for-env-in-sh-scripts'

* jc/no-need-for-env-in-sh-scripts:
  *.sh: drop useless use of "env"

10 years agoMerge branch 'sh/use-hashcpy'
Junio C Hamano [Tue, 18 Mar 2014 20:51:04 +0000 (13:51 -0700)] 
Merge branch 'sh/use-hashcpy'

* sh/use-hashcpy:
  Use hashcpy() when copying object names

10 years agoMerge branch 'mh/simplify-cache-tree-find'
Junio C Hamano [Tue, 18 Mar 2014 20:51:02 +0000 (13:51 -0700)] 
Merge branch 'mh/simplify-cache-tree-find'

* mh/simplify-cache-tree-find:
  cache_tree_find(): use path variable when passing over slashes
  cache_tree_find(): remove early return
  cache_tree_find(): remove redundant check
  cache_tree_find(): fix comment formatting
  cache_tree_find(): find the end of path component using strchrnul()
  cache_tree_find(): remove redundant checks

10 years agoMerge branch 'jn/branch-lift-unnecessary-name-length-limit'
Junio C Hamano [Tue, 18 Mar 2014 20:50:48 +0000 (13:50 -0700)] 
Merge branch 'jn/branch-lift-unnecessary-name-length-limit'

* jn/branch-lift-unnecessary-name-length-limit:
  branch.c: delete size check of newly tracked branch names

10 years agoMerge branch 'jk/doc-deprecate-grafts'
Junio C Hamano [Tue, 18 Mar 2014 20:50:40 +0000 (13:50 -0700)] 
Merge branch 'jk/doc-deprecate-grafts'

* jk/doc-deprecate-grafts:
  docs: mark info/grafts as outdated

10 years agoMerge branch 'jk/detect-push-typo-early'
Junio C Hamano [Tue, 18 Mar 2014 20:50:33 +0000 (13:50 -0700)] 
Merge branch 'jk/detect-push-typo-early'

Catch "git push $there no-such-branch" early.

* jk/detect-push-typo-early:
  push: detect local refspec errors early
  match_explicit_lhs: allow a "verify only" mode
  match_explicit: hoist refspec lhs checks into their own function

10 years agoMerge branch 'jk/repack-pack-keep-objects'
Junio C Hamano [Tue, 18 Mar 2014 20:50:29 +0000 (13:50 -0700)] 
Merge branch 'jk/repack-pack-keep-objects'

* jk/repack-pack-keep-objects:
  repack: add `repack.packKeptObjects` config var

10 years agoMerge branch 'sh/finish-tmp-packfile'
Junio C Hamano [Tue, 18 Mar 2014 20:50:24 +0000 (13:50 -0700)] 
Merge branch 'sh/finish-tmp-packfile'

* sh/finish-tmp-packfile:
  finish_tmp_packfile():use strbuf for pathname construction

10 years agoMerge branch 'dd/use-alloc-grow'
Junio C Hamano [Tue, 18 Mar 2014 20:50:21 +0000 (13:50 -0700)] 
Merge branch 'dd/use-alloc-grow'

Replace open-coded reallocation with ALLOC_GROW() macro.

* dd/use-alloc-grow:
  sha1_file.c: use ALLOC_GROW() in pretend_sha1_file()
  read-cache.c: use ALLOC_GROW() in add_index_entry()
  builtin/mktree.c: use ALLOC_GROW() in append_to_tree()
  attr.c: use ALLOC_GROW() in handle_attr_line()
  dir.c: use ALLOC_GROW() in create_simplify()
  reflog-walk.c: use ALLOC_GROW()
  replace_object.c: use ALLOC_GROW() in register_replace_object()
  patch-ids.c: use ALLOC_GROW() in add_commit()
  diffcore-rename.c: use ALLOC_GROW()
  diff.c: use ALLOC_GROW()
  commit.c: use ALLOC_GROW() in register_commit_graft()
  cache-tree.c: use ALLOC_GROW() in find_subtree()
  bundle.c: use ALLOC_GROW() in add_to_ref_list()
  builtin/pack-objects.c: use ALLOC_GROW() in check_pbase_path()

10 years agoMerge branch 'dd/find-graft-with-sha1-pos'
Junio C Hamano [Tue, 18 Mar 2014 20:50:11 +0000 (13:50 -0700)] 
Merge branch 'dd/find-graft-with-sha1-pos'

Replace a hand-rolled binary search with a call to our generic
binary search helper function.

* dd/find-graft-with-sha1-pos:
  commit.c: use the generic "sha1_pos" function for lookup

10 years agoMerge branch 'fc/transport-helper-fixes'
Junio C Hamano [Tue, 18 Mar 2014 20:49:32 +0000 (13:49 -0700)] 
Merge branch 'fc/transport-helper-fixes'

Updates transport-helper, fast-import and fast-export to allow the
ref mapping and ref deletion in a way similar to the natively
supported transports.

* fc/transport-helper-fixes:
  remote-bzr: support the new 'force' option
  test-hg.sh: tests are now expected to pass
  transport-helper.c: do not overwrite forced bit
  transport-helper: check for 'forced update' message
  transport-helper: add 'force' to 'export' helpers
  transport-helper: don't update refs in dry-run
  transport-helper: mismerge fix

10 years agoMerge branch 'nd/sha1-file-delta-stack-leakage-fix'
Junio C Hamano [Tue, 18 Mar 2014 20:49:22 +0000 (13:49 -0700)] 
Merge branch 'nd/sha1-file-delta-stack-leakage-fix'

Fix a small leak in the delta stack used when resolving a long
delta chain at runtime.

* nd/sha1-file-delta-stack-leakage-fix:
  sha1_file: fix delta_stack memory leak in unpack_entry

10 years agoMerge branch 'jk/diff-filespec-cleanup'
Junio C Hamano [Tue, 18 Mar 2014 20:48:50 +0000 (13:48 -0700)] 
Merge branch 'jk/diff-filespec-cleanup'

Portability fix to a topic already in v1.9

* jk/diff-filespec-cleanup:
  diffcore.h: be explicit about the signedness of is_binary

10 years agoMerge branch 'jk/clean-d-pathspec'
Junio C Hamano [Tue, 18 Mar 2014 20:47:57 +0000 (13:47 -0700)] 
Merge branch 'jk/clean-d-pathspec'

"git clean -d pathspec" did not use the given pathspec correctly
and ended up cleaning too much.

* jk/clean-d-pathspec:
  clean: simplify dir/not-dir logic
  clean: respect pathspecs with "-d"

10 years agoshallow: verify shallow file after taking lock
Jeff King [Sat, 15 Mar 2014 03:47:06 +0000 (23:47 -0400)] 
shallow: verify shallow file after taking lock

Before writing the shallow file, we stat() the existing file
to make sure it has not been updated since our operation
began. However, we do not do so under a lock, so there is a
possible race:

  1. Process A takes the lock.

  2. Process B calls check_shallow_file_for_update and finds
     no update.

  3. Process A commits the lockfile.

  4. Process B takes the lock, then overwrite's process A's
     changes.

We can fix this by doing our check while we hold the lock.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoUpdate draft release notes to Git 2.0
Junio C Hamano [Thu, 13 Mar 2014 21:01:17 +0000 (14:01 -0700)] 
Update draft release notes to Git 2.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'ta/parse-commit-with-skip-prefix'
Junio C Hamano [Fri, 14 Mar 2014 21:27:23 +0000 (14:27 -0700)] 
Merge branch 'ta/parse-commit-with-skip-prefix'

* ta/parse-commit-with-skip-prefix:
  commit.c: use skip_prefix() instead of starts_with()

10 years agoMerge branch 'sr/add--interactive-term-readkey'
Junio C Hamano [Fri, 14 Mar 2014 21:27:21 +0000 (14:27 -0700)] 
Merge branch 'sr/add--interactive-term-readkey'

* sr/add--interactive-term-readkey:
  git-add--interactive: warn if module for interactive.singlekey is missing
  git-config: document interactive.singlekey requires Term::ReadKey

10 years agoMerge branch 'sh/write-pack-file-warning-message-fix'
Junio C Hamano [Fri, 14 Mar 2014 21:27:16 +0000 (14:27 -0700)] 
Merge branch 'sh/write-pack-file-warning-message-fix'

A warning from "git pack-objects" were generated by referring to an
incorrect variable when forming the filename that we had trouble
with.

* sh/write-pack-file-warning-message-fix:
  write_pack_file: use correct variable in diagnostic

10 years agoMerge branch 'nd/strbuf-inline-styles'
Junio C Hamano [Fri, 14 Mar 2014 21:27:13 +0000 (14:27 -0700)] 
Merge branch 'nd/strbuf-inline-styles'

* nd/strbuf-inline-styles:
  strbuf: style fix -- top opening bracket on a separate line

10 years agoMerge branch 'jn/bisect-coding-style'
Junio C Hamano [Fri, 14 Mar 2014 21:27:11 +0000 (14:27 -0700)] 
Merge branch 'jn/bisect-coding-style'

* jn/bisect-coding-style:
  git-bisect.sh: fix a few style issues

10 years agoMerge branch 'mh/replace-refs-variable-rename'
Junio C Hamano [Fri, 14 Mar 2014 21:27:06 +0000 (14:27 -0700)] 
Merge branch 'mh/replace-refs-variable-rename'

* mh/replace-refs-variable-rename:
  Document some functions defined in object.c
  Add docstrings for lookup_replace_object() and do_lookup_replace_object()
  rename read_replace_refs to check_replace_refs

10 years agoMerge branch 'sg/archive-restrict-remote'
Junio C Hamano [Fri, 14 Mar 2014 21:27:02 +0000 (14:27 -0700)] 
Merge branch 'sg/archive-restrict-remote'

Allow loosening remote "git archive" invocation security check that
refuses to serve tree-ish not at the tip of any ref.

* sg/archive-restrict-remote:
  add uploadarchive.allowUnreachable option
  docs: clarify remote restrictions for git-upload-archive

10 years agoMerge branch 'rt/help-pretty-prints-cmd-names'
Junio C Hamano [Fri, 14 Mar 2014 21:27:00 +0000 (14:27 -0700)] 
Merge branch 'rt/help-pretty-prints-cmd-names'

* rt/help-pretty-prints-cmd-names:
  help.c: rename function "pretty_print_string_list"

10 years agoMerge branch 'jl/doc-submodule-update-checkout'
Junio C Hamano [Fri, 14 Mar 2014 21:26:58 +0000 (14:26 -0700)] 
Merge branch 'jl/doc-submodule-update-checkout'

Add missing documentation for "submodule update --checkout".

* jl/doc-submodule-update-checkout:
  submodule update: consistently document the '--checkout' option

10 years agoMerge branch 'jk/doc-coding-guideline'
Junio C Hamano [Fri, 14 Mar 2014 21:26:55 +0000 (14:26 -0700)] 
Merge branch 'jk/doc-coding-guideline'

Elaborate on a style niggle that has been part of "mimic existing
code".

* jk/doc-coding-guideline:
  CodingGuidelines: mention C whitespace rules

10 years agoMerge branch 'da/difftool-git-files'
Junio C Hamano [Fri, 14 Mar 2014 21:26:52 +0000 (14:26 -0700)] 
Merge branch 'da/difftool-git-files'

"git difftool" misbehaved when the repository is bound to the
working tree with the ".git file" mechanism, where a textual
file ".git" tells us where it is.

* da/difftool-git-files:
  t7800: add a difftool test for .git-files
  difftool: support repositories with .git-files

10 years agoMerge branch 'tg/index-v4-format'
Junio C Hamano [Fri, 14 Mar 2014 21:26:50 +0000 (14:26 -0700)] 
Merge branch 'tg/index-v4-format'

* tg/index-v4-format:
  read-cache: add index.version config variable
  test-lib: allow setting the index format version
  introduce GIT_INDEX_VERSION environment variable

10 years agoMerge branch 'nd/i18n-progress'
Junio C Hamano [Fri, 14 Mar 2014 21:26:31 +0000 (14:26 -0700)] 
Merge branch 'nd/i18n-progress'

Mark the progress indicators from various time-consuming commands
for i18n/l10n.

* nd/i18n-progress:
  i18n: mark all progress lines for translation

10 years agoMerge branch 'mh/object-code-cleanup'
Junio C Hamano [Fri, 14 Mar 2014 21:26:29 +0000 (14:26 -0700)] 
Merge branch 'mh/object-code-cleanup'

* mh/object-code-cleanup:
  sha1_file.c: document a bunch of functions defined in the file
  sha1_file_name(): declare to return a const string
  find_pack_entry(): document last_found_pack
  replace_object: use struct members instead of an array

10 years agoMerge branch 'jn/am-doc-hooks'
Junio C Hamano [Fri, 14 Mar 2014 21:26:27 +0000 (14:26 -0700)] 
Merge branch 'jn/am-doc-hooks'

* jn/am-doc-hooks:
  am doc: add a pointer to relevant hooks

10 years agoMerge branch 'jm/stash-doc-k-for-keep'
Junio C Hamano [Fri, 14 Mar 2014 21:26:22 +0000 (14:26 -0700)] 
Merge branch 'jm/stash-doc-k-for-keep'

* jm/stash-doc-k-for-keep:
  stash doc: mention short form -k in save description

10 years agoMerge branch 'jk/remote-pushremote-config-reading'
Junio C Hamano [Fri, 14 Mar 2014 21:26:04 +0000 (14:26 -0700)] 
Merge branch 'jk/remote-pushremote-config-reading'

"git push" did not pay attention to branch.*.pushremote if it is
defined earlier than remote.pushdefault; the order of these two
variables in the configuration file should not matter, but it did by
mistake.

* jk/remote-pushremote-config-reading:
  remote: handle pushremote config in any order

10 years agoMerge branch 'jk/commit-dates-parsing-fix'
Junio C Hamano [Fri, 14 Mar 2014 21:25:44 +0000 (14:25 -0700)] 
Merge branch 'jk/commit-dates-parsing-fix'

Tighten codepaths that parse timestamps in commit objects.

* jk/commit-dates-parsing-fix:
  show_ident_date: fix tz range check
  log: do not segfault on gmtime errors
  log: handle integer overflow in timestamps
  date: check date overflow against time_t
  fsck: report integer overflow in author timestamps
  t4212: test bogus timestamps with git-log

10 years agoMerge branch 'jh/note-trees-record-blobs'
Junio C Hamano [Fri, 14 Mar 2014 21:25:39 +0000 (14:25 -0700)] 
Merge branch 'jh/note-trees-record-blobs'

"git notes -C <blob>" should not take an object that is not a blob.

* jh/note-trees-record-blobs:
  notes: disallow reusing non-blob as a note object

10 years agoMerge branch 'rt/links-for-asciidoctor'
Junio C Hamano [Fri, 14 Mar 2014 21:25:36 +0000 (14:25 -0700)] 
Merge branch 'rt/links-for-asciidoctor'

* rt/links-for-asciidoctor:
  Documentation: fix documentation AsciiDoc links for external urls

10 years agoMerge branch 'nd/no-more-fnmatch'
Junio C Hamano [Fri, 14 Mar 2014 21:25:31 +0000 (14:25 -0700)] 
Merge branch 'nd/no-more-fnmatch'

We started using wildmatch() in place of fnmatch(3); complete the
process and stop using fnmatch(3).

* nd/no-more-fnmatch:
  actually remove compat fnmatch source code
  stop using fnmatch (either native or compat)
  Revert "test-wildmatch: add "perf" command to compare wildmatch and fnmatch"
  use wildmatch() directly without fnmatch() wrapper

10 years agoMerge branch 'ak/gitweb-fit-image'
Junio C Hamano [Fri, 14 Mar 2014 21:25:28 +0000 (14:25 -0700)] 
Merge branch 'ak/gitweb-fit-image'

Instead of allowing an <img> to be shown in whatever size, force
scaling it to fit on the page with max-height/max-width css style
attributes.

* ak/gitweb-fit-image:
  gitweb: Avoid overflowing page body frame with large images

10 years agoMerge branch 'tr/diff-submodule-no-reuse-worktree'
Junio C Hamano [Fri, 14 Mar 2014 21:25:20 +0000 (14:25 -0700)] 
Merge branch 'tr/diff-submodule-no-reuse-worktree'

"git diff --external-diff" incorrectly fed the submodule directory
in the working tree to the external diff driver when it knew it is
the same as one of the versions being compared.

* tr/diff-submodule-no-reuse-worktree:
  diff: do not reuse_worktree_file for submodules

10 years agoMerge branch 'nd/reset-setup-worktree'
Junio C Hamano [Fri, 14 Mar 2014 21:25:02 +0000 (14:25 -0700)] 
Merge branch 'nd/reset-setup-worktree'

"git reset" needs to refresh the index when working in a working
tree (it can also be used to match the index to the HEAD in an
otherwise bare repository), but it failed to set up the working
tree properly, causing GIT_WORK_TREE to be ignored.

* nd/reset-setup-worktree:
  reset: optionally setup worktree and refresh index on --mixed

10 years agoMerge branch 'lb/contrib-contacts-looser-diff-parsing'
Junio C Hamano [Fri, 14 Mar 2014 21:24:59 +0000 (14:24 -0700)] 
Merge branch 'lb/contrib-contacts-looser-diff-parsing'

* lb/contrib-contacts-looser-diff-parsing:
  git-contacts: do not fail parsing of good diffs

10 years agoMerge branch 'ks/config-file-stdin'
Junio C Hamano [Fri, 14 Mar 2014 21:24:40 +0000 (14:24 -0700)] 
Merge branch 'ks/config-file-stdin'

"git config" learned to read from the standard input when "-" is
given as the value to its "--file" parameter (attempting an
operation to update the configuration in the standard input of
course is rejected).

* ks/config-file-stdin:
  config: teach "git config --file -" to read from the standard input
  config: change git_config_with_options() interface
  builtin/config.c: rename check_blob_write() -> check_write()
  config: disallow relative include paths from blobs

10 years agoMerge branch 'jk/janitorial-fixes'
Junio C Hamano [Fri, 14 Mar 2014 21:24:37 +0000 (14:24 -0700)] 
Merge branch 'jk/janitorial-fixes'

* jk/janitorial-fixes:
  open_istream(): do not dereference NULL in the error case
  builtin/mv: don't use memory after free
  utf8: use correct type for values in interval table
  utf8: fix iconv error detection
  notes-utils: handle boolean notes.rewritemode correctly

10 years agoMerge branch 'jk/http-no-curl-easy'
Junio C Hamano [Fri, 14 Mar 2014 21:24:18 +0000 (14:24 -0700)] 
Merge branch 'jk/http-no-curl-easy'

Uses of curl's "multi" interface and "easy" interface do not mix
well when we attempt to reuse outgoing connections.  Teach the RPC
over http code, used in the smart HTTP transport, not to use the
"easy" interface.

* jk/http-no-curl-easy:
  http: never use curl_easy_perform

10 years agoMerge branch 'ss/completion-rec-sub-fetch-push'
Junio C Hamano [Fri, 14 Mar 2014 21:24:15 +0000 (14:24 -0700)] 
Merge branch 'ss/completion-rec-sub-fetch-push'

* ss/completion-rec-sub-fetch-push:
  completion: teach --recurse-submodules to fetch, pull and push

10 years agoMerge branch 'nd/gitignore-trailing-whitespace'
Junio C Hamano [Fri, 14 Mar 2014 21:23:37 +0000 (14:23 -0700)] 
Merge branch 'nd/gitignore-trailing-whitespace'

Trailing whitespaces in .gitignore files, unless they are quoted for
fnmatch(3), e.g. "path\ ", are warned and ignored.

Strictly speaking, this is a backward incompatible change, but very
unlikely to bite any sane user and adjusting should be obvious and
easy.

* nd/gitignore-trailing-whitespace:
  t0008: skip trailing space test on Windows
  dir: ignore trailing spaces in exclude patterns
  dir: warn about trailing spaces in exclude patterns

10 years agoMerge branch 'jc/check-attr-honor-working-tree'
Junio C Hamano [Fri, 14 Mar 2014 21:05:59 +0000 (14:05 -0700)] 
Merge branch 'jc/check-attr-honor-working-tree'

"git check-attr" when (trying to) work on a repository with a
working tree did not work well when the working tree was specified
via --work-tree (and obviously with --git-dir).

The command also works in a bare repository but it reads from the
(possibly stale, irrelevant and/or nonexistent) index, which may
need to be fixed to read from HEAD, but that is a completely
separate issue.  As a related tangent to this separate issue, we
may want to also fix "check-ignore", which refuses to work in a
bare repository, to also operate in a bare one.

* jc/check-attr-honor-working-tree:
  check-attr: move to the top of working tree when in non-bare repository
  t0003: do not chdir the whole test process

10 years agowt-status: lift the artificual "at least 20 columns" floor
Junio C Hamano [Wed, 12 Mar 2014 20:43:51 +0000 (13:43 -0700)] 
wt-status: lift the artificual "at least 20 columns" floor

When we show unmerged paths, we had an artificial 20 columns floor
for the width of labels (e.g. "both deleted:") shown next to the
pathnames.  Depending on the locale, this may result in a label that
is too wide when all the label strings are way shorter than 20
columns, or no-op when a label string is longer than 20 columns.

Just drop the artificial floor.  The screen real estate is better
utilized this way when all the strings are shorter.

Adjust the tests to this change.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agowt-status: i18n of section labels
Jonathan Nieder [Thu, 19 Dec 2013 19:43:19 +0000 (11:43 -0800)] 
wt-status: i18n of section labels

The original code assumes that:

 (1) the number of bytes written is the width of a string, so they
     can line up;

 (2) the "how" string is always <= 19 bytes.

Neither of which we should assume.

Using the same approach as the earlier 3651e45c (wt-status: take the
alignment burden off translators, 2013-11-05), compute the necessary
column width to hold the longest label and use that for alignment.

cf. http://bugs.debian.org/725777

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Helped-by: Sandy Carter
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agowt-status: extract the code to compute width for labels
Jonathan Nieder [Thu, 19 Dec 2013 19:43:19 +0000 (11:43 -0800)] 
wt-status: extract the code to compute width for labels

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agowt-status: make full label string to be subject to l10n
Junio C Hamano [Wed, 12 Mar 2014 20:51:22 +0000 (13:51 -0700)] 
wt-status: make full label string to be subject to l10n

Earlier in 3651e45c (wt-status: take the alignment burden off
translators, 2013-11-05), we assumed that it is OK to make the
string before the colon in a label string we give as the section
header of various kinds of changes (e.g. "new file:") translatable.

This assumption apparently does not hold for some languages,
e.g. ones that want to have spaces around the colon.

Also introduce a static label_width to avoid having to run
strlen(padding) over and over.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agogrep: support -h (no header) with --count
René Scharfe [Tue, 11 Mar 2014 21:15:49 +0000 (22:15 +0100)] 
grep: support -h (no header) with --count

Suppress printing the header (filename) with -h even if in -c/--count
mode.  GNU grep and OpenBSD's grep do the same.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot7810: add missing variables to tests in loop
René Scharfe [Tue, 11 Mar 2014 21:07:58 +0000 (22:07 +0100)] 
t7810: add missing variables to tests in loop

Some tests in t7810-grep.sh are in a loop that runs them against HEAD and
the work tree.  In order for that to work the test code should use the
variables $L (display name), $H (HEAD or empty string) and $HC (revision
prefix for result lines); otherwise tests are just repeated with the same
target.  Add the variables where they're missing and make sure the test
description is wrapped in double quotes (instead of single quotes) to
allow variables to be expanded.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoupload-pack: send shallow info over stdin to pack-objects
Nguyễn Thái Ngọc Duy [Tue, 11 Mar 2014 12:59:46 +0000 (19:59 +0700)] 
upload-pack: send shallow info over stdin to pack-objects

Before cdab485 (upload-pack: delegate rev walking in shallow fetch to
pack-objects - 2013-08-16) upload-pack does not write to the source
repository. cdab485 starts to write $GIT_DIR/shallow_XXXXXX if it's a
shallow fetch, so the source repo must be writable.

git:// servers do not need write access to repos and usually don't
have it, which means cdab485 breaks shallow clone over git://

Instead of using a temporary file as the media for shallow points, we
can send them over stdin to pack-objects as well. Prepend shallow
SHA-1 with --shallow so pack-objects knows what is what.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoclean: simplify dir/not-dir logic
Jeff King [Mon, 10 Mar 2014 17:24:47 +0000 (13:24 -0400)] 
clean: simplify dir/not-dir logic

When we get a list of paths from read_directory, we further
prune it to create the final list of items to remove. The
code paths for directories and non-directories repeat the
same "add to list" code.

This patch restructures the code so that we don't repeat
ourselves. Also, by following a "if (condition) continue"
pattern like the pathspec check above, it makes it more
obvious that the conditional is about excluding directories
under certain circumstances.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoclean: respect pathspecs with "-d"
Jeff King [Mon, 10 Mar 2014 20:37:30 +0000 (16:37 -0400)] 
clean: respect pathspecs with "-d"

git-clean uses read_directory to fill in a `struct dir` with
potential hits. However, read_directory does not actually
check against our pathspec. It uses a simplified version
that may turn up false positives. As a result, we need to
check that any hits match our pathspec. We do so reliably
for non-directories. For directories, if "-d" is not given
we check that the pathspec matched exactly (i.e., we are
even stricter, and require an explicit "git clean foo" to
clean "foo/"). But if "-d" is given, rather than relaxing
the exact match to allow a recursive match, we do not check
the pathspec at all.

This regression was introduced in 113f10f (Make git-clean a
builtin, 2007-11-11).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot0008: skip trailing space test on Windows
Johannes Sixt [Tue, 11 Mar 2014 07:46:40 +0000 (08:46 +0100)] 
t0008: skip trailing space test on Windows

The Windows API does not preserve file names with trailing spaces (and
dots), but rather strips them. Our tools (MSYS bash, git) base the POSIX
emulation on the Windows API. As a consequence, it is impossible for bash
on Windows to allocate a file whose name has trailing spaces, and for git
to stat such a file. Both operate on a file whose name has the spaces
stripped. Skip the test that needs such a file name.

Note that we do not use (another incarnation of) prerequisite FUNNYNAMES.
The reason is that FUNNYNAMES is intended to represent a property of the
file system. But the inability to have trailing spaces in a file name is
a property of the Windows API. The file system (NTFS) does not have this
limitation.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agouse strchrnul() in place of strchr() and strlen()
Rohit Mani [Sat, 8 Mar 2014 06:48:31 +0000 (22:48 -0800)] 
use strchrnul() in place of strchr() and strlen()

Avoid scanning strings twice, once with strchr() and then with
strlen(), by using strchrnul().

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Rohit Mani <rohit.mani@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoStart preparing for Git 2.0
Junio C Hamano [Fri, 7 Mar 2014 23:12:19 +0000 (15:12 -0800)] 
Start preparing for Git 2.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'cc/starts-n-ends-with-endgame'
Junio C Hamano [Fri, 7 Mar 2014 23:18:17 +0000 (15:18 -0800)] 
Merge branch 'cc/starts-n-ends-with-endgame'

prefixcmp/suffixcmp are gone.

10 years agoMerge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion'
Junio C Hamano [Fri, 7 Mar 2014 23:17:40 +0000 (15:17 -0800)] 
Merge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion'

Remove a confusing and deprecated "-q" option from "git diff-files";
"git diff-files --diff-filter=d" can be used instead.

10 years agoMerge branch 'gj/push-more-verbose-advice'
Junio C Hamano [Fri, 7 Mar 2014 23:17:20 +0000 (15:17 -0800)] 
Merge branch 'gj/push-more-verbose-advice'

10 years agoMerge branch 'jc/core-checkstat-2.0'
Junio C Hamano [Fri, 7 Mar 2014 23:16:22 +0000 (15:16 -0800)] 
Merge branch 'jc/core-checkstat-2.0'

"core.statinfo" configuration variable, which was a never-advertised
synonym to "core.checkstat", has been removed.

10 years agoMerge branch 'jc/add-2.0-ignore-removal'
Junio C Hamano [Fri, 7 Mar 2014 23:14:47 +0000 (15:14 -0800)] 
Merge branch 'jc/add-2.0-ignore-removal'

"git add <pathspec>" is the same as "git add -A <pathspec>" now,
i.e. it does not ignore removals from the directory specified.

10 years agoMerge branch 'jn/add-2.0-u-A-sans-pathspec'
Junio C Hamano [Fri, 7 Mar 2014 23:14:01 +0000 (15:14 -0800)] 
Merge branch 'jn/add-2.0-u-A-sans-pathspec'

"git add -u" and "git add -A" without any pathspec is a tree-wide
operation now, even when they are run in a subdirectory of the
working tree.

10 years agoMerge branch 'jc/push-2.0-default-to-simple'
Junio C Hamano [Fri, 7 Mar 2014 23:13:15 +0000 (15:13 -0800)] 
Merge branch 'jc/push-2.0-default-to-simple'

Finally update the "git push" default behaviour to "simple".

10 years agotag: grok "--with" as synonym to "--contains"
Junio C Hamano [Fri, 7 Mar 2014 20:07:35 +0000 (12:07 -0800)] 
tag: grok "--with" as synonym to "--contains"

Just like "git branch" can be told to list the branches that has the
named commit by "git branch --with <commit>", teach the same
short-hand to "git tag", so that "git tag --with <commit>" shows the
releases with the named commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoshow_ident_date: fix tz range check
Jeff King [Fri, 7 Mar 2014 17:15:01 +0000 (12:15 -0500)] 
show_ident_date: fix tz range check

Commit 1dca155fe3fa (log: handle integer overflow in
timestamps, 2014-02-24) tried to catch integer overflow
coming from strtol() on the timezone field by comparing against
LONG_MIN/LONG_MAX. However, the intermediate "tz" variable
is an "int", which means it can never be LONG_MAX on LP64
systems; we would truncate the output from strtol before the
comparison.

Clang's -Wtautological-constant-out-of-range-compare notices
this and rightly complains.

Let's instead store the result of strtol in a long, and then
compare it against INT_MIN/INT_MAX. This will catch overflow
from strtol, and also overflow when we pass the result as an
int to show_date.

Reported-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years ago*.sh: drop useless use of "env"
Junio C Hamano [Thu, 6 Mar 2014 23:22:34 +0000 (15:22 -0800)] 
*.sh: drop useless use of "env"

In a bourne shell script, "VAR=VAL command" is sufficient to run
'command' with environment variable VAR set to value VAL without
affecting the environment of the shell itself; there is no need
to say "env VAR=VAL command".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoUse hashcpy() when copying object names
Sun He [Mon, 3 Mar 2014 09:39:59 +0000 (17:39 +0800)] 
Use hashcpy() when copying object names

We invented hashcpy() to keep the abstraction of "object name"
behind it.  Use it instead of calling memcpy() with hard-coded
20-byte length when moving object names between pieces of memory.

Leave ppc/sha1.c as-is, because the function is about the SHA-1 hash
algorithm whose output is and will always be 20 bytes.

Helped-by: Michael Haggerty <mhagger@alum.mit.edu>
Helped-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Sun He <sunheehnus@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agobranch: use skip_prefix() in install_branch_config()
Brian Gesiak [Fri, 28 Feb 2014 06:43:33 +0000 (15:43 +0900)] 
branch: use skip_prefix() in install_branch_config()

The install_branch_config() function reimplemented the skip_prefix()
function inline.

Reported-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot3200-branch: test setting branch as own upstream
Brian Gesiak [Wed, 5 Mar 2014 07:31:55 +0000 (16:31 +0900)] 
t3200-branch: test setting branch as own upstream

No test asserts that "git branch -u refs/heads/my-branch my-branch"
avoids leaving nonsense configuration and emits a warning.

Add a test that does so.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'maint'
Junio C Hamano [Wed, 5 Mar 2014 23:06:59 +0000 (15:06 -0800)] 
Merge branch 'maint'

* maint:
  i18n: proposed command missing leading dash