]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
8 years agoref-filter: add parse_opt_merge_filter()
Karthik Nayak [Tue, 7 Jul 2015 16:06:11 +0000 (21:36 +0530)] 
ref-filter: add parse_opt_merge_filter()

Add 'parse_opt_merge_filter()' to parse '--merged' and '--no-merged'
options and write macros for the same.

This is copied from 'builtin/branch.c' which will eventually be removed
when we port 'branch.c' to use ref-filter APIs.

Based-on-patch-by: Jeff King <peff@peff.net>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: add '--points-at' option
Karthik Nayak [Tue, 7 Jul 2015 16:06:10 +0000 (21:36 +0530)] 
for-each-ref: add '--points-at' option

Add the '--points-at' option provided by 'ref-filter'. The
option lets the user to list only refs which points at the
given object.

Add documentation and tests for the same.

Based-on-patch-by: Jeff King <peff@peff.net>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoref-filter: implement '--points-at' option
Karthik Nayak [Tue, 7 Jul 2015 16:06:09 +0000 (21:36 +0530)] 
ref-filter: implement '--points-at' option

In 'tag -l' we have '--points-at' option which lets users
list only tags of a given object. Implement this option in
'ref-filter.{c,h}' so that other commands can benefit from this.

This is duplicated from tag.c, we will eventually remove that
when we port tag.c to use ref-filter APIs.

Based-on-patch-by: Jeff King <peff@peff.net>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotag: libify parse_opt_points_at()
Karthik Nayak [Tue, 7 Jul 2015 16:06:08 +0000 (21:36 +0530)] 
tag: libify parse_opt_points_at()

Rename 'parse_opt_points_at()' to 'parse_opt_object_name()' and
move it from 'tag.c' to 'parse-options'. This now acts as a common
parse_opt function which accepts an objectname and stores it into
a sha1_array.

Based-on-patch-by: Jeff King <peff@peff.net>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot6302: for-each-ref tests for ref-filter APIs
Karthik Nayak [Thu, 9 Jul 2015 06:03:21 +0000 (11:33 +0530)] 
t6302: for-each-ref tests for ref-filter APIs

Add a test suite for testing the ref-filter APIs used
by for-each-ref. We just intialize the test suite for now.
More tests will be added in the following patches as more
options are added to for-each-ref.

Based-on-patch-by: Jeff King <peff@peff.net>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoref-filter: make 'ref_array_item' use a FLEX_ARRAY for refname
Karthik Nayak [Sat, 13 Jun 2015 19:37:29 +0000 (01:07 +0530)] 
ref-filter: make 'ref_array_item' use a FLEX_ARRAY for refname

This would remove the need of using a pointer to store refname.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: introduce filter_refs()
Karthik Nayak [Sat, 13 Jun 2015 19:37:28 +0000 (01:07 +0530)] 
for-each-ref: introduce filter_refs()

Introduce filter_refs() which will act as an API for filtering
a set of refs. Based on the type of refs the user has requested,
we iterate through those refs and apply filters as per the
given ref_filter structure and finally store the filtered refs
in the ref_array structure.

Currently this will wrap around ref_filter_handler(). Hence,
ref_filter_handler is made file scope static.

As users of this API will no longer send a ref_filter_cbdata
structure directly, we make the elements of ref_filter_cbdata
pointers. We can now use the information given by the users
to obtain our own ref_filter_cbdata structure. Changes are made to
support the change in ref_filter_cbdata structure.

Make 'for-each-ref' use this API.

Helped-by: Junio C Hamano <gitster@pobox.com>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoref-filter: move code from 'for-each-ref'
Karthik Nayak [Sat, 13 Jun 2015 19:37:27 +0000 (01:07 +0530)] 
ref-filter: move code from 'for-each-ref'

Move most of the code from 'for-each-ref' to 'ref-filter' to make
it publicly available to other commands, this is to unify the code
of 'tag -l', 'branch -l' and 'for-each-ref' so that they can share
their implementations with each other.

Add 'ref-filter' to the Makefile, this completes the movement of code
from 'for-each-ref' to 'ref-filter'.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoref-filter: add 'ref-filter.h'
Karthik Nayak [Sat, 13 Jun 2015 19:37:26 +0000 (01:07 +0530)] 
ref-filter: add 'ref-filter.h'

This is step one of creating a common library for 'for-each-ref',
'branch -l' and 'tag -l'. This creates a header file with the
functions and data structures that ref-filter will provide.
We move the data structures created in for-each-ref to this header
file.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: rename variables called sort to sorting
Karthik Nayak [Sat, 13 Jun 2015 19:37:25 +0000 (01:07 +0530)] 
for-each-ref: rename variables called sort to sorting

Rename all the variables called sort to sorting to match the
function/structure name changes made in the previous patch.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: rename some functions and make them public
Karthik Nayak [Sat, 13 Jun 2015 19:37:24 +0000 (01:07 +0530)] 
for-each-ref: rename some functions and make them public

Rename some of the functions and make them publicly available.
This is a preparatory step for moving code from 'for-each-ref'
to 'ref-filter' to make meaningful, targeted services available to
other commands via public APIs.

Functions renamed are:
parse_atom() ->  parse_ref_filter_atom()
verify_format() ->  verify_ref_format()
get_value() ->  get_ref_atom_value()
grab_single_ref() ->  ref_filter_handler()
sort_refs() -> ref_array_sort()
show_ref() -> show_ref_array_item()
default_sort() -> ref_default_sorting()
opt_parse_sort() -> parse_opt_ref_sorting()
cmp_ref_sort() -> cmp_ref_sorting()

Rename 'struct ref_sort' to 'struct ref_sorting' in this context.

Based-on-patch-by: Jeff King <peff@peff.net>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: introduce 'ref_array_clear()'
Karthik Nayak [Sat, 13 Jun 2015 19:37:23 +0000 (01:07 +0530)] 
for-each-ref: introduce 'ref_array_clear()'

Introduce and implement 'ref_array_clear()' which will free
all allocated memory for 'ref_array'.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: introduce new structures for better organisation
Karthik Nayak [Sat, 13 Jun 2015 19:37:22 +0000 (01:07 +0530)] 
for-each-ref: introduce new structures for better organisation

