Skip to content

Ensure that fsck only sees NUL-terminated buffers #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 210 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
81395f9
Merge branch 'ta/config-set' into next
gitster Aug 26, 2014
1eb7cc3
Merge branch 'jk/pretty-empty-format' into next
gitster Aug 26, 2014
2052a31
Merge branch 'pr/remotes-in-hashmap' into next
gitster Aug 26, 2014
51fca1a
Merge branch 'bc/archive-pax-header-mode' into next
gitster Aug 26, 2014
901e8c2
Merge branch 'ta/pretty-parse-config' into next
gitster Aug 26, 2014
c5a5a12
Merge branch 'jc/reopen-lock-file' into next
gitster Aug 26, 2014
6faccdb
Merge branch 'dt/cache-tree-repair' into next
gitster Aug 26, 2014
3a47fc5
Merge branch 'mm/config-edit-global' into next
gitster Aug 26, 2014
c66e1c4
Merge branch 'rs/init-no-duplicate-real-path' into next
gitster Aug 26, 2014
11be0d6
Merge branch 'rs/strbuf-getcwd' into next
gitster Aug 26, 2014
6e84aa9
Merge branch 'master' into next
gitster Aug 29, 2014
2ea514b
Merge branch 'bc/imap-send-doc' into next
gitster Aug 29, 2014
74f04af
Merge branch 'jk/command-line-config-empty-string' into next
gitster Aug 29, 2014
67967d3
Merge branch 'jc/apply-ws-prefix' into next
gitster Aug 29, 2014
d84b102
Merge branch 'lf/bundle-exclusion' into next
gitster Aug 29, 2014
3580add
Merge branch 'mm/log-branch-desc-plug-leak' into next
gitster Aug 29, 2014
db94527
Merge branch 'jk/stash-list-p' into next
gitster Aug 29, 2014
2cf846b
Merge branch 'la/init-doc' into next
gitster Aug 29, 2014
8390945
Merge branch 'tf/imap-send-create' into next
gitster Aug 29, 2014
90a4a8b
Merge branch 'rs/refresh-beyond-symlink' into next
gitster Aug 29, 2014
e42f0b8
Merge branch 'sb/plug-leaks' into next
gitster Aug 29, 2014
5d1ddf4
Merge branch 'nd/strbuf-utf8-replace' into next
gitster Aug 29, 2014
5b33466
Merge branch 'sb/blame-msg-i18n' into next
gitster Aug 29, 2014
fb82508
Merge branch 'sb/prepare-revision-walk-error-check' into next
gitster Aug 29, 2014
77cfce1
Merge branch 'so/rebase-doc' into next
gitster Aug 29, 2014
0d00bb7
Merge branch 'jc/not-mingw-cygwin' into next
gitster Aug 29, 2014
8abb416
Merge branch 'km/no-apple-common-crypto-on-darwin-8-and-below' into next
gitster Aug 29, 2014
55e28af
Merge branch 'jc/config-mak-document-darwin-vs-macosx' into next
gitster Aug 29, 2014
88c1a9d
Merge branch 'rs/clean-menu-item-defn' into next
gitster Aug 29, 2014
5705ad5
Merge branch 'rs/inline-compat-path-macros' into next
gitster Aug 29, 2014
d219212
Merge branch 'ta/config-add-to-empty-or-true-fix' into next
gitster Aug 29, 2014
526e3bd
Merge branch 'jk/prompt-stash-could-be-packed' into next
gitster Aug 29, 2014
4f9ca4f
Merge branch 'sb/mailsplit-dead-code-removal' into next
gitster Aug 29, 2014
ab8ccd4
Merge branch 'tb/pretty-format-cd-date-format' into next
gitster Aug 29, 2014
b1ae451
Merge branch 'sp/pack-protocol-doc-on-shallow' into next
gitster Aug 29, 2014
7c4bc81
Merge branch 'master' into next
gitster Sep 2, 2014
1c8ff65
Merge branch 'dt/cache-tree-repair' into next
gitster Sep 3, 2014
68e20b8
Merge branch 'rs/ref-transaction-1' into next
gitster Sep 3, 2014
e3f872f
Merge branch 'mm/discourage-commit-a-to-finish-conflict-resolution' i…
gitster Sep 3, 2014
184b2ef
Merge branch 'ta/config-set-1' into next
gitster Sep 3, 2014
f2eff02
Merge branch 'ta/config-set-2' into next
gitster Sep 3, 2014
c17c06c
Merge branch 'rs/child-process-init' into next
gitster Sep 3, 2014
6d42f5e
Merge branch 'br/http-init-fix' into next
gitster Sep 3, 2014
5be5957
Merge branch 'et/spell-poll-infinite-with-minus-one-only' into next
gitster Sep 3, 2014
820a600
Merge branch 'jk/make-simplify-dependencies' into next
gitster Sep 3, 2014
919d889
Merge branch 'jk/contrib-subtree-make-all' into next
gitster Sep 3, 2014
4315447
Merge branch 'nd/mv-code-cleaning' into next
gitster Sep 3, 2014
e15803a
Merge branch 'jn/unpack-trees-checkout-m-carry-deletion' into next
gitster Sep 4, 2014
16d7c62
Merge branch 'nd/large-blobs' into next
gitster Sep 4, 2014
eecaf99
Merge branch 'rs/list-optim' into next
gitster Sep 4, 2014
bfe3873
Merge branch 'jk/prune-top-level-refs-after-packing' into next
gitster Sep 4, 2014
028cd42
Merge branch 'nd/fetch-pass-quiet-to-gc-child-process' into next
gitster Sep 4, 2014
74838e5
Merge branch 'jk/fast-import-fixes' into next
gitster Sep 4, 2014
05f0d29
Merge branch 'jk/name-decoration-alloc' into next
gitster Sep 4, 2014
a182987
Merge branch 'br/imap-send-simplify-tunnel-child-process' into next
gitster Sep 4, 2014
90a3d47
Merge branch 'master' into next
gitster Sep 9, 2014
9363127
Merge branch 'master' into next
gitster Sep 11, 2014
7f4ae4e
Merge branch 'jk/send-pack-many-refspecs' into next
gitster Sep 12, 2014
0af10fa
Merge branch 'jk/fast-export-anonymize' into next
gitster Sep 12, 2014
acb252b
Merge branch 'mb/build-contrib-svn-fe' into next
gitster Sep 12, 2014
c9d415d
Merge branch 'bb/date-iso-strict' into next
gitster Sep 12, 2014
cfbb6b6
Merge branch 'jk/commit-author-parsing' into next
gitster Sep 12, 2014
9241312
Merge branch 'jk/index-pack-threading-races' into next
gitster Sep 12, 2014
54016d5
Merge branch 'jp/index-with-corrupt-stages' into next
gitster Sep 12, 2014
d0fda49
Merge branch 'mb/fast-import-delete-root' into next
gitster Sep 12, 2014
156a436
Merge branch 'rs/more-uses-of-skip-prefix' into next
gitster Sep 12, 2014
58fbb44
Merge branch 'ah/grammofix' into next
gitster Sep 12, 2014
a22322e
Merge branch 'da/styles' into next
gitster Sep 12, 2014
5b4c349
Merge branch 'rs/merge-tree-simplify' into next
gitster Sep 12, 2014
e4ffd6d
Merge branch 'rs/simplify-config-include' into next
gitster Sep 12, 2014
b5178d2
Merge branch 'rs/simplify-http-walker' into next
gitster Sep 12, 2014
2c950af
Merge branch 'tb/crlf-tests' into next
gitster Sep 12, 2014
a287484
Merge branch 'as/calloc-takes-nmemb-then-size' into next
gitster Sep 12, 2014
1b7d259
Merge branch 'tb/complete-diff-ignore-blank-lines' into next
gitster Sep 12, 2014
de2b50b
Merge branch 'mk/reachable-protect-detached-head' into next
gitster Sep 12, 2014
43dba24
Merge branch 'jc/parseopt-verify-short-name' into next
gitster Sep 12, 2014
371df71
Merge branch 'kb/perf-trace' into next
gitster Sep 12, 2014
8b25fe0
Merge branch 'rs/export-strbuf-addchars' into next
gitster Sep 12, 2014
af779a7
Merge branch 'ta/config-add-to-empty-or-true-fix' into next
gitster Sep 15, 2014
11ec716
Merge branch 'sp/doc-update-index-cacheinfo' into next
gitster Sep 15, 2014
c5609e9
Merge branch 'js/no-test-cmp-for-binaries' into next
gitster Sep 15, 2014
ba35eb3
Merge branch 'mr/mark-i18n-log-rerere' into next
gitster Sep 15, 2014
0e87594
Merge branch 'ss/compat-default-source-for-newer-gnu' into next
gitster Sep 15, 2014
86ff198
Merge branch 'master' into next
gitster Sep 15, 2014
34c696f
Merge branch 'jk/fsck-exit-code-fix' into next
gitster Sep 18, 2014
bc1c273
Merge branch 'ir/makefile-typofix' into next
gitster Sep 18, 2014
cce521d
Merge branch 'so/rebase-doc' into next
gitster Sep 18, 2014
6f8c9d7
Merge branch 'wk/pre-push-sample-hook' into next
gitster Sep 18, 2014
f1e94fb
Merge branch 'jk/write-packed-refs-via-stdio' into next
gitster Sep 19, 2014
ea6ac62
Merge branch 'jc/hash-object' into next
gitster Sep 19, 2014
34d2840
Merge branch 'jk/faster-name-conflicts' into next
gitster Sep 19, 2014
4a62182
Merge branch 'js/fsck-tag-validation' into next
gitster Sep 19, 2014
f14a7fe
Merge branch 'jc/hash-object-fsck-tag' into next
gitster Sep 19, 2014
5e6c398
Merge branch 'jk/prune-packed-server-info' into next
gitster Sep 19, 2014
7abf293
Merge branch 'jc/ignore-sigpipe-while-running-hooks' into next
gitster Sep 19, 2014
51ba3be
Merge branch 'jk/close-stderr-of-credential-cache-deamon' into next
gitster Sep 19, 2014
314af77
Merge branch 'jk/mbox-from-line' into next
gitster Sep 19, 2014
7a54a76
Merge branch 'master' into next
gitster Sep 19, 2014
a5bb3a6
Merge branch 'rs/realloc-array' into next
gitster Sep 23, 2014
d940d15
Merge branch 'jk/branch-verbose-merged' into next
gitster Sep 23, 2014
6ab29ed
Merge branch 'sb/help-unknown-command-sort-fix' into next
gitster Sep 23, 2014
fb699c4
Merge branch 'hj/pretty-naked-decoration' into next
gitster Sep 23, 2014
5ed184a
Merge branch 'da/rev-parse-verify-quiet' into next
gitster Sep 23, 2014
72969e2
Merge branch 'rs/graph-simplify' into next
gitster Sep 23, 2014
176e316
Merge branch 'rs/remote-simplify' into next
gitster Sep 23, 2014
aa519bd
Merge branch 'sb/t9300-typofix' into next
gitster Sep 23, 2014
aec57a9
Merge branch 'sb/t6031-typofix' into next
gitster Sep 23, 2014
506b89b
Merge branch 'jk/mbox-from-line' into next
gitster Sep 23, 2014
a99f5d8
Merge branch 'jc/push-cert' into next
gitster Sep 24, 2014
2d678ed
Merge branch 'pr/use-default-sigpipe-setting' into next
gitster Sep 24, 2014
b8dfbef
Merge branch 'sb/merge-recursive-copy-paste-fix' into next
gitster Sep 24, 2014
3eb1d69
Merge branch 'jc/push-cert' into next
gitster Sep 25, 2014
efd65ba
Merge branch 'jt/itimer-autoconf' into next
gitster Sep 25, 2014
8806f93
Merge branch 'nd/archive-pathspec' into next
gitster Sep 25, 2014
ed479f3
Merge branch 'jc/test-lazy-prereq' into next
gitster Sep 25, 2014
85a663a
Merge branch 'master' into next
gitster Sep 26, 2014
990ffec
Sync with master
gitster Sep 28, 2014
be4056e
Merge branch 'bw/use-write-script-in-tests' into next
gitster Sep 29, 2014
4efa26b
Merge branch 'master' into next
gitster Sep 29, 2014
47fc36d
Merge branch 'sp/stream-clean-filter' into next
gitster Sep 30, 2014
b253abb
Sync with master
gitster Sep 30, 2014
ea5bcb4
Merge branch 'da/include-compat-util-first-in-c' into next
gitster Oct 7, 2014
03d8ed6
Merge branch 'so/rebase-doc-fork-point' into next
gitster Oct 7, 2014
923bd93
Merge branch 'dt/cache-tree-repair' into next
gitster Oct 7, 2014
4171e10
Merge branch 'rs/daemon-fixes' into next
gitster Oct 7, 2014
2467c19
Merge branch 'da/completion-show-signature' into next
gitster Oct 7, 2014
4587c01
Sync with master
gitster Oct 7, 2014
5960711
Merge branch 'rs/sha1-array-test' into next
gitster Oct 8, 2014
58b053e
Merge branch 'rs/mailsplit' into next
gitster Oct 8, 2014
cd153c0
Merge branch 'rs/more-uses-of-skip-prefix' into next
gitster Oct 8, 2014
5539cd7
Merge branch 'rs/plug-leak-in-bundle' into next
gitster Oct 8, 2014
39cb6da
Merge branch 'mh/lockfile' into next
gitster Oct 8, 2014
e56cebc
Merge branch 'mh/lockfile-stdio' into next
gitster Oct 8, 2014
e425f54
Merge branch 'sk/tag-contains-wo-recursion' into next
gitster Oct 8, 2014
2852361
Sync with master
gitster Oct 8, 2014
8208335
Merge branch 'bc/asciidoc-pretty-formats-fix' into next
gitster Oct 13, 2014
daf1d03
Merge branch 'po/everyday-doc' into next
gitster Oct 13, 2014
19facbb
Merge branch 'bw/trace-no-inline-getnanotime' into next
gitster Oct 14, 2014
1cf12e1
Merge branch 'jc/completion-no-chdir' into next
gitster Oct 14, 2014
9118506
Merge branch 'jk/test-shell-trace' into next
gitster Oct 14, 2014
ed660e4
Merge branch 'ta/config-set' into next
gitster Oct 14, 2014
d9ff206
Merge branch 'bc/asciidoc' into next
gitster Oct 14, 2014
e64654d
Merge branch 'rs/receive-pack-argv-leak-fix' into next
gitster Oct 14, 2014
7f0a3ad
Merge branch 'jn/parse-config-slot' into next
gitster Oct 14, 2014
1f81b46
Sync with master
gitster Oct 14, 2014
26a8a7d
Sync with master
gitster Oct 16, 2014
ee4519c
Merge branch 'cc/interpret-trailers' into next
gitster Oct 17, 2014
12ce2e2
Merge branch 'bc/asciidoctor' into next
gitster Oct 17, 2014
4b3a1d9
Merge branch 'ss/contrib-subtree-contacts' into next
gitster Oct 17, 2014
7ca427f
Merge branch 'rm/gitweb-start-form' into next
gitster Oct 17, 2014
1390624
Merge branch 'rs/ref-transaction' into next
gitster Oct 17, 2014
239fefe
Merge branch 'da/mergetool-tests' into next
gitster Oct 17, 2014
3fb95b5
Merge branch 'da/mergetool-temporary-filename' into next
gitster Oct 17, 2014
854654c
Merge branch 'da/mergetool-tool-help' into next
gitster Oct 17, 2014
261e74e
Merge branch 'da/mergetool-temporary-directory' into next
gitster Oct 17, 2014
00ee553
Merge branch 'da/mergetool-meld' into next
gitster Oct 17, 2014
466de3c
Merge branch 'js/completion-hide-not-a-repo' into next
gitster Oct 17, 2014
fdd7ff6
Merge branch 'jk/prune-mtime' into next
gitster Oct 20, 2014
72aedf1
Sync with master
gitster Oct 20, 2014
c3c8c2a
Merge branch 'jk/pack-objects-no-bitmap-when-splitting' into next
gitster Oct 21, 2014
4e56fa2
Merge branch 'rs/run-command-env-array' into next
gitster Oct 21, 2014
c455d39
Merge branch 'eb/no-pthreads' into next
gitster Oct 21, 2014
00fe6d9
Merge branch 'wk/t1304-wo-USER' into next
gitster Oct 21, 2014
efca89c
Merge branch 'po/doc-status-markup' into next
gitster Oct 21, 2014
ad3e63b
Merge branch 'tb/core-filemode-doc' into next
gitster Oct 21, 2014
0a462d7
Merge branch 'sb/plug-transport-leak' into next
gitster Oct 21, 2014
c90ba7a
Merge branch 'nd/dir-prep-exclude-cleanup' into next
gitster Oct 21, 2014
b76ea34
Merge branch 'jc/clone-borrow' into next
gitster Oct 21, 2014
f636a00
Merge branch 'jc/checkout-local-track-report' into next
gitster Oct 21, 2014
ab5de42
Sync with master
gitster Oct 21, 2014
d5a7410
grep: fix match highlighting for combined patterns with context lines
zklinger Oct 21, 2014
2d2f8f8
Merge branch 'zk/grep-color-words' into next
gitster Oct 24, 2014
e9278e8
Merge branch 'oc/mergetools-beyondcompare' into next
gitster Oct 24, 2014
26228e1
Sync with master
gitster Oct 24, 2014
2e50bf5
Revert "grep: fix match highlighting for combined patterns with conte…
gitster Oct 27, 2014
a5b6349
Merge branch 'bc/asciidoctor' into next
gitster Oct 28, 2014
4d0457c
Merge branch 'zk/grep-color-words' into next
gitster Oct 28, 2014
4e6659d
Merge branch 'rs/grep-color-words' into next
gitster Oct 28, 2014
f396990
Merge branch 'mg/lib-gpg-ro-safety' into next
gitster Oct 28, 2014
4daedb1
Merge branch 'jc/diff-b-m' into next
gitster Oct 28, 2014
d03d3ae
Merge branch 'dm/port2zos' into next
gitster Oct 28, 2014
19da3f6
Merge branch 'da/difftool' into next
gitster Oct 28, 2014
fc74359
Merge branch 'rb/pack-window-memory-config-doc' into next
gitster Oct 28, 2014
9167582
Merge branch 'jc/strbuf-add-lines-avoid-sp-ht-sequence' into next
gitster Oct 29, 2014
693250f
Merge branch 'jc/conflict-hint' into next
gitster Oct 29, 2014
d3ae2e4
Merge branch 'jc/push-cert' into next
gitster Oct 29, 2014
21a76a2
Merge branch 'rs/child-process-init' into next
gitster Oct 29, 2014
836ef29
Sync with master
gitster Oct 29, 2014
63c253d
Sync with master
gitster Oct 30, 2014
35ae3ef
Sync with 2.2-rc0
gitster Oct 31, 2014
6ebd88d
Merge branch 'jk/cache-tree-protect-from-broken-libgit2' into next
gitster Nov 3, 2014
a82d885
Merge branch 'rs/use-child-process-init-more' into next
gitster Nov 3, 2014
a3a616c
Merge branch 'master' into next
gitster Nov 3, 2014
31b9a22
Merge branch 'master' into next
gitster Nov 4, 2014
b0476c9
Merge branch 'jk/fetch-reflog-df-conflict' into next
gitster Nov 5, 2014
b0fadd3
Merge branch 'js/diff-highlight-avoid-sigpipe' into next
gitster Nov 5, 2014
8a6f650
Merge branch 'tm/line-log-first-parent' into next
gitster Nov 5, 2014
e7f43d6
Merge branch 'nd/gitignore-trailing-whitespace' into next
gitster Nov 5, 2014
68722a9
Merge branch 'nd/lockfile-absolute' into next
gitster Nov 6, 2014
491e576
Merge branch 'jc/merge-bases' into next
gitster Nov 6, 2014
2db757b
Merge branch 'master' into next
gitster Nov 6, 2014
d1b4acf
Sync with 2.2-rc1
gitster Nov 7, 2014
68672bc
Sync with master
gitster Nov 10, 2014
88c1491
Merge branch 'jk/fetch-reflog-df-conflict' into next
gitster Nov 11, 2014
02acac1
Sync with master
gitster Nov 11, 2014
d9e58ec
Merge branch 'br/imap-send-verbosity' into next
gitster Nov 12, 2014
5327ab4
Merge branch 'br/imap-send-via-libcurl' into next
gitster Nov 12, 2014
9da3436
Sync with master
gitster Nov 12, 2014
ee901be
index-pack: terminate object buffers with NUL
pclouds Dec 8, 2014
567ad59
fsck: verify that we get only NUL-terminated buffers
dscho Dec 8, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Documentation/git-clone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SYNOPSIS
'git clone' [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
[-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
[--separate-git-dir <git dir>]
[--dissociate] [--separate-git-dir <git dir>]
[--depth <depth>] [--[no-]single-branch]
[--recursive | --recurse-submodules] [--] <repository>
[<directory>]
Expand Down Expand Up @@ -98,7 +98,14 @@ objects from the source repository into a pack in the cloned repository.
require fewer objects to be copied from the repository
being cloned, reducing network and local storage costs.
+
*NOTE*: see the NOTE for the `--shared` option.
*NOTE*: see the NOTE for the `--shared` option, and also the
`--dissociate` option.

--dissociate::
Borrow the objects from reference repositories specified
with the `--reference` options only to reduce network
transfer and stop borrowing from them after a clone is made
by making necessary local copies of borrowed objects.

--quiet::
-q::
Expand Down
27 changes: 25 additions & 2 deletions Documentation/git-imap-send.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ git-imap-send - Send a collection of patches from stdin to an IMAP folder
SYNOPSIS
--------
[verse]
'git imap-send'
'git imap-send' [-v] [-q] [--[no-]curl]


DESCRIPTION
Expand All @@ -26,6 +26,27 @@ Typical usage is something like:
git format-patch --signoff --stdout --attach origin | git imap-send


OPTIONS
-------

-v::
--verbose::
Be verbose.

-q::
--quiet::
Be quiet.

--curl::
Use libcurl to communicate with the IMAP server, unless tunneling
into it. Ignored if Git was built without the USE_CURL_FOR_IMAP_SEND
option set.

--no-curl::
Talk to the IMAP server using git's own IMAP routines instead of
using libcurl.


CONFIGURATION
-------------

Expand Down Expand Up @@ -75,7 +96,9 @@ imap.preformattedHTML::

imap.authMethod::
Specify authenticate method for authentication with IMAP server.
Current supported method is 'CRAM-MD5' only. If this is not set
If Git was built with the NO_CURL option, or if your curl version is older
than 7.34.0, or if you're running git-imap-send with the `--no-curl`
option, the only supported method is 'CRAM-MD5'. If this is not set
then 'git imap-send' uses the basic IMAP plaintext LOGIN command.

Examples
Expand Down
15 changes: 9 additions & 6 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,21 @@ Issues of note:
so you might need to install additional packages other than Perl
itself, e.g. Time::HiRes.

- "openssl" library is used by git-imap-send to use IMAP over SSL.
If you don't need it, use NO_OPENSSL.
- git-imap-send needs the OpenSSL library to talk IMAP over SSL if
you are using libcurl older than 7.34.0. Otherwise you can use
NO_OPENSSL without losing git-imap-send.

By default, git uses OpenSSL for SHA1 but it will use its own
library (inspired by Mozilla's) with either NO_OPENSSL or
BLK_SHA1. Also included is a version optimized for PowerPC
(PPC_SHA1).

- "libcurl" library is used by git-http-fetch and git-fetch. You
might also want the "curl" executable for debugging purposes.
If you do not use http:// or https:// repositories, you do not
have to have them (use NO_CURL).
- "libcurl" library is used by git-http-fetch, git-fetch, and, if
the curl version >= 7.34.0, for git-imap-send. You might also
want the "curl" executable for debugging purposes. If you do not
use http:// or https:// repositories, and do not want to put
patches into an IMAP mailbox, you do not have to have them
(use NO_CURL).

- "expat" library; git-http-push uses it for remote lock
management over DAV. Similar to "curl" above, this is optional
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,9 @@ ifdef HAVE_ALLOCA_H
BASIC_CFLAGS += -DHAVE_ALLOCA_H
endif

IMAP_SEND_BUILDDEPS =
IMAP_SEND_LDFLAGS = $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)

ifdef NO_CURL
BASIC_CFLAGS += -DNO_CURL
REMOTE_CURL_PRIMARY =
Expand Down Expand Up @@ -1029,6 +1032,15 @@ else
PROGRAM_OBJS += http-push.o
endif
endif
curl_check := $(shell (echo 072200; curl-config --vernum) 2>/dev/null | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "072200"
USE_CURL_FOR_IMAP_SEND = YesPlease
endif
ifdef USE_CURL_FOR_IMAP_SEND
BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
IMAP_SEND_BUILDDEPS = http.o
IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)
endif
ifndef NO_EXPAT
ifdef EXPATDIR
BASIC_CFLAGS += -I$(EXPATDIR)/include
Expand Down Expand Up @@ -1874,7 +1886,7 @@ gettext.sp gettext.s gettext.o: GIT-PREFIX
gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
-DGIT_LOCALE_PATH='"$(localedir_SQ)"'

http-push.sp http.sp http-walker.sp remote-curl.sp: SPARSE_FLAGS += \
http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \
-DCURL_DISABLE_TYPECHECK

ifdef NO_EXPAT
Expand All @@ -1895,9 +1907,9 @@ endif
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)

git-imap-send$X: imap-send.o GIT-LDFLAGS $(GITLIBS)
git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
$(LIBS) $(IMAP_SEND_LDFLAGS)

git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
Expand Down
2 changes: 1 addition & 1 deletion bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ static void check_merge_bases(int no_checkout)
int rev_nr;
struct commit **rev = get_bad_and_good_commits(&rev_nr);

result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1, 0);
result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1);

for (; result; result = result->next) {
const unsigned char *mb = result->item->object.sha1;
Expand Down
20 changes: 20 additions & 0 deletions builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static int option_verbosity;
static int option_progress = -1;
static struct string_list option_config;
static struct string_list option_reference;
static int option_dissociate;

static int opt_parse_reference(const struct option *opt, const char *arg, int unset)
{
Expand Down Expand Up @@ -94,6 +95,8 @@ static struct option builtin_clone_options[] = {
N_("create a shallow clone of that depth")),
OPT_BOOL(0, "single-branch", &option_single_branch,
N_("clone only one branch, HEAD or --branch")),
OPT_BOOL(0, "dissociate", &option_dissociate,
N_("use --reference only while cloning")),
OPT_STRING(0, "separate-git-dir", &real_git_dir, N_("gitdir"),
N_("separate git dir from working tree")),
OPT_STRING_LIST('c', "config", &option_config, N_("key=value"),
Expand Down Expand Up @@ -735,6 +738,16 @@ static void write_refspec_config(const char *src_ref_prefix,
strbuf_release(&value);
}

static void dissociate_from_references(void)
{
static const char* argv[] = { "repack", "-a", "-d", NULL };

if (run_command_v_opt(argv, RUN_GIT_CMD|RUN_COMMAND_NO_STDIN))
die(_("cannot repack to clean up"));
if (unlink(git_path("objects/info/alternates")) && errno != ENOENT)
die_errno(_("cannot unlink temporary alternates file"));
}

int cmd_clone(int argc, const char **argv, const char *prefix)
{
int is_bundle = 0, is_local;
Expand Down Expand Up @@ -880,6 +893,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)

if (option_reference.nr)
setup_reference();
else if (option_dissociate) {
warning(_("--dissociate given, but there is no --reference"));
option_dissociate = 0;
}

fetch_pattern = value.buf;
refspec = parse_fetch_refspec(1, &fetch_pattern);
Expand Down Expand Up @@ -993,6 +1010,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
transport_unlock_pack(transport);
transport_disconnect(transport);

if (option_dissociate)
dissociate_from_references();

junk_mode = JUNK_LEAVE_REPO;
err = checkout();

Expand Down
74 changes: 48 additions & 26 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,52 @@ static void adjust_comment_line_char(const struct strbuf *sb)
comment_line_char = *p;
}

/*
* Inspect sb and determine the true "end" of the log message, in
* order to find where to put a new Signed-off-by: line. Ignored are
* trailing comment lines and blank lines, and also the traditional
* "Conflicts:" block that is not commented out, so that we can use
* "git commit -s --amend" on an existing commit that forgot to remove
* it.
*
* Returns the number of bytes from the tail to ignore, to be fed as
* the second parameter to append_signoff().
*/
static int ignore_non_trailer(struct strbuf *sb)
{
int boc = 0;
int bol = 0;
int in_old_conflicts_block = 0;

while (bol < sb->len) {
char *next_line;

if (!(next_line = memchr(sb->buf + bol, '\n', sb->len - bol)))
next_line = sb->buf + sb->len;
else
next_line++;

if (sb->buf[bol] == comment_line_char || sb->buf[bol] == '\n') {
/* is this the first of the run of comments? */
if (!boc)
boc = bol;
/* otherwise, it is just continuing */
} else if (starts_with(sb->buf + bol, "Conflicts:\n")) {
in_old_conflicts_block = 1;
if (!boc)
boc = bol;
} else if (in_old_conflicts_block && sb->buf[bol] == '\t') {
; /* a pathname in the conflicts block */
} else if (boc) {
/* the previous was not trailing comment */
boc = 0;
in_old_conflicts_block = 0;
}
bol = next_line - sb->buf;
}
return boc ? sb->len - boc : 0;
}

static int prepare_to_commit(const char *index_file, const char *prefix,
struct commit *current_head,
struct wt_status *s,
Expand Down Expand Up @@ -800,32 +846,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (clean_message_contents)
stripspace(&sb, 0);

if (signoff) {
/*
* See if we have a Conflicts: block at the end. If yes, count
* its size, so we can ignore it.
*/
int ignore_footer = 0;
int i, eol, previous = 0;
const char *nl;

for (i = 0; i < sb.len; i++) {
nl = memchr(sb.buf + i, '\n', sb.len - i);
if (nl)
eol = nl - sb.buf;
else
eol = sb.len;
if (starts_with(sb.buf + previous, "\nConflicts:\n")) {
ignore_footer = sb.len - previous;
break;
}
while (i < eol)
i++;
previous = eol;
}

append_signoff(&sb, ignore_footer, 0);
}
if (signoff)
append_signoff(&sb, ignore_non_trailer(&sb), 0);

if (fwrite(sb.buf, 1, sb.len, s->fp) < sb.len)
die_errno(_("could not write commit template"));
Expand Down
4 changes: 2 additions & 2 deletions builtin/index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static void *unpack_entry_data(unsigned long offset, unsigned long size,
if (type == OBJ_BLOB && size > big_file_threshold)
buf = fixed_buf;
else
buf = xmalloc(size);
buf = xmallocz(size);

memset(&stream, 0, sizeof(stream));
git_inflate_init(&stream);
Expand Down Expand Up @@ -552,7 +552,7 @@ static void *unpack_data(struct object_entry *obj,
git_zstream stream;
int status;

data = xmalloc(consume ? 64*1024 : obj->size);
data = xmallocz(consume ? 64*1024 : obj->size);
inbuf = xmalloc((len < 64*1024) ? len : 64*1024);

memset(&stream, 0, sizeof(stream));
Expand Down
4 changes: 2 additions & 2 deletions builtin/merge-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
{
struct commit_list *result;

result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1, 0);
result = get_merge_bases_many_dirty(rev[0], rev_nr - 1, rev + 1);

if (!result)
return 1;
Expand Down Expand Up @@ -176,7 +176,7 @@ static int handle_fork_point(int argc, const char **argv)
for (i = 0; i < revs.nr; i++)
revs.commit[i]->object.flags &= ~TMP_MARK;

bases = get_merge_bases_many(derived, revs.nr, revs.commit, 0);
bases = get_merge_bases_many_dirty(derived, revs.nr, revs.commit);

/*
* There should be one and only one merge base, when we found
Expand Down
Loading