Remove the hard coded length limit on variable names in config files

Previously while reading the variable names in config files, there
was a 256 character limit with at most 128 of those characters being
used by the section header portion of the variable name.  This
limitation was only enforced while reading the config files.  It was
possible to write a config file that was not subsequently readable.

Instead of enforcing this limitation for both reading and writing,
remove it entirely by changing the var member of the config_file
struct to a strbuf instead of a fixed length buffer.  Update all of
the parsing functions in config.c to use the strbuf instead of the
static buffer.

The parsing functions that returned the base length of the variable
name now return simply 0 for success and -1 for failure.  The base
length information is obtained through the strbuf's len member.

We now send the buf member of the strbuf to external callback
functions to preserve the external api.  None of the external
callers rely on the old size limitation for sizing their own buffers
so removing the limit should have no externally visible effect.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'tu/gc-auto-quiet' into jch

"gc --auto" notified the user that auto-packing has triggered even
under the "--quiet" option.

Will merge to 'next'.

* tu/gc-auto-quiet:
  silence git gc --auto --quiet output
Merge branch 'jl/submodule-rm' into jch

"git rm submodule" cannot blindly remove a submodule directory as
its working tree may have local changes, and worse yet, it may even
have its repository embedded in it.  Teach it some special cases
where it is safe to remove a submodule, specifically, when there is
no local changes in the submodule working tree, and its repository
is not embedded in its working tree but is elsewhere and uses the
gitfile mechanism to point at it.

Will merge to 'next'.

* jl/submodule-rm:
  submodule: teach rm to remove submodules unless they contain a git directory
Merge branch 'jm/diff-context-config' into jch

Teaches a new configuration variable to "git diff" Porcelain and
its friends.

Will merge to 'next' after squashing.

* jm/diff-context-config:
  diff: diff.context configuration gives default to -U
Merge branch 'lt/mailinfo-handle-attachment-more-sanely' into jch

