apply: carefully strdup a possibly-NULL name

2901bbe (apply: free patch->{def,old,new}_name fields, 2012-03-21)
cleaned up the memory management of filenames in the patches, but
forgot that find_name_traditional() can return NULL as a way of saying
"I couldn't find a name".

That NULL unfortunately gets passed into xstrdup() next, resulting in
a segfault.  Use null_strdup() so as to safely propagate the null,
which will let us emit the correct error message.

Reported-by: DevHC on #git
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
web--browse: support /usr/bin/cygstart on Cygwin

While both GUI and console Cygwin browsers do exist, anecdotal evidence
suggests most users rely on their native Windows browser.  cygstart,
which is a long-standing part of the base Cygwin installation, will
cause the page to be opened in the default Windows browser (the one
registered to open .html files).

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-t6000: style fixes

Mostly fixes to initial indentation with 8-SP (they should be HT)
and wrapping long lines.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
topology tests: teach a helper to take abbreviated timestamps

The on_committer_date helper in t/lib-t6000 is used in t6002 and
t6003 with timestamps on a single day within a single minute
(i.e. 1971-08-16 00:00) and the tests repeat this over and over.

The actual value of the timestamp, however, does not matter very
much; only their relative ordering does.

Introduce another helper to expand only the suffix of the timestamp
to a full timestamp to make the lines shorter, and use it in this
helper.  Also, because all the commits in the test are made with
specific GIT_COMMITTER_DATE, stop unsetting it at the end of the
helper.

We'll be specifying the author timestamp to these test commits in a
later patch, which will be helped with this change.

Also remove a test that was commented-out from t6003; it used to
test a commit with the same parent listed twice, which was allowed
by mistake but was fixed long time ago.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t6003: add --date-order test

The "--date-order" output is a slight twist of "--topo-order" in
that commits from parallel histories are shown in their committer
date order without an attempt to clump commits from a single line
of history together like --topo-order does.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
topology tests: teach a helper to set author dates as well

Introduce on_dates helper that is similar to on_committer_date but
also sets the author date, not just the committer date.

At this step, just set the same timestamp to the author date as the
committer date, as no test looks at author date yet.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t6003: add --author-date-order test

Tweak the --topo/date-order test vector a bit and mark the author
dates of two commits (a2 and a3) earlier than their own committer
dates, making them much older than other commits that are made on
parallel branches to simulate the case where a long running topic
was rebased recently.

They will show up as recent in the --date-order output due to their
timestamps, but they appear a lot later in the --author-date-order
output, even though their committer timestamp says otherwise.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jg/status-config' into jch

* jg/status-config:
  status: introduce status.branch to enable --branch by default
  status: introduce status.short to enable --short by default
Merge branch 'jk/commit-info-slab' into jch

Allow adding custom information to commit objects in order to
represent unbound number of flag bits etc.

* jk/commit-info-slab:
  commit-slab: introduce a macro to define a slab for new type
  commit-slab: avoid large realloc
  commit: allow associating auxiliary info on-demand
Merge branch 'jc/topo-author-date-sort' (early part) into jch

* 'jc/topo-author-date-sort' (early part):
  log: --author-date-order
  sort-in-topological-order: use prio-queue
  prio-queue: priority queue of pointers to structs
  toposort: rename "lifo" field

Conflicts:
	.gitignore
	Makefile
	revision.c
Merge branch 'mz/rebase-tests' into jch

* mz/rebase-tests:
  rebase topology tests: fix commit names on case-insensitive file systems
  tests: move test for rebase messages from t3400 to t3406
  t3406: modernize style
  add tests for rebasing merged history
  add tests for rebasing root
  add tests for rebasing of empty commits
  add tests for rebasing with patch-equivalence present
  add simple tests of consistency across rebase types
Merge branch 'jk/add-i-custom-diff-algo' into jch

* jk/add-i-custom-diff-algo:
  add--interactive: respect diff.algorithm
Merge branch 'rr/rebase-autostash' into jch

* rr/rebase-autostash:
  rebase: finish_rebase() in noop rebase
  rebase: finish_rebase() in fast-forward rebase
  rebase: guard against missing files in read_basic_state()
Merge branch 'rr/prompt-rebase-breakage-fix' into jch

* rr/prompt-rebase-breakage-fix:
  prompt: squelch error output from cat
Merge branch 'fg/submodule-non-ascii-path' into jch

Many "git submodule" operations do not work on a submodule at a
path whose name is not in ASCII.

* fg/submodule-non-ascii-path:
  t7400: test of UTF-8 submodule names pass under Mac OS
  handle multibyte characters in name
Merge branch 'bp/remote-mw-tests' into jch

* bp/remote-mw-tests:
  git-remote-mediawiki: remove hardcoded version number in the test suite
Merge branch 'cm/remote-mediawiki-perlcritique' into jch

* cm/remote-mediawiki-perlcritique: (31 commits)
  git-remote-mediawiki: make error message more precise
  git-remote-mediawiki: add a perlcritic rule in Makefile
  git-remote-mediawiki: add a .perlcriticrc file
  git-remote-mediawiki: clearly rewrite double dereference
  git-remote-mediawiki: fix a typo ("mediwiki" instead of "mediawiki")
  git-remote-mediawiki: put non-trivial numeric values in constants.
  git-remote-mediawiki: don't use quotes for empty strings
  git-remote-mediawiki: replace "unless" statements with negated "if" statements
  git-remote-mediawiki: brace file handles for print for more clarity
  git-remote-mediawiki: modify strings for a better coding-style
  git-remote-mediawiki: put long code into a subroutine
  git-remote-mediawiki: remove import of unused open2
  git-remote-mediawiki: check return value of open
  git-remote-mediawiki: assign a variable as undef and make proper indentation
  git-remote-mediawiki: rename a variable ($last) which has the name of a keyword
  git-remote-mediawiki: remove unused variable $entry
  git-remote-mediawiki: turn double-negated expressions into simple expressions
  git-remote-mediawiki: change the name of a variable
  git-remote-mediawiki: add newline in the end of die() error messages
  git-remote-mediawiki: change style in a regexp
  ...

# Conflicts:
# 	contrib/mw-to-git/git-remote-mediawiki.perl
Merge branch 'jk/apache-test-for-2.4' into jch

* jk/apache-test-for-2.4:
  t/lib-httpd/apache.conf: configure an MPM module for apache 2.4
  t/lib-httpd/apache.conf: load compat access module in apache 2.4
  t/lib-httpd/apache.conf: load extra auth modules in apache 2.4
  t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4
Merge branch 'jk/unpack-entry-fallback-to-another' into jch

* jk/unpack-entry-fallback-to-another:
  unpack_entry: do not die when we fail to apply a delta
  t5303: drop "count=1" from corruption dd
Merge branch 'fc/sequencer-plug-leak' into jch

Plug a small leak in an error codepath.

* fc/sequencer-plug-leak:
  sequencer: avoid leaking message buffer when refusing to create an empty commit
  sequencer: remove useless indentation