Introduce 'ref_filter_cbdata' which will hold 'ref_filter'
(conditions to filter the refs on) and 'ref_array' (the array
of ref_array_items). Modify the code to use these new structures.

This is a preparatory patch to eventually move code from 'for-each-ref'
to 'ref-filter' and make it publicly available.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: rename 'refinfo' to 'ref_array_item'
Karthik Nayak [Sat, 13 Jun 2015 19:37:21 +0000 (01:07 +0530)] 
for-each-ref: rename 'refinfo' to 'ref_array_item'

Rename 'refinfo' to 'ref_array_item' as a preparatory step for
introduction of new structures in the forthcoming patch.

Re-order the fields in 'ref_array_item' so that refname can be
eventually converted to a FLEX_ARRAY.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: clean up code
Karthik Nayak [Sat, 13 Jun 2015 19:37:20 +0000 (01:07 +0530)] 
for-each-ref: clean up code

In 'grab_single_ref()' remove the extra count variable 'cnt' and
use the variable 'grab_cnt' of structure 'grab_ref_cbdata' directly
instead.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofor-each-ref: extract helper functions out of grab_single_ref()
Karthik Nayak [Sat, 13 Jun 2015 19:37:19 +0000 (01:07 +0530)] 
for-each-ref: extract helper functions out of grab_single_ref()

Extract two helper functions out of grab_single_ref(). Firstly,
new_refinfo() which is used to allocate memory for a new refinfo
structure and copy the objectname, refname and flag to it.
Secondly, match_name_as_path() which when given an array of patterns
and the refname checks if the refname matches any of the patterns
given while the pattern is a pathname, also supports wildcard
characters.

This is a preperatory patch for restructuring 'for-each-ref' and
eventually moving most of it to 'ref-filter' to provide the
functionality to similar commands via public API's.

Helped-by: Junio C Hamano <gitster@pobox.com>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSecond half of seventh batch
Junio C Hamano [Thu, 11 Jun 2015 16:35:25 +0000 (09:35 -0700)] 
Second half of seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'tb/complete-sequencing'
Junio C Hamano [Thu, 11 Jun 2015 16:29:59 +0000 (09:29 -0700)] 
Merge branch 'tb/complete-sequencing'

The bash completion script (in contrib/) learned a few options that
"git revert" takes.

* tb/complete-sequencing:
  completion: suggest sequencer commands for revert

8 years agoMerge branch 'jk/squelch-missing-link-warning-for-unreachable'
Junio C Hamano [Thu, 11 Jun 2015 16:29:58 +0000 (09:29 -0700)] 
Merge branch 'jk/squelch-missing-link-warning-for-unreachable'

Recent "git prune" traverses young unreachable objects to safekeep
old objects in the reachability chain from them, which sometimes
caused error messages that are unnecessarily alarming.

* jk/squelch-missing-link-warning-for-unreachable:
  suppress errors on missing UNINTERESTING links
  silence broken link warnings with revs->ignore_missing_links
  add quieter versions of parse_{tree,commit}

8 years agoMerge branch 'pt/pull-tests'
Junio C Hamano [Thu, 11 Jun 2015 16:29:58 +0000 (09:29 -0700)] 
Merge branch 'pt/pull-tests'

Add more test coverage to "git pull".

* pt/pull-tests:
  t5520: check reflog action in fast-forward merge
  t5521: test --dry-run does not make any changes
  t5520: test --rebase failure on unborn branch with index
  t5520: test --rebase with multiple branches
  t5520: test work tree fast-forward when fetch updates head
  t5520: test for failure if index has unresolved entries
  t5520: test no merge candidates cases
  t5520: prevent field splitting in content comparisons

8 years agoMerge branch 'sb/glossary-submodule'
Junio C Hamano [Thu, 11 Jun 2015 16:29:57 +0000 (09:29 -0700)] 
Merge branch 'sb/glossary-submodule'

* sb/glossary-submodule:
  glossary: add "remote", "submodule", "superproject"

8 years agoMerge branch 'sb/submodule-doc-intro'
Junio C Hamano [Thu, 11 Jun 2015 16:29:56 +0000 (09:29 -0700)] 
Merge branch 'sb/submodule-doc-intro'

* sb/submodule-doc-intro:
  submodule doc: reorder introductory paragraphs

8 years agoMerge branch 'jk/diagnose-config-mmap-failure'
Junio C Hamano [Thu, 11 Jun 2015 16:29:55 +0000 (09:29 -0700)] 
Merge branch 'jk/diagnose-config-mmap-failure'

The configuration reader/writer uses mmap(2) interface to access
the files; when we find a directory, it barfed with "Out of memory?".

* jk/diagnose-config-mmap-failure:
  xmmap(): drop "Out of memory?"
  config.c: rewrite ENODEV into EISDIR when mmap fails
  config.c: avoid xmmap error messages
  config.c: fix mmap leak when writing config
  read-cache.c: drop PROT_WRITE from mmap of index

8 years agoMerge branch 'mt/p4-depotFile-at-version'
Junio C Hamano [Thu, 11 Jun 2015 16:29:55 +0000 (09:29 -0700)] 
Merge branch 'mt/p4-depotFile-at-version'

* mt/p4-depotFile-at-version:
  p4: retrieve the right revision of the file in UTF-16 codepath

8 years agoMerge branch 'mh/verify-lock-error-report'
Junio C Hamano [Thu, 11 Jun 2015 16:29:54 +0000 (09:29 -0700)] 
Merge branch 'mh/verify-lock-error-report'

Bring consistency to error reporting mechanism used in "refs" API.

* mh/verify-lock-error-report:
  ref_transaction_commit(): do not capitalize error messages
  verify_lock(): do not capitalize error messages
  verify_lock(): report errors via a strbuf
  verify_lock(): on errors, let the caller unlock the lock
  verify_lock(): return 0/-1 rather than struct ref_lock *

8 years agoMerge branch 'jk/color-diff-plain-is-context'
Junio C Hamano [Thu, 11 Jun 2015 16:29:53 +0000 (09:29 -0700)] 
Merge branch 'jk/color-diff-plain-is-context'

"color.diff.plain" was a misnomer; give it 'color.diff.context' as
a more logical synonym.