A patch attached as application/octet-stream (e.g. not text/*) were
mishandled, not correctly honoring Content-Transfer-Encoding
(e.g. base64).

* lt/mailinfo-handle-attachment-more-sanely:
  mailinfo: don't require "text" mime type for attachments
Merge branch 'nd/grep-reflog' into jch

Teach the commands from the "log" family the "--grep-reflog" option
to limit output by string that appears in the reflog entry when the
"--walk-reflogs" option is in effect.

* nd/grep-reflog:
  revision: make --grep search in notes too if shown
  log --grep-reflog: reject the option without -g
  revision: add --grep-reflog to filter commits by reflog messages
  grep: prepare for new header field filter
Merge branch 'rc/maint-complete-git-p4' into jch

Comment from Pete will need to be addressed in a follow-up patch.

* rc/maint-complete-git-p4:
  Teach git-completion about git p4
Merge branch 'mk/maint-graph-infinity-loop' into jch

The --graph code fell into infinite loop when asked to do what the
code did not expect ;-)

Anybody who worked on --graph wants to comment?

* mk/maint-graph-infinity-loop:
  graph.c: infinite loop in git whatchanged --graph -m
Merge branch 'mh/ceiling' into jch

Elements of GIT_CEILING_DIRECTORIES list may not match the real
pathname we obtain from getcwd(), leading the GIT_DIR discovery
logic to escape the ceilings the user thought to have specified.

The solution felt a bit unnecessarily convoluted to me.

* mh/ceiling:
  t1504: stop resolving symlinks in GIT_CEILING_DIRECTORIES
  longest_ancestor_length(): resolve symlinks before comparing paths
  longest_ancestor_length(): use string_list_longest_prefix()
  longest_ancestor_length(): always add a slash to the end of prefixes
  longest_ancestor_length(): explicitly filter list before loop
  longest_ancestor_length(): use string_list_split()
  Introduce new function real_path_if_valid()
  real_path_internal(): add comment explaining use of cwd
  Introduce new static function real_path_internal()
Merge branch 'jl/submodule-add-by-name' into jch

If you remove a submodule, in order to keep the repository so that
"git checkout" to an older commit in the superproject history can
resurrect the submodule, the real repository will stay in $GIT_DIR
of the superproject.  A later "git submodule add $path" to add a
different submodule at the same path will fail.  Diagnose this case
a bit better, and if the user really wants to add an unrelated
submodule at the same path, give the "--name" option to give it a
place in $GIT_DIR of the superproject that does not conflict with
the original submodule.

* jl/submodule-add-by-name:
  submodule add: Fail when .git/modules/<name> already exists unless forced
  Teach "git submodule add" the --name option
Merge branch 'bw/config-lift-variable-name-length-limit' into jch

* bw/config-lift-variable-name-length-limit:
  Remove the hard coded length limit on variable names in config files
Merge branch 'jc/maint-name-rev' into jch

"git name-rev" names the given revision based on a ref that can be
reached in the smallest number of steps from the rev, but that is
not useful when the caller wants to know which tag is the oldest one
that contains the rev.  This teaches a new mode to the command that
uses the oldest ref among those which contain the rev.

I am not sure if this is worth it; for one thing, even with the help
from notes-cache, it seems to make the "describe --contains" even
slower. Also the command will be unusably slow for a user who does
not have a write access (hence unable to create or update the
notes-cache).

Stalled mostly due to lack of responses.

* jc/maint-name-rev:
  describe --contains: use "name-rev --algorithm=weight"
  name-rev --algorithm=weight: tests and documentation
  name-rev --algorithm=weight: cache the computed weight in notes
  name-rev --algorithm=weight: trivial optimization
  name-rev: --algorithm option
  name_rev: clarify the logic to assign a new tip-name to a commit
  name-rev: lose unnecessary typedef

Conflicts:
	builtin/name-rev.c
Merge branch 'jc/blame-no-follow' into jch

Teaches "--no-follow" option to "git blame" to disable its
whole-file rename detection.

Stalled mostly due to lack of responses.

* jc/blame-no-follow:
  blame: pay attention to --no-follow
  diff: accept --no-follow option
Merge branch 'jc/add-delete-default' into jch

"git add dir/" updated modified files and added new files, but does
not notice removed files, which may be "Huh?" to some users.  They
can of course use "git add -A dir/", but why should they?

Resurrected from graveyard, as I thought it was a worthwhile thing
to do in the longer term.

Waiting for comments.

* jc/add-delete-default:
  git add: notice removal of tracked paths by default
Merge branch 'fa/remote-svn' into pu

A GSoC project.
Waiting for comments from mentors and stakeholders.

* fa/remote-svn:
  Add a test script for remote-svn
  remote-svn: add marks-file regeneration
  Add a svnrdump-simulator replaying a dump file for testing
  remote-svn: add incremental import
  remote-svn: Activate import/export-marks for fast-import
  Create a note for every imported commit containing svn metadata
  vcs-svn: add fast_export_note to create notes
  Allow reading svn dumps from files via file:// urls
  remote-svn, vcs-svn: Enable fetching to private refs
  When debug==1, start fast-import with "--stats" instead of "--quiet"
  Add documentation for the 'bidi-import' capability of remote-helpers
  Connect fast-import to the remote-helper via pipe, adding 'bidi-import' capability
  Add argv_array_detach and argv_array_free_detached
  Add svndump_init_fd to allow reading dumps from arbitrary FDs
  Add git-remote-testsvn to Makefile
  Implement a remote helper for svn in C
Merge branch 'fa/vcs-svn' into pu

A GSoC project.
Waiting for comments from mentors and stakeholders.

* fa/vcs-svn:
  vcs-svn: remove repo_tree
  vcs-svn/svndump: rewrite handle_node(), begin|end_revision()
  vcs-svn/svndump: restructure node_ctx, rev_ctx handling
  svndump: move struct definitions to .h
Merge branch 'jk/no-more-pre-exec-callback' into pu

(Originally merged to 'next' on 2012-07-23)

Will defer until the end of the 2012.
while waiting for older "less" to go extinct.

* jk/no-more-pre-exec-callback:
  pager: drop "wait for output to run less" hack
Merge branch 'nd/wildmatch' into pu

Allows pathname patterns in .gitignore and .gitattributes files
with double-asterisks "foo/**/bar" to match any number of directory
hiearchies.

It was pointed out that some symbols that do not have to be global
are left global. I think this reroll fixed most of them.

* nd/wildmatch:
  Support "**" in .gitignore and .gitattributes patterns using wildmatch()
  Integrate wildmatch to git
  compat/wildmatch: fix case-insensitive matching
  compat/wildmatch: remove static variable force_lower_case
  Import wildmatch from rsync
Merge branch 'tx/relative-in-the-future' into pu

Not my itch; rewritten an earlier submission by Tom Xue into
somewhat more maintainable form, though it breaks existing i18n.

Waiting for a voluteer to fix it up.
Otherwise may discard.

* tx/relative-in-the-future:
  date: show relative dates in the future
  date: refactor the relative date logic from presentation
Merge branch 'jc/maint-push-refs-all' into pu

Allows pushing and fetching everything including refs/stash.
This is broken (see the log message there).

Not ready.

* jc/maint-push-refs-all:
  get_fetch_map(): tighten checks on dest refs
  [BROKEN] fetch/push: allow refs/*:refs/*