1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-10 02:56:17 +02:00
Commit Graph

33328 Commits

Author SHA1 Message Date
Jeff King f972a1658a mailmap: handle mailmap blobs without trailing newlines
The read_mailmap_buf function reads each line of the mailmap
using strchrnul, like:

    const char *end = strchrnul(buf, '\n');
    unsigned long linelen = end - buf + 1;

But that's off-by-one when we actually hit the NUL byte; our
line does not have a terminator, and so is only "end - buf"
bytes long. As a result, when we subtract the linelen from
the total len, we end up with (unsigned long)-1 bytes left
in the buffer, and we start reading random junk from memory.

We could fix it with:

    unsigned long linelen = end - buf + !!*end;

but let's take a step back for a moment. It's questionable
in the first place for a function that takes a buffer and
length to be using strchrnul. But it works because we only
have one caller (and are only likely to ever have this one),
which is handing us data from read_sha1_file. Which means
that it's always NUL-terminated.

Instead of tightening the assumptions to make the
buffer/length pair work for a caller that doesn't actually
exist, let's let loosen the assumptions to what the real
caller has: a modifiable, NUL-terminated string.

This makes the code simpler and shorter (because we don't
have to correlate strchrnul with the length calculation),
correct (because the code with the off-by-one just goes
away), and more efficient (we can drop the extra allocation
we needed to create NUL-terminated strings for each line,
and just terminate in place).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-28 12:33:32 -07:00
Eric Sunshine a3bc3d070c parse-options: fix clang opterror() -Wunused-value warning
a469a10193 (silence some -Wuninitialized false positives;
2012-12-15) triggered "unused value" warnings when the return value of
opterror() and several other error-related functions was not used.
5ded807f7c (fix clang -Wunused-value warnings for error functions;
2013-01-16) applied a fix by adding #if !defined(__clang__) in cache.h
and git-compat-util.h, but misspelled it as #if !defined(clang) in
parse-options.h. Fix this.

This mistake went unnoticed because existing callers of opterror()
utilize its return value.  1158826394 (parse-options: add
OPT_CMDMODE(); 2013-07-30), however, adds a new invocation of opterror()
which ignores the return value, thus triggering the "unused value"
warning.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-09 09:27:44 -07:00
Felix Gruber 0bf5ce4ef2 fix typo in documentation of git-svn
Signed-off-by: Felix Gruber <felgru@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-05 09:39:01 -07:00
Torstein Hegge 5104d21fbd Documentation/rev-list-options: add missing word in --*-parents
A commit has "parent commits" or "parents", not "commits".

Signed-off-by: Torstein Hegge <hegge@resisty.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-05 08:47:06 -07:00
Jonathan Nieder e6604c3537 log doc: the argument to --encoding is not optional
$ git log --encoding
 fatal: Option '--encoding' requires a value
 $ git rev-list --encoding
 fatal: Option '--encoding' requires a value

The argument to --encoding has always been mandatory.  Unfortunately
manpages like git-rev-list(1), git-log(1), and git-show(1) have
described the option's syntax as "--encoding[=<encoding>]" since it
was first documented.  Clarify by removing the extra brackets.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-05 08:19:47 -07:00
Junio C Hamano 117eea7eaa Git 1.8.3.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-22 11:21:34 -07:00
Ondřej Bílka efe6de6e40 update URL to the marc.info mail archive
The name marc.theaimsgroup.com is no longer active, and has
migrated to marc.info.

Signed-off-by: Ondřej Bílka <neleai@seznam.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-22 10:11:18 -07:00
Junio C Hamano 31fe4057b1 Update draft release notes to 1.8.3.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-21 23:03:19 -07:00
Junio C Hamano 281ff456fe Merge branch 'rr/maint-fetch-tag-doc-asterisks' into maint
* rr/maint-fetch-tag-doc-asterisks:
  fetch-options.txt: prevent a wildcard refspec from getting misformatted
2013-07-21 22:51:45 -07:00
Junio C Hamano 5607c74d29 Merge branch 'dk/maint-t5150-dirname' into maint
* dk/maint-t5150-dirname:
  tests: allow sha1's as part of the path