* jk/color-diff-plain-is-context:
  diff.h: rename DIFF_PLAIN color slot to DIFF_CONTEXT
  diff: accept color.diff.context as a synonym for "plain"

8 years agoMerge branch 'jk/clone-dissociate'
Junio C Hamano [Thu, 11 Jun 2015 16:29:52 +0000 (09:29 -0700)] 
Merge branch 'jk/clone-dissociate'

Code clean-up.

* jk/clone-dissociate:
  clone: reorder --dissociate and --reference options
  clone: use OPT_STRING_LIST for --reference

8 years agoMerge branch 'jc/diff-ws-error-highlight'
Junio C Hamano [Thu, 11 Jun 2015 16:29:51 +0000 (09:29 -0700)] 
Merge branch 'jc/diff-ws-error-highlight'

Allow whitespace breakages in deleted and context lines to be also
painted in the output.

* jc/diff-ws-error-highlight:
  diff.c: --ws-error-highlight=<kind> option
  diff.c: add emit_del_line() and emit_context_line()
  t4015: separate common setup and per-test expectation
  t4015: modernise style

9 years agoSync with 2.4.3
Junio C Hamano [Fri, 5 Jun 2015 19:23:18 +0000 (12:23 -0700)] 
Sync with 2.4.3

9 years agoGit 2.4.3 v2.4.3
Junio C Hamano [Fri, 5 Jun 2015 19:15:57 +0000 (12:15 -0700)] 
Git 2.4.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoThe first half of the seventh batch for 2.5
Junio C Hamano [Fri, 5 Jun 2015 19:20:57 +0000 (12:20 -0700)] 
The first half of the seventh batch for 2.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'ld/p4-editor-multi-words'
Junio C Hamano [Fri, 5 Jun 2015 19:17:38 +0000 (12:17 -0700)] 
Merge branch 'ld/p4-editor-multi-words'

Unlike "$EDITOR" and "$GIT_EDITOR" that can hold the path to the
command and initial options (e.g. "/path/to/emacs -nw"), 'git p4'
did not let the shell interpolate the contents of the environment
variable that name the editor "$P4EDITOR" (and "$EDITOR", too).
Make it in line with the rest of Git, as well as with Perforce.

* ld/p4-editor-multi-words:
  git-p4: tests: use test-chmtime in place of touch
  git-p4: fix handling of multi-word P4EDITOR
  git-p4: add failing test for P4EDITOR handling

9 years agoMerge branch 'bc/object-id'
Junio C Hamano [Fri, 5 Jun 2015 19:17:37 +0000 (12:17 -0700)] 
Merge branch 'bc/object-id'

for_each_ref() callback functions were taught to name the objects
not with "unsigned char sha1[20]" but with "struct object_id".

* bc/object-id: (56 commits)
  struct ref_lock: convert old_sha1 member to object_id
  warn_if_dangling_symref(): convert local variable "junk" to object_id
  each_ref_fn_adapter(): remove adapter
  rev_list_insert_ref(): remove unneeded arguments
  rev_list_insert_ref_oid(): new function, taking an object_oid
  mark_complete(): remove unneeded arguments
  mark_complete_oid(): new function, taking an object_oid
  clear_marks(): rewrite to take an object_id argument
  mark_complete(): rewrite to take an object_id argument
  send_ref(): convert local variable "peeled" to object_id
  upload-pack: rewrite functions to take object_id arguments
  find_symref(): convert local variable "unused" to object_id
  find_symref(): rewrite to take an object_id argument
  write_one_ref(): rewrite to take an object_id argument
  write_refs_to_temp_dir(): convert local variable sha1 to object_id
  submodule: rewrite to take an object_id argument
  shallow: rewrite functions to take object_id arguments
  handle_one_ref(): rewrite to take an object_id argument
  add_info_ref(): rewrite to take an object_id argument
  handle_one_reflog(): rewrite to take an object_id argument
  ...

9 years agoMerge branch 'jk/at-push-sha1'
Junio C Hamano [Fri, 5 Jun 2015 19:17:36 +0000 (12:17 -0700)] 
Merge branch 'jk/at-push-sha1'

Introduce <branch>@{push} short-hand to denote the remote-tracking
branch that tracks the branch at the remote the <branch> would be
pushed to.

* jk/at-push-sha1:
  for-each-ref: accept "%(push)" format
  for-each-ref: use skip_prefix instead of starts_with
  sha1_name: implement @{push} shorthand
  sha1_name: refactor interpret_upstream_mark
  sha1_name: refactor upstream_mark
  remote.c: add branch_get_push
  remote.c: return upstream name from stat_tracking_info
  remote.c: untangle error logic in branch_get_upstream
  remote.c: report specific errors from branch_get_upstream
  remote.c: introduce branch_get_upstream helper
  remote.c: hoist read_config into remote_get_1
  remote.c: provide per-branch pushremote name
  remote.c: hoist branch.*.remote lookup out of remote_get_1
  remote.c: drop "remote" pointer from "struct branch"
  remote.c: refactor setup of branch->merge list
  remote.c: drop default_remote_name variable

9 years agoMerge branch 'dl/branch-error-message' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:29 +0000 (12:00 -0700)] 
Merge branch 'dl/branch-error-message' into maint

Error messages from "git branch" called remote-tracking branches as
"remote branches".

* dl/branch-error-message:
  branch: do not call a "remote-tracking branch" a "remote branch"

9 years agoMerge branch 'jk/skip-http-tests-under-no-curl' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:28 +0000 (12:00 -0700)] 
Merge branch 'jk/skip-http-tests-under-no-curl' into maint

Test clean-up.

* jk/skip-http-tests-under-no-curl:
  tests: skip dav http-push tests under NO_EXPAT=NoThanks
  t/lib-httpd.sh: skip tests if NO_CURL is defined

9 years agoMerge branch 'ps/doc-packfile-vs-pack-file' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:27 +0000 (12:00 -0700)] 
Merge branch 'ps/doc-packfile-vs-pack-file' into maint

Doc consistency updates.

* ps/doc-packfile-vs-pack-file:
  doc: fix inconsistent spelling of "packfile"
  pack-protocol.txt: fix insconsistent spelling of "packfile"
  git-unpack-objects.txt: fix inconsistent spelling of "packfile"
  git-verify-pack.txt: fix inconsistent spelling of "packfile"

