diff: avoid stack-buffer-read-overrun for very long name

Due to the use of strncpy without explicit NUL termination,
we could end up passing names n1 or n2 that are not NUL-terminated
to queue_diff, which requires NUL-terminated strings.
Ensure that each is NUL terminated.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t4052: test --stat output with --graph

Add tests which show that the width of the --prefix added by --graph
is not taken into consideration when the diff stat output width is
calculated.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Add output_prefix_length to diff_options

Add output_prefix_length to diff_options. Initialize the value to 0 and only
set it when graph.c:diff_output_prefix_callback() is called.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Adjust stat width calculations to take --graph output into account

The recent change to compute the width of diff --stat did not take into
consideration the output from --graph. The consequence is that when both
options are used, e.g. in 'log --stat --graph', the lines are too long.

Adjust stat width calculations to take --graph output into account.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t4052: Adjust --graph --stat output for prefixes

Adjust tests to verify that the commit history graph tree is taken into
consideration when the diff stat output width is calculated.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t4052: Add tests to illustrate issues with restrictive COLUMNS

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Prevent graph_width of diff stat from falling below min

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t4052: Adjust --stat output for minimum graph_width

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'ct/advise-push-default' into jch

Breaks down the cases in which "git push" fails due to non-ff into three
categories, and gives separate advise messages.  This should be a good
change regardless of mm/push-default-switch-warning topic.

By Christopher Tiwald (2) and Jeff King (1)
* ct/advise-push-default:
  Fix httpd tests that broke when non-ff push advice changed
  clean up struct ref's nonfastforward field
  push: Provide situational hints for non-fast-forward errors
Merge branch 'jc/fmt-merge-msg-people' into jch

The "fmt-merge-msg" command learns to list the primary contributors
involved in the side topic you are merging.

* jc/fmt-merge-msg-people:
  fmt-merge-msg: show those involved in a merged series
Merge branch 'jb/am-include' into jch

By Johannes Berg
* jb/am-include:
  am: support --include option
Merge branch 'jc/am-report-3way' into jch

* jc/am-report-3way:
  am -3: list the paths that needed 3-way fallback
Merge branch 'jc/push-upstream-sanity' into jch

Fix broken 'push to upstream' implementation.  "git push $there" without
refspec, when the current branch is set to push to a remote different from
$there, used to push to $there using the upstream information to a remote
unreleated to $there.

* jc/push-upstream-sanity:
  push: error out when the "upstream" semantics does not make sense
Merge branch 'jk/run-command-eacces' into jch

When PATH contains an unreadable directory, alias expansion code did not
kick in, and failed with an error that said "git-subcmd" was not found.

By Jeff King (1) and Ramsay Jones (1)
* jk/run-command-eacces:
  run-command: treat inaccessible directories as ENOENT
  compat/mingw.[ch]: Change return type of exec functions to int
Merge branch 'bw/submodule-sed-solaris' into jch

By Ben Walton
* bw/submodule-sed-solaris:
  Avoid bug in Solaris xpg4/sed as used in submodule
Merge branch 'jn/debian-customizes-default-editor' into jch

By Jonathan Nieder
* jn/debian-customizes-default-editor:
  var doc: advertise current DEFAULT_PAGER and DEFAULT_EDITOR settings
  var doc: default editor and pager are configurable at build time
Merge branch 'ms/remote-usage-string' into jch

As an independent follow-up, we may want to rethink how the overall usage
string and subcommand usage strings are maintained.

By Michael Schubert
* ms/remote-usage-string:
  remote: update builtin usage
Merge branch 'pw/git-p4' into jch

By Pete Wyckoff
* pw/git-p4:
  git p4: use "git p4" directly in tests
  git p4: update name in script
  git-p4: move to toplevel
Merge branch 'ld/git-p4-tags-and-labels' into jch

By Luke Diamand
* ld/git-p4-tags-and-labels:
  git p4: import/export of labels to/from p4
  git p4: Fixing script editor checks
Merge branch 'rs/commit-list-sort-in-batch' into jch

By René Scharfe
* rs/commit-list-sort-in-batch:
  revision: insert unsorted, then sort in prepare_revision_walk()
  commit: use mergesort() in commit_list_sort_by_date()
  add mergesort() for linked lists