2013-07-21 22:51:43 -07:00
Junio C Hamano 25b3e4fffd Merge branch 'dk/version-gen-gitdir' into maint
* dk/version-gen-gitdir:
  GIT-VERSION-GEN: support non-standard $GIT_DIR path
2013-07-21 22:51:41 -07:00
Junio C Hamano b6538a0b4e Merge branch 'nk/config-local-doc' into maint
* nk/config-local-doc:
  config: Add description of --local option
2013-07-21 22:51:39 -07:00
Junio C Hamano eac00c508d Merge branch 'kb/diff-blob-blob-doc' into maint
* kb/diff-blob-blob-doc:
  Documentation: Move "git diff <blob> <blob>"
2013-07-21 22:51:37 -07:00
Junio C Hamano 4f9f1f5d56 Merge branch 'mm/merge-in-dirty-worktree-doc' into maint
* mm/merge-in-dirty-worktree-doc:
  Documentation/git-merge.txt: weaken warning about uncommited changes
2013-07-21 22:51:32 -07:00
Junio C Hamano 80f074396d Merge branch 'ph/builtin-srcs-are-in-subdir-these-days' into maint
* ph/builtin-srcs-are-in-subdir-these-days:
  fix "builtin-*" references to be "builtin/*"
2013-07-21 22:51:29 -07:00
Junio C Hamano 8c091d918d Merge branch 'ft/doc-git-transport' into maint
* ft/doc-git-transport:
  documentation: add git:// transport security notice
2013-07-21 22:51:24 -07:00
Junio C Hamano dbed593594 Merge branch 'mh/maint-lockfile-overflow' into maint
* mh/maint-lockfile-overflow:
  lockfile: fix buffer overflow in path handling
2013-07-21 22:51:22 -07:00
Junio C Hamano 82ec54dc8b Merge branch 'jc/maint-diff-core-safecrlf' into maint
Avoid failing "git diff" when core.safecrlf is set to true, because
the user cannot tell where the breakage is in preparation for fixing
and committing.

* jc/maint-diff-core-safecrlf:
  diff: demote core.safecrlf=true to core.safecrlf=warn
2013-07-21 22:48:13 -07:00
Vitor Antunes 7c8ce4ed32 t9801: git-p4: check ignore files with client spec
This test confirms that a file can be ignored during git p4 sync if if is
excluded in P4 client specification.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-21 15:34:10 -07:00
Junio C Hamano f893b7420c Start preparing for 1.8.3.4
Hopefully this will be the final maintenance release before we go to
feature freeze for 1.8.4.
2013-07-19 11:15:17 -07:00
Stefan Beller 1f976bd03f apply.c::find_name_traditional(): do not initialize len to the line's length
The variable len is set to

    len = strchrnul(line, '\n') - line;

unconditionally 9 lines later, hence we can remove the call to strlen.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-19 11:15:17 -07:00
Stefan Beller 3def06e625 http-push.c::add_send_request(): do not initialize transfer_request
That pointer will be assigned to new memory via

    request = xmalloc(sizeof(*request));

20 lines later unconditionally anyway, so it's safe to not assign it
to an arbitrary variable.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-19 11:15:17 -07:00
Junio C Hamano 98aa2eabf0 Merge branch 'tr/test-lint-no-export-assignment-in-shell' into maint
* tr/test-lint-no-export-assignment-in-shell:
  test-lint: detect 'export FOO=bar'
  t9902: fix 'test A == B' to use = operator
2013-07-19 10:43:13 -07:00
Junio C Hamano 871ed7842c Merge branch 'rr/name-rev-stdin-doc' into maint
* rr/name-rev-stdin-doc:
  name-rev doc: rewrite --stdin paragraph
2013-07-19 10:43:08 -07:00
Junio C Hamano ba5831fdae Merge branch 'ft/diff-rename-default-score-is-half' into maint
* ft/diff-rename-default-score-is-half:
  diff-options: document default similarity index