9 years agoMerge branch 'fg/document-commit-message-stripping' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:26 +0000 (12:00 -0700)] 
Merge branch 'fg/document-commit-message-stripping' into maint

* fg/document-commit-message-stripping:
  Documentation: clarify how "git commit" cleans up the edited log message

9 years agoMerge branch 'jk/rerere-forget-check-enabled' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:25 +0000 (12:00 -0700)] 
Merge branch 'jk/rerere-forget-check-enabled' into maint

"git rerere forget" in a repository without rerere enabled gave a
cryptic error message; it should be a silent no-op instead.

* jk/rerere-forget-check-enabled:
  rerere: exit silently on "forget" when rerere is disabled

9 years agoMerge branch 'pt/pull-log-n' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:24 +0000 (12:00 -0700)] 
Merge branch 'pt/pull-log-n' into maint

"git pull --log" and "git pull --no-log" worked as expected, but
"git pull --log=20" did not.

* pt/pull-log-n:
  pull: handle --log=<n>

9 years agoMerge branch 'pt/pull-ff-vs-merge-ff' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:23 +0000 (12:00 -0700)] 
Merge branch 'pt/pull-ff-vs-merge-ff' into maint

The pull.ff configuration was supposed to override the merge.ff
configuration, but it didn't.

* pt/pull-ff-vs-merge-ff:
  pull: parse pull.ff as a bool or string
  pull: make pull.ff=true override merge.ff

9 years agoMerge branch 'rs/plug-leak-in-pack-bitmaps' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:22 +0000 (12:00 -0700)] 
Merge branch 'rs/plug-leak-in-pack-bitmaps' into maint

The code to read pack-bitmap wanted to allocate a few hundred
pointers to a structure, but by mistake allocated and leaked memory
enough to hold that many actual structures.  Correct the allocation
size and also have it on stack, as it is small enough.

* rs/plug-leak-in-pack-bitmaps:
  pack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps

9 years agoMerge branch 'ja/tutorial-asciidoctor-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:22 +0000 (12:00 -0700)] 
Merge branch 'ja/tutorial-asciidoctor-fix' into maint

A literal block in the tutorial had lines with unequal lengths to
delimit it from the rest of the document, which choke GitHub's
AsciiDoc renderer.

* ja/tutorial-asciidoctor-fix:
  doc: fix unmatched code fences

9 years agoMerge branch 'jk/stripspace-asciidoctor-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:20 +0000 (12:00 -0700)] 
Merge branch 'jk/stripspace-asciidoctor-fix' into maint

A literal block in the tutorial had lines with unequal lengths to
delimit it from the rest of the document, which choke GitHub's
AsciiDoc renderer.

* jk/stripspace-asciidoctor-fix:
  doc: fix unmatched code fences in git-stripspace

9 years agoMerge branch 'jk/asciidoc-markup-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:19 +0000 (12:00 -0700)] 
Merge branch 'jk/asciidoc-markup-fix' into maint

Various documentation mark-up fixes to make the output more
consistent in general and also make AsciiDoctor (an alternative
formatter) happier.

