Merge branch 'cc/replace-edit'

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

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

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

* jk/replace-edit-raw:
  replace: add a --raw mode for --edit
Merge branch 'ep/submodule-code-cleanup'

* ep/submodule-code-cleanup:
  submodule.c: use the ARRAY_SIZE macro
Merge branch 'jk/strip-suffix'

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

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

* mk/merge-incomplete-files:
  git-merge-file: do not add LF at EOF while applying unrelated change
  t6023-merge-file.sh: fix and mark as broken invalid tests
Merge branch 'cb/filter-branch-prune-empty-degenerate-merges'

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

* cb/filter-branch-prune-empty-degenerate-merges:
  filter-branch: eliminate duplicate mapped parents
Merge branch 'kb/path-max-must-go'

* kb/path-max-must-go:
  cache.h: rename cache_def_free to cache_def_clear
Merge branch 'mg/fix-log-mergetag-color'

* mg/fix-log-mergetag-color:
  log: correctly identify mergetag signature verification status
Merge branch 'zk/log-graph-showsig'

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

* zk/log-graph-showsig:
  log: fix indentation for --graph --show-signature
Merge branch 'jl/test-lint-scripts'

* jl/test-lint-scripts:
  t/Makefile: always test all lint targets when running tests
  t/Makefile: check helper scripts for non-portable shell commands too
Merge branch 'po/error-message-style'

* po/error-message-style:
  doc: give some guidelines for error messages
Merge branch 'jk/skip-prefix'

One more to an already graduated topic.

* jk/skip-prefix:
  tag: use skip_prefix instead of magic numbers
Merge branch 'rs/code-cleaning'

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

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

* ah/fix-http-push:
  http-push.c: make CURLOPT_IOCTLDATA a usable pointer
Eighth batch for 2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sync with 2.0.2

* maint:
  Git 2.0.2
  annotate: use argv_array
config: use chmod() instead of fchmod()

There is no fchmod() on native Windows platforms (MinGW and MSVC), and the
equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.

Use chmod() instead.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c: add a public is_branch function

Both refs.c and fsck.c have their own private copies of the is_branch function.
Delete the is_branch function from fsck.c and make the version in refs.c
public.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rebase: omit patch-identical commits with --fork-point

When the `--fork-point` argument was added to `git rebase`, we changed
the value of $upstream to be the fork point instead of the point from
which we want to rebase.  When $orig_head..$upstream is empty this does
not change the behaviour, but when there are new changes in the upstream
we are no longer checking if any of them are patch-identical with
changes in $upstream..$orig_head.

Fix this by introducing a new variable to hold the fork point and using
this to restrict the range as an extra (negative) revision argument so
that the set of desired revisions becomes (in fork-point mode):

	git rev-list --cherry-pick --right-only \
		$upstream...$orig_head ^$fork_point

This allows us to correctly handle the scenario where we have the
following topology:

	    C --- D --- E  <- dev
	   /
	  B  <- master@{1}
	 /
	o --- B' --- C* --- D*  <- master

where:
- B' is a fixed-up version of B that is not patch-identical with B;
- C* and D* are patch-identical to C and D respectively and conflict
  textually if applied in the wrong order;
- E depends textually on D.

The correct result of `git rebase master dev` is that B is identified as
the fork-point of dev and master, so that C, D, E are the commits that
need to be replayed onto master; but C and D are patch-identical with C*
and D* and so can be dropped, so that the end result is:

	o --- B' --- C* --- D* --- E  <- dev

If the fork-point is not identified, then picking B onto a branch
containing B' results in a conflict and if the patch-identical commits
are not correctly identified then picking C onto a branch containing D
(or equivalently D*) results in a conflict.

This change allows us to handle both of these cases, where previously we
either identified the fork-point (with `--fork-point`) but not the
patch-identical commits *or* (with `--no-fork-point`) identified the
patch-identical commits but not the fact that master had been rewritten.

Reported-by: Ted Felix <ted@tedfelix.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tag: support configuring --sort via .gitconfig

Add support for configuring default sort ordering for git tags. Command
line option will override this configured value, using the exact same
syntax.

Cc: Jeff King <peff@peff.net>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>