2013-07-19 10:43:05 -07:00
Junio C Hamano 069dba2a09 Merge branch 'jc/t1512-fix' into maint
* jc/t1512-fix:
  get_short_sha1(): correctly disambiguate type-limited abbreviation
  t1512: correct leftover constants from earlier edition
2013-07-19 10:43:02 -07:00
Junio C Hamano e6d6911941 Merge branch 'vl/typofix' into maint
* vl/typofix:
  random typofixes (committed missing a 't', successful missing an 's')
2013-07-19 10:42:57 -07:00
Junio C Hamano 0b57758c35 Merge branch 'wk/doc-git-has-grown' into maint
* wk/doc-git-has-grown:
  user-manual: Update download size for Git and the kernel
2013-07-19 10:42:52 -07:00
Junio C Hamano b002bb87f0 Merge branch 'ys/cygstart' into maint
* ys/cygstart:
  web--browse: support /usr/bin/cygstart on Cygwin
2013-07-19 10:42:49 -07:00
Junio C Hamano bd54df0716 Merge branch 'mm/push-force-is-dangerous' into maint
* mm/push-force-is-dangerous:
  Documentation/git-push.txt: explain better cases where --force is dangerous
2013-07-19 10:42:46 -07:00
Junio C Hamano 52c19991cb Merge branch 'rs/logical-vs-binary-or' into maint
* rs/logical-vs-binary-or:
  use logical OR (||) instead of binary OR (|) in logical context
2013-07-19 10:42:18 -07:00
Junio C Hamano 6ddc862e8b Merge branch 'js/test-ln-s-add' into maint
* js/test-ln-s-add:
  t4011: remove SYMLINKS prerequisite
  t6035: use test_ln_s_add to remove SYMLINKS prerequisite
  t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite
  t3100: use test_ln_s_add to remove SYMLINKS prerequisite
  t3030: use test_ln_s_add to remove SYMLINKS prerequisite
  t0000: use test_ln_s_add to remove SYMLINKS prerequisite
  tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)
  tests: introduce test_ln_s_add
  t3010: modernize style
  test-chmtime: Fix exit code on Windows
2013-07-19 10:41:23 -07:00
Junio C Hamano 211e76d48b Merge branch 'jk/apache-test-for-2.4' into maint
Allow our tests to run with newer Apache.

* jk/apache-test-for-2.4:
  lib-httpd/apache.conf: check version only after mod_version loads
  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
2013-07-19 10:41:01 -07:00
Junio C Hamano 8589a74b19 Merge branch 'tr/test-commit-only-on-orphan' into maint
* tr/test-commit-only-on-orphan:
  Test 'commit --only' after 'checkout --orphan'
2013-07-19 10:40:57 -07:00
Junio C Hamano 509152d3fa Merge branch 'sb/archive-zip-double-assignment-fix' into maint
* sb/archive-zip-double-assignment-fix:
  archive-zip:write_zip_entry: Remove second reset of size variable to zero.
2013-07-19 10:40:53 -07:00
Junio C Hamano 6741edcc50 Merge branch 'th/bisect-skip-report-range-fix' into maint
The bisect log listed incorrect commits when bisection ends with
only skipped ones.

* th/bisect-skip-report-range-fix:
  bisect: Fix log output for multi-parent skip ranges
2013-07-19 10:39:12 -07:00
Junio C Hamano afebd687f8 Merge branch 'rs/tar-tests' into maint
* rs/tar-tests:
  t5000: test long filenames
  t5000: simplify tar-tree tests
  t5000: use check_tar for prefix test
  t5000: factor out check_tar
  t5000, t5003: create directories for extracted files lazily
  t5000: integrate export-subst tests into regular tests
2013-07-19 10:39:10 -07:00
Junio C Hamano 439b55b37c Merge branch 'rr/column-doc' into maint
* rr/column-doc:
  column doc: rewrite documentation for column.ui
2013-07-19 10:39:06 -07:00
Junio C Hamano 65ed8684c4 Merge branch 'rs/discard-index-discard-array' into maint
* rs/discard-index-discard-array:
  read-cache: free cache in discard_index
  read-cache: add simple performance test