* jk/asciidoc-markup-fix:
  doc: convert AsciiDoc {?foo} to ifdef::foo[]
  doc: put example URLs and emails inside literal backticks
  doc: drop backslash quoting of some curly braces
  doc: convert \--option to --option
  doc/add: reformat `--edit` option
  doc: fix length of underlined section-title
  doc: fix hanging "+"-continuation
  doc: fix unquoted use of "{type}"
  doc: fix misrendering due to `single quote'

9 years agoMerge branch 'ps/bundle-verify-arg' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:18 +0000 (12:00 -0700)] 
Merge branch 'ps/bundle-verify-arg' into maint

"git bundle verify" did not diagnose extra parameters on the
command line.

* ps/bundle-verify-arg:
  bundle: verify arguments more strictly

9 years agoMerge branch 'mh/write-refs-sooner-2.4' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:17 +0000 (12:00 -0700)] 
Merge branch 'mh/write-refs-sooner-2.4' into maint

Multi-ref transaction support we merged a few releases ago
unnecessarily kept many file descriptors open, risking to fail with
resource exhaustion.  This is for 2.4.x track.

* mh/write-refs-sooner-2.4:
  ref_transaction_commit(): fix atomicity and avoid fd exhaustion
  ref_transaction_commit(): remove the local flags variable
  ref_transaction_commit(): inline call to write_ref_sha1()
  rename_ref(): inline calls to write_ref_sha1() from this function
  commit_ref_update(): new function, extracted from write_ref_sha1()
  write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
  t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
  update-ref: test handling large transactions properly
  ref_transaction_commit(): fix atomicity and avoid fd exhaustion
  ref_transaction_commit(): remove the local flags variable
  ref_transaction_commit(): inline call to write_ref_sha1()
  rename_ref(): inline calls to write_ref_sha1() from this function
  commit_ref_update(): new function, extracted from write_ref_sha1()
  write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
  t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
  update-ref: test handling large transactions properly

9 years agoMerge branch 'mh/ref-directory-file' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:16 +0000 (12:00 -0700)] 
Merge branch 'mh/ref-directory-file' into maint

The ref API did not handle cases where 'refs/heads/xyzzy/frotz' is
removed at the same time as 'refs/heads/xyzzy' is added (or vice
versa) very well.

* mh/ref-directory-file:
  reflog_expire(): integrate lock_ref_sha1_basic() errors into ours
  ref_transaction_commit(): delete extra "the" from error message
  ref_transaction_commit(): provide better error messages
  rename_ref(): integrate lock_ref_sha1_basic() errors into ours
  lock_ref_sha1_basic(): improve diagnostics for ref D/F conflicts
  lock_ref_sha1_basic(): report errors via a "struct strbuf *err"
  verify_refname_available(): report errors via a "struct strbuf *err"
  verify_refname_available(): rename function
  refs: check for D/F conflicts among refs created in a transaction
  ref_transaction_commit(): use a string_list for detecting duplicates
  is_refname_available(): use dirname in first loop
  struct nonmatching_ref_data: store a refname instead of a ref_entry
  report_refname_conflict(): inline function
  entry_matches(): inline function
  is_refname_available(): convert local variable "dirname" to strbuf
  is_refname_available(): avoid shadowing "dir" variable
  is_refname_available(): revamp the comments
  t1404: new tests of ref D/F conflicts within transactions

9 years agoMerge branch 'mg/log-decorate-HEAD' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:15 +0000 (12:00 -0700)] 
Merge branch 'mg/log-decorate-HEAD' into maint

The "log --decorate" enhancement in Git 2.4 that shows the commit
at the tip of the current branch e.g. "HEAD -> master", did not
work with --decorate=full.

* mg/log-decorate-HEAD:
  log: do not shorten decoration names too early
  log: decorate HEAD with branch name under --decorate=full, too

9 years agoMerge branch 'sb/t1020-cleanup' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:14 +0000 (12:00 -0700)] 
Merge branch 'sb/t1020-cleanup' into maint

There was a commented-out (instead of being marked to expect
failure) test that documented a breakage that was fixed since the
test was written; turn it into a proper test.

* sb/t1020-cleanup:
  subdirectory tests: code cleanup, uncomment test

9 years agoMerge branch 'jc/gitignore-precedence' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:12 +0000 (12:00 -0700)] 
Merge branch 'jc/gitignore-precedence' into maint

core.excludesfile (defaulting to $XDG_HOME/git/ignore) is supposed
to be overridden by repository-specific .git/info/exclude file, but
the order was swapped from the beginning. This belatedly fixes it.

* jc/gitignore-precedence:
  ignore: info/exclude should trump core.excludesfile

9 years agoMerge branch 'bc/connect-plink' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:11 +0000 (12:00 -0700)] 
Merge branch 'bc/connect-plink' into maint

The connection initiation code for "ssh" transport tried to absorb
differences between the stock "ssh" and Putty-supplied "plink" and
its derivatives, but the logic to tell that we are using "plink"
variants were too loose and falsely triggered when "plink" appeared
anywhere in the path (e.g. "/home/me/bin/uplink/ssh").

* bc/connect-plink:
  connect: improve check for plink to reduce false positives
  t5601: fix quotation error leading to skipped tests
  connect: simplify SSH connection code path

9 years agoMerge branch 'ph/rebase-i-redo' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:10 +0000 (12:00 -0700)] 
Merge branch 'ph/rebase-i-redo' into maint

"git rebase -i" moved the "current" command from "todo" to "done" a
bit too prematurely, losing a step when a "pick" did not even start.

* ph/rebase-i-redo:
  rebase -i: redo tasks that die during cherry-pick

9 years agoMerge branch 'jk/add-e-kill-editor' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:09 +0000 (12:00 -0700)] 
Merge branch 'jk/add-e-kill-editor' into maint

"git add -e" did not allow the user to abort the operation by
killing the editor.

* jk/add-e-kill-editor:
  add: check return value of launch_editor

9 years agoMerge branch 'mh/clone-verbosity-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:08 +0000 (12:00 -0700)] 
Merge branch 'mh/clone-verbosity-fix' into maint

Git 2.4 broke setting verbosity and progress levels on "git clone"
with native transports.

* mh/clone-verbosity-fix:
  clone: call transport_set_verbosity before anything else on the newly created transport

9 years agoMerge branch 'jk/sha1-file-reduce-useless-warnings' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:07 +0000 (12:00 -0700)] 
Merge branch 'jk/sha1-file-reduce-useless-warnings' into maint

* jk/sha1-file-reduce-useless-warnings:
  sha1_file: squelch "packfile cannot be accessed" warnings

9 years agoMerge branch 'tb/blame-resurrect-convert-to-git' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:06 +0000 (12:00 -0700)] 
Merge branch 'tb/blame-resurrect-convert-to-git' into maint

Some time ago, "git blame" (incorrectly) lost the convert_to_git()
call when synthesizing a fake "tip" commit that represents the
state in the working tree, which broke folks who record the history
with LF line ending to make their project portabile across
platforms while terminating lines in their working tree files with
CRLF for their platform.

* tb/blame-resurrect-convert-to-git:
  blame: CRLF in the working tree and LF in the repo

9 years agoMerge branch 'jc/plug-fmt-merge-msg-leak' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:05 +0000 (12:00 -0700)] 
Merge branch 'jc/plug-fmt-merge-msg-leak' into maint

* jc/plug-fmt-merge-msg-leak:
  fmt-merge-msg: plug small leak of commit buffer

9 years agoMerge branch 'pt/xdg-config-path' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:03 +0000 (12:00 -0700)] 
Merge branch 'pt/xdg-config-path' into maint

Code clean-up for xdg configuration path support.

* pt/xdg-config-path:
  path.c: remove home_config_paths()
  git-config: replace use of home_config_paths()
  git-commit: replace use of home_config_paths()
  credential-store.c: replace home_config_paths() with xdg_config_home()
  dir.c: replace home_config_paths() with xdg_config_home()
  attr.c: replace home_config_paths() with xdg_config_home()
  path.c: implement xdg_config_home()
  t0302: "unreadable" test needs POSIXPERM
  t0302: test credential-store support for XDG_CONFIG_HOME
  git-credential-store: support XDG_CONFIG_HOME
  git-credential-store: support multiple credential files

9 years agoSixth batch for 2.5 cycle
Junio C Hamano [Mon, 1 Jun 2015 19:47:56 +0000 (12:47 -0700)] 
Sixth batch for 2.5 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'sb/test-bitmap-free-at-end'
Junio C Hamano [Mon, 1 Jun 2015 19:45:21 +0000 (12:45 -0700)] 
Merge branch 'sb/test-bitmap-free-at-end'

An earlier leakfix to bitmap testing code was incomplete.

* sb/test-bitmap-free-at-end:
  test_bitmap_walk: free bitmap with bitmap_free

9 years agoMerge branch 'mm/rebase-i-post-rewrite-exec'
Junio C Hamano [Mon, 1 Jun 2015 19:45:20 +0000 (12:45 -0700)] 
Merge branch 'mm/rebase-i-post-rewrite-exec'

"git rebase -i" fired post-rewrite hook when it shouldn't (namely,
when it was told to stop sequencing with 'exec' insn).

* mm/rebase-i-post-rewrite-exec:
  t5407: use <<- to align the expected output
  rebase -i: fix post-rewrite hook with failed exec command
  rebase -i: demonstrate incorrect behavior of post-rewrite

9 years agoMerge branch 'fm/fetch-raw-sha1'
Junio C Hamano [Mon, 1 Jun 2015 19:45:19 +0000 (12:45 -0700)] 
Merge branch 'fm/fetch-raw-sha1'

"git upload-pack" that serves "git fetch" can be told to serve
commits that are not at the tip of any ref, as long as they are
reachable from a ref, with uploadpack.allowReachableSHA1InWant
configuration variable.

* fm/fetch-raw-sha1:
  upload-pack: optionally allow fetching reachable sha1
  upload-pack: prepare to extend allow-tip-sha1-in-want
  config.txt: clarify allowTipSHA1InWant with camelCase

9 years agoMerge branch 'sg/help-group'
Junio C Hamano [Mon, 1 Jun 2015 19:45:18 +0000 (12:45 -0700)] 
Merge branch 'sg/help-group'

Group list of commands shown by "git help" along the workflow
elements to help early learners.

* sg/help-group:
  help: respect new common command grouping
  command-list.txt: drop the "common" tag
  generate-cmdlist: parse common group commands
  command-list.txt: add the common groups block
  command-list: prepare machinery for upcoming "common groups" section

9 years agoMerge branch 'mm/log-format-raw-doc'
Junio C Hamano [Mon, 1 Jun 2015 19:45:17 +0000 (12:45 -0700)] 
Merge branch 'mm/log-format-raw-doc'

Clarify that "log --raw" and "log --format=raw" are unrelated
concepts.

* mm/log-format-raw-doc:
  Documentation/log: clarify sha1 non-abbreviation in log --raw
  Documentation/log: clarify what --raw means

9 years agoMerge branch 'dt/cat-file-follow-symlinks'
Junio C Hamano [Mon, 1 Jun 2015 19:45:16 +0000 (12:45 -0700)] 
Merge branch 'dt/cat-file-follow-symlinks'

"git cat-file --batch(-check)" learned the "--follow-symlinks"
option that follows an in-tree symbolic link when asked about an
object via extended SHA-1 syntax, e.g. HEAD:RelNotes that points at
Documentation/RelNotes/2.5.0.txt.  With the new option, the command
behaves as if HEAD:Documentation/RelNotes/2.5.0.txt was given as
input instead.

* dt/cat-file-follow-symlinks:
  cat-file: add --follow-symlinks to --batch
  sha1_name: get_sha1_with_context learns to follow symlinks
  tree-walk: learn get_tree_entry_follow_symlinks

9 years agoMerge branch 'rs/janitorial'
Junio C Hamano [Mon, 1 Jun 2015 19:45:15 +0000 (12:45 -0700)] 
Merge branch 'rs/janitorial'

Code clean-up.

* rs/janitorial:
  dir: remove unused variable sb
  clean: remove unused variable buf
  use file_exists() to check if a file exists in the worktree

9 years agoMerge branch 'jk/stash-options'
Junio C Hamano [Mon, 1 Jun 2015 19:45:14 +0000 (12:45 -0700)] 
Merge branch 'jk/stash-options'

Make "git stash something --help" error out, so that users can
safely say "git stash drop --help".

* jk/stash-options:
  stash: recognize "--help" for subcommands
  stash: complain about unknown flags

9 years agoMerge branch 'da/mergetool-winmerge'
Junio C Hamano [Mon, 1 Jun 2015 19:45:14 +0000 (12:45 -0700)] 
Merge branch 'da/mergetool-winmerge'

"git mergetool" learned to drive WinMerge as a backend.

* da/mergetool-winmerge:
  mergetools: add winmerge as a builtin tool
  mergetool--lib: set IFS for difftool and mergetool

9 years agoMerge branch 'mc/commit-doc-grammofix'
Junio C Hamano [Mon, 1 Jun 2015 19:45:12 +0000 (12:45 -0700)] 
Merge branch 'mc/commit-doc-grammofix'

Doc grammar fix.

* mc/commit-doc-grammofix:
  Documentation/git-commit: grammofix

9 years agoMerge branch 'jh/filter-empty-contents'
Junio C Hamano [Mon, 1 Jun 2015 19:45:10 +0000 (12:45 -0700)] 
Merge branch 'jh/filter-empty-contents'

The clean/smudge interface did not work well when filtering an
empty contents (failed and then passed the empty input through).
It can be argued that a filter that produces anything but empty for
an empty input is nonsense, but if the user wants to do strange
things, then why not?

* jh/filter-empty-contents:
  sha1_file: pass empty buffer to index empty file

9 years agoMerge branch 'ah/usage-strings'
Junio C Hamano [Mon, 1 Jun 2015 19:45:09 +0000 (12:45 -0700)] 
Merge branch 'ah/usage-strings'

A few usage string updates.

* ah/usage-strings:
  blame, log: format usage strings similarly to those in documentation

9 years agoMerge branch 'jk/http-backend-deadlock'
Junio C Hamano [Mon, 1 Jun 2015 19:45:09 +0000 (12:45 -0700)] 
Merge branch 'jk/http-backend-deadlock'

Communication between the HTTP server and http_backend process can
lead to a dead-lock when relaying a large ref negotiation request.
Diagnose the situation better, and mitigate it by reading such a
request first into core (to a reasonable limit).

* jk/http-backend-deadlock:
  http-backend: spool ref negotiation requests to buffer
  t5551: factor out tag creation
  http-backend: fix die recursion with custom handler

9 years agoMerge branch 'dt/clean-pathspec-filter-then-lstat'
Junio C Hamano [Mon, 1 Jun 2015 19:45:08 +0000 (12:45 -0700)] 
Merge branch 'dt/clean-pathspec-filter-then-lstat'

"git clean pathspec..." tried to lstat(2) and complain even for
paths outside the given pathspec.

* dt/clean-pathspec-filter-then-lstat:
  clean: only lstat files in pathspec

9 years agosuppress errors on missing UNINTERESTING links
Jeff King [Mon, 1 Jun 2015 09:56:40 +0000 (05:56 -0400)] 
suppress errors on missing UNINTERESTING links

When we are traversing commit parents along the
UNINTERESTING side of a revision walk, we do not care if
the parent turns out to be missing. That lets us limit
traversals using unreachable and possibly incomplete
sections of history. However, we do still print error
messages about the missing commits; this patch suppresses
the error, as well.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosilence broken link warnings with revs->ignore_missing_links
Jeff King [Mon, 1 Jun 2015 09:56:37 +0000 (05:56 -0400)] 
silence broken link warnings with revs->ignore_missing_links

We set revs->ignore_missing_links to instruct the
revision-walking machinery that we know the history graph
may be incomplete. For example, we use it when walking
unreachable but recent objects; we want to add what we can,
but it's OK if the history is incomplete.

However, we still print error messages for the missing
objects, which can be confusing. This is not an error, but
just a normal situation when transitioning from a repository
last pruned by an older git (which can leave broken segments
of history) to a more recent one (where we try to preserve
whole reachable segments).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoadd quieter versions of parse_{tree,commit}
Jeff King [Mon, 1 Jun 2015 09:56:26 +0000 (05:56 -0400)] 
add quieter versions of parse_{tree,commit}

When we call parse_commit, it will complain to stderr if the
object does not exist or cannot be read. This means that we
may produce useless error messages if this situation is
expected (e.g., because the object is marked UNINTERESTING,
or because revs->ignore_missing_links is set).

We can fix this by adding a new "parse_X_gently" form that
takes a flag to suppress the messages. The existing
"parse_X" form is already gentle in the sense that it
returns an error rather than dying, and we could in theory
just add a "quiet" flag to it (with existing callers passing
"0"). But doing it this way means we do not have to disturb
existing callers.

Note also that the new flag is "quiet_on_missing", and not
just "quiet". We could add a flag to suppress _all_ errors,
but besides being a more invasive change (we would have to
pass the flag down to sub-functions, too), there is a good
reason not to: we would never want to use it. Missing a
linked object is expected in some circumstances, but it is
never expected to have a malformed commit, or to get a tree
when we wanted a commit.  We should always complain about
these corruptions.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocompletion: suggest sequencer commands for revert
Thomas Braun [Mon, 25 May 2015 09:59:35 +0000 (11:59 +0200)] 
completion: suggest sequencer commands for revert

Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoglossary: add "remote", "submodule", "superproject"
Stefan Beller [Fri, 29 May 2015 18:23:56 +0000 (11:23 -0700)] 
glossary: add "remote", "submodule", "superproject"

Noticed-by: Philip Oakley <philipoakley@iee.org>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5520: check reflog action in fast-forward merge
Paul Tan [Fri, 29 May 2015 11:44:45 +0000 (19:44 +0800)] 
t5520: check reflog action in fast-forward merge

When testing a fast-forward merge with git-pull, check to see if the
reflog action is "pull" with the arguments passed to git-pull.

While we are in the vicinity, remove the empty line as well.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5521: test --dry-run does not make any changes
Paul Tan [Fri, 29 May 2015 11:44:44 +0000 (19:44 +0800)] 
t5521: test --dry-run does not make any changes

Test that when --dry-run is provided to git-pull, it does not make any
changes, namely:

* --dry-run gets passed to git-fetch, so no FETCH_HEAD will be created
  and no refs will be fetched.

* The index and work tree will not be modified.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5520: test --rebase failure on unborn branch with index
Paul Tan [Fri, 29 May 2015 11:44:43 +0000 (19:44 +0800)] 
t5520: test --rebase failure on unborn branch with index

Commit 19a7fcb (allow pull --rebase on branch yet to be born,
2009-08-11) special cases git-pull on an unborn branch in a different
code path such that git-pull --rebase is still valid even though there
is no HEAD yet.

This code path still ensures that there is no index in order not to lose
any staged changes. Implement a test to ensure that this check is
triggered.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5520: test --rebase with multiple branches
Paul Tan [Fri, 29 May 2015 11:44:42 +0000 (19:44 +0800)] 
t5520: test --rebase with multiple branches

Since rebasing on top of multiple upstream branches does not make sense,
since 51b2ead (disallow providing multiple upstream branches to rebase,
pull --rebase, 2009-02-18), git-pull explicitly disallowed specifying
multiple branches in the rebase case.

Implement tests to ensure that git-pull fails and prints out the
user-friendly error message in such a case.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5520: test work tree fast-forward when fetch updates head
Paul Tan [Fri, 29 May 2015 11:44:41 +0000 (19:44 +0800)] 
t5520: test work tree fast-forward when fetch updates head

Since b10ac50 (Fix pulling into the same branch., 2005-08-25), git-pull,
upon detecting that git-fetch updated the current head, will
fast-forward the working tree to the updated head commit.

Implement tests to ensure that the fast-forward occurs in such a case,
as well as to ensure that the user-friendly advice is printed upon
failure.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5520: test for failure if index has unresolved entries
Paul Tan [Fri, 29 May 2015 11:44:40 +0000 (19:44 +0800)] 
t5520: test for failure if index has unresolved entries

Commit d38a30d (Be more user-friendly when refusing to do something
because of conflict., 2010-01-12) introduced code paths to git-pull
which will error out with user-friendly advices if the user is in the
middle of a merge or has unmerged files.

Implement tests to ensure that git-pull will not run, and will print
these advices, if the user is in the middle of a merge or has unmerged
files in the index.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosubmodule doc: reorder introductory paragraphs
Stefan Beller [Wed, 27 May 2015 19:48:01 +0000 (12:48 -0700)] 
submodule doc: reorder introductory paragraphs

It's better to start the man page with a description of what
submodules actually are, instead of saying what they are not.

Reorder the paragraphs such that

 - the first short paragraph introduces the submodule concept,
 - the second paragraph highlights the usage of the submodule command,
 - the third paragraph giving background information, and finally
 - the fourth paragraph discusing alternatives such as subtrees and
   remotes, which we don't want to be confused with.

This ordering deepens the knowledge on submodules with each paragraph.
First the basic questions like "How/what" will be answered, while the
underlying concepts will be taught at a later time.

Making sure it is not confused with subtrees and remotes is not really
enhancing knowledge of submodules itself, but rather painting the big
picture of git concepts, so you could also argue to have it as the second
paragraph. Personally I think this may confuse readers, specially
newcomers though.

Additionally to reordering the paragraphs, they have been slightly
reworded.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoxmmap(): drop "Out of memory?"
Junio C Hamano [Wed, 27 May 2015 20:30:29 +0000 (13:30 -0700)] 
xmmap(): drop "Out of memory?"

We show that message with die_errno(), but the OS is ought to know
why mmap(2) failed much better than we do.  There is no reason for
us to say "Out of memory?" here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoconfig.c: rewrite ENODEV into EISDIR when mmap fails
Jeff King [Thu, 28 May 2015 08:03:01 +0000 (04:03 -0400)] 
config.c: rewrite ENODEV into EISDIR when mmap fails

If we try to mmap a directory, we'll get ENODEV. This
translates to "no such device" for the user, which is not
very helpful. Since we've just fstat()'d the file, we can
easily check whether the problem was a directory to give a
better message.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoconfig.c: avoid xmmap error messages
Jeff King [Thu, 28 May 2015 07:56:15 +0000 (03:56 -0400)] 
config.c: avoid xmmap error messages

The config-writing code uses xmmap to map the existing
config file, which will die if the map fails. This has two
downsides:

  1. The error message is not very helpful, as it lacks any
     context about the file we are mapping:

       $ mkdir foo
       $ git config --file=foo some.key value
       fatal: Out of memory? mmap failed: No such device

  2. We normally do not die in this code path; instead, we'd
     rather report the error and return an appropriate exit
     status (which is part of the public interface
     documented in git-config.1).

This patch introduces a "gentle" form of xmmap which lets us
produce our own error message. We do not want to use mmap
directly, because we would like to use the other
compatibility elements of xmmap (e.g., handling 0-length
maps portably).

The end result is:

    $ git.compile config --file=foo some.key value
    error: unable to mmap 'foo': No such device
    $ echo $?
    3

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoconfig.c: fix mmap leak when writing config
Jeff King [Thu, 28 May 2015 07:54:43 +0000 (03:54 -0400)] 
config.c: fix mmap leak when writing config

We mmap the existing config file, but fail to unmap it if we
hit an error. The function already has a shared exit path,
so we can fix this by moving the mmap pointer to the
function scope and clearing it in the shared exit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoread-cache.c: drop PROT_WRITE from mmap of index
Jeff King [Thu, 28 May 2015 07:54:00 +0000 (03:54 -0400)] 
read-cache.c: drop PROT_WRITE from mmap of index

Once upon a time, git's in-memory representation of a cache
entry actually pointed to the mmap'd on-disk data. So in
520fc24 (Allow writing to the private index file mapping.,
2005-04-26), we specified PROT_WRITE so that we could tweak
the entries while we run (in our own MAP_PRIVATE copy-on-write
version, of course).

Later, 7a51ed6 (Make on-disk index representation separate
from in-core one, 2008-01-14) stopped doing this; we copy
the data into our in-core representation, and then drop the
mmap immediately. We can therefore drop the PROT_WRITE flag.
It's probably not hurting anything as it is, but it's
potentially confusing.

Note that we could also mark the mapping as "const" to
verify that we never write to it. However, we don't
typically do that for our other maps, as it then requires
casting to munmap() it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agop4: retrieve the right revision of the file in UTF-16 codepath
Miguel Torroja [Wed, 27 May 2015 23:14:39 +0000 (01:14 +0200)] 
p4: retrieve the right revision of the file in UTF-16 codepath

Fixing bug with UTF-16 files when they are retrieved by git-p4.  It
was always getting the tip version of the file and the history of
the file was lost.

Signed-off-by: Miguel Torroja <miguel.torroja@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoref_transaction_commit(): do not capitalize error messages
Michael Haggerty [Fri, 22 May 2015 23:34:57 +0000 (01:34 +0200)] 
ref_transaction_commit(): do not capitalize error messages

Our convention is for error messages to start with a lower-case
letter.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoverify_lock(): do not capitalize error messages
Michael Haggerty [Fri, 22 May 2015 23:34:56 +0000 (01:34 +0200)] 
verify_lock(): do not capitalize error messages

Our convention is for error messages to start with a lower-case
letter.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoverify_lock(): report errors via a strbuf
Michael Haggerty [Fri, 22 May 2015 23:34:55 +0000 (01:34 +0200)] 
verify_lock(): report errors via a strbuf

Instead of writing error messages directly to stderr, write them to
a "strbuf *err".  The caller, lock_ref_sha1_basic(), uses this error
reporting convention with all the other callees, and reports its
error this way to its callers.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodiff.h: rename DIFF_PLAIN color slot to DIFF_CONTEXT
Jeff King [Wed, 27 May 2015 20:48:46 +0000 (16:48 -0400)] 
diff.h: rename DIFF_PLAIN color slot to DIFF_CONTEXT

The latter is a much more descriptive name (and we support
"color.diff.context" now). This also updates the name of any
local variables which were used to store the color.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodiff: accept color.diff.context as a synonym for "plain"
Jeff King [Wed, 27 May 2015 07:22:19 +0000 (03:22 -0400)] 
diff: accept color.diff.context as a synonym for "plain"

The term "plain" is a bit ambiguous; let's allow the more
specific "context", but keep "plain" around for
compatibility.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'nd/untracked-cache'
Junio C Hamano [Wed, 27 May 2015 20:14:38 +0000 (13:14 -0700)] 
Merge branch 'nd/untracked-cache'

* nd/untracked-cache:
  t7063: hide stderr from setup inside prereq

9 years agot7063: hide stderr from setup inside prereq
Jeff King [Wed, 27 May 2015 09:34:58 +0000 (05:34 -0400)] 
t7063: hide stderr from setup inside prereq

When t7063 starts, it runs "update-index --untracked-cache"
to see if we support the untracked cache. Its output goes
straight to stderr, even if the test is not run with "-v".
Let's wrap it in a prereq that will hide the output by
default, but show it with "-v".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoverify_lock(): on errors, let the caller unlock the lock
Michael Haggerty [Fri, 22 May 2015 23:34:54 +0000 (01:34 +0200)] 
verify_lock(): on errors, let the caller unlock the lock

The caller already knows how to do it, so always do it in the same
place.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>