imap-send.c: remove some unused fields from struct store

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c: inline parse_imap_list() in parse_list()

The function is only called from here.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c: remove struct imap argument to parse_imap_list_l()

It was always set to NULL.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c: remove namespace fields from struct imap

They are unused, and their removal means that a bunch of list-related
infrastructure can be disposed of.

It might be that the "NAMESPACE" response that is now skipped over in
get_cmd_result() should never be sent by the server.  But somebody
would have to check the IMAP protocol and how we interact with the
server to be sure.  So for now I am leaving that branch of the "if"
statement there.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c: remove unused field imap_store::trashnc

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c: use struct imap_store instead of struct store

In fact, all struct store instances are upcasts of struct imap_store
anyway, so stop making the distinction.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c: remove unused field imap_store::uidvalidity

I suspect that the existence of both imap_store::uidvalidity and
store::uidvalidity was an accident.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c: fold struct store into struct imap_store

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c: simplify logic in lf_to_crlf()

* The first character in the string used to be special-cased to get
  around the fact that msg->buf[i - 1] is not defined for i == 0.
  Instead, keep track of the previous character in a separate
  variable, "lastc", initialized in such a way to let the loop handle
  i == 0 correctly.

* Make the two loops over the string look as similar as possible to
  make it more obvious that the count computed in the first pass
  agrees with the true length of the new string written in the second
  pass.  As a side effect, this makes it possible to use the "j"
  counter in place of lfnum and new_len.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'dl/am-hg-locale' into jch

Datestamp recorded in "Hg" format patch was reformatted incorrectly
to an e-mail looking date using locale dependant strftime, causing
patch application to fail.

This is an original "everything in C locale" version; the later one
that uses LC_TIME may technically be more correct, so I may replace
this with it later ($gmane/213660).

* dl/am-hg-locale:
  am: invoke perl's strftime in C locale
Merge branch 'as/pre-push-hook' into jch

Add an extra hook so that "git push" that is run without making
sure what is being pushed is sane can be checked and rejected (as
opposed to the user deciding not pushing).

* as/pre-push-hook:
  Add sample pre-push hook script
  [SQUASH???] t5571 sample hooks should consume their input
  push: Add support for pre-push hooks
  hooks: Add function to check if a hook exists
Merge branch 'jc/cvsimport-upgrade' into jch

The most important part of this series is the addition of the new
cvsimport by Eric Raymond that works with cvsps 3.x.  Given some
distros have inertia to be conservative, Git with cvsimport that
does not work with both 3.x will block adoption of cvsps 3.x by
them, and shipping Git with cvsimport that does not work with cvsps
2.x will block such a version of Git, so we'll do the proven "both
old and new are available, but we aim to deprecate and remove the
old one in due time" strategy that we used successfully in the
past.

Both folks on the Git side and Chris Rorvick (contributor to cvsps
3.0 and new cvsimport) seem happy with the new layout, so let's
wait for a few days to see how it evolves and merge it to 'next'.

* jc/cvsimport-upgrade:
  t9600: adjust for new cvsimport
  t9600: further prepare for sharing
  cvsimport-3: add a sample test
  cvsimport: make tests reusable for cvsimport-3
  cvsimport: start adding cvsps 3.x support
  cvsimport: introduce a version-switch wrapper
  cvsimport: allow setting a custom cvsps (2.x) program name
  Makefile: add description on PERL/PYTHON_PATH
Merge branch 'mh/imap-send-shrinkage' into jch

Remove a lot of unused code from "git imap-send".

With a further comment fixup in patch #6, this seems ready for
'next'.
Expecting a reroll.

* mh/imap-send-shrinkage:
  imap-send.c: simplify logic in lf_to_crlf()
  imap-send.c: fold struct store into struct imap_store
  imap-send.c: remove unused field imap_store::uidvalidity
  imap-send.c: use struct imap_store instead of struct store
  imap-send.c: remove unused field imap_store::trashnc
  imap-send.c: remove namespace fields from struct imap
  imap-send.c: remove struct imap argument to parse_imap_list_l()
  imap-send.c: inline parse_imap_list() in parse_list()
  imap-send.c: remove some unused fields from struct store
  imap-send.c: remove struct message
  imap-send.c: remove struct store_conf
  iamp-send.c: remove unused struct imap_store_conf
  imap-send.c: remove struct msg_data
  imap-send.c: remove msg_data::flags, which was always zero
Merge branch 'jc/valgrind-memcmp-bsearch' into jch

Squelch false positive in valgrind tests

Will merge to 'next'.

* jc/valgrind-memcmp-bsearch:
  ignore memcmp() overreading in bsearch() callback
Merge branch 'jc/custom-comment-char' into jch

An illustration to show codepaths that need to be touched to change
the hint lines in the edited text to begin with something other
than '#'.

Ralf has a reroll of this; will replace with it when it gets into a
better shape.

* jc/custom-comment-char:
  Allow custom "comment char"
Merge branch 'rs/archive-tar-config-parsing-fix' into jch

Configuration parsing for tar.* configuration variables were
broken; Peff's config parsing clean-up topic will address the same
breakage, so this may be superseded by that other topic.

* rs/archive-tar-config-parsing-fix:
  archive-tar: fix sanity check in config parsing
Merge branch 'ss/help-htmlpath-config-doc' into jch

Add missing doc.

Will merge to 'master'.

* ss/help-htmlpath-config-doc:
  config.txt: Document help.htmlpath config parameter
Merge branch 'dg/subtree-fixes' into pu

contrib/subtree updates; there are a few more from T. Zheng that
were posted separately, with an overlap.

Expecting a reroll.

* dg/subtree-fixes:
  contrib/subtree: mkdir the manual directory if needed
  contrib/subtree: honor $(DESTDIR)
  contrib/subtree: fix synopsis and command help
  contrib/subtree: better error handling for "add"
  contrib/subtree: add --unannotate option
  contrib/subtree: use %B for split Subject/Body
  t7900: remove test number comments
Merge branch 'mb/gitweb-highlight-link-target' into pu

Expecting a reroll.
$gmane/211935

* mb/gitweb-highlight-link-target:
  Highlight the link target line in Gitweb using CSS
Merge branch 'bc/append-signed-off-by' into pu

Expecting a reroll.
$gmane/212507

* bc/append-signed-off-by:
  t4014: do not use echo -n
  Unify appending signoff in format-patch, commit and sequencer
  format-patch: update append_signoff prototype
  format-patch: stricter S-o-b detection
  t4014: more tests about appending s-o-b lines
  sequencer.c: teach append_signoff to avoid adding a duplicate newline
  sequencer.c: teach append_signoff how to detect duplicate s-o-b
  sequencer.c: always separate "(cherry picked from" from commit body
  sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
  t/t3511: add some tests of 'cherry-pick -s' functionality
  t/test-lib-functions.sh: allow to specify the tag name to test_commit
  sequencer.c: remove broken support for rfc2822 continuation in footer

Conflicts:
	builtin/log.c
	t/t4014-format-patch.sh