2013-07-19 10:39:01 -07:00
Junio C Hamano 7f05e4a617 Merge branch 'tr/coverage' into maint
The test coverage framework was left broken for some time.

* tr/coverage:
  coverage: build coverage-untested-functions by default
  coverage: set DEFAULT_TEST_TARGET to avoid using prove
  coverage: do not delete .gcno files before building
  coverage: split build target into compile and test
2013-07-19 10:38:18 -07:00
Stefan Beller debecc5558 Documentation: "git reset <tree-ish> <pathspec>" takes a tree-ish, not tree-sh
Reported-By: Ibrahim M. Ghazal <imgx64@gmail.com>
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-19 10:15:09 -07:00
Junio C Hamano 5addd1c753 Git 1.8.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 10:39:43 -07:00
Junio C Hamano 90360c710c Merge branch 'tr/maint-apply-non-git-patch-parsefix' into maint
"git apply" parsed patches that add new files, generated by programs
other than Git, incorrectly.  This is an old breakage in v1.7.11.

* tr/maint-apply-non-git-patch-parsefix:
  apply: carefully strdup a possibly-NULL name
2013-07-15 10:36:14 -07:00
Junio C Hamano 29b2f0565a Merge branch 'bc/http-keep-memory-given-to-curl' into maint
Older cURL wanted piece of memory we call it with to be stable, but
we updated the auth material after handing it to a call.

* bc/http-keep-memory-given-to-curl:
  http.c: don't rewrite the user:passwd string multiple times
2013-07-15 10:36:01 -07:00
Junio C Hamano d2db8f78c4 Merge branch 'jk/pull-into-dirty-unborn' into maint
"git pull" into nothing trashed "local changes" that were in the
index.

* jk/pull-into-dirty-unborn:
  pull: merge into unborn by fast-forwarding from empty tree
  pull: update unborn branch tip after index
2013-07-15 10:35:43 -07:00
Junio C Hamano 1f101bf650 Merge branch 'fg/submodule-non-ascii-path' into maint
Many "git submodule" operations did 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
2013-07-15 10:35:17 -07:00
Junio C Hamano 1b790212ef Merge branch 'fc/sequencer-plug-leak' into maint
"cherry-pick" had a small leak in its error codepath.

* fc/sequencer-plug-leak:
  sequencer: avoid leaking message buffer when refusing to create an empty commit
  sequencer: remove useless indentation
2013-07-15 10:35:04 -07:00
Junio C Hamano 8ca36db013 Merge branch 'mt/send-email-cc-match-fix' into maint
Logic used by git-send-email to suppress cc mishandled names like "A
U. Thor" <author@example.xz>, where the human readable part needs to
be quoted (the user input may not have the double quotes around the
name, and comparison was done between quoted and unquoted strings).
It also mishandled names that need RFC2047 quoting.

* mt/send-email-cc-match-fix:
  send-email: sanitize author when writing From line
  send-email: add test for duplicate utf8 name
  test-send-email: test for pre-sanitized self name
  t/send-email: test suppress-cc=self with non-ascii
  t/send-email: add test with quoted sender
  send-email: make --suppress-cc=self sanitize input
  t/send-email: test suppress-cc=self on cccmd
  send-email: fix suppress-cc=self on cccmd
  t/send-email.sh: add test for suppress-cc=self
2013-07-15 10:34:36 -07:00
Thomas Rast 9968ffff0d test-lint: detect 'export FOO=bar'
Some shells do not understand the one-line construct, and instead need

  FOO=bar &&
  export FOO

Detect this in the test-lint target.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-08 10:21:33 -07:00
Thomas Rast 38678a15a2 t9902: fix 'test A == B' to use = operator
The == operator as an alias to = is not POSIX.  This doesn't actually
matter for the execution of the script, because it only runs when the
shell is bash.  However, it trips up test-lint, so it's nicer to use
the standard form.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-08 10:20:59 -07:00