Commit Graph

32230 Commits

Author SHA1 Message Date
Junio C Hamano
328455fc58 Merge branch 'maint'
* maint:
  diff.c: diff.renamelimit => diff.renameLimit in message
  wt-status: fix possible use of uninitialized variable
  fast-import: clarify "inline" logic in file_change_m
  run-command: always set failed_errno in start_command
  transport: drop "int cmp = cmp" hack
  drop some obsolete "x = x" compiler warning hacks
  fast-import: use pointer-to-pointer to keep list tail
2013-03-21 14:06:55 -07:00
Max Nanasy
c9fc4415e2 diff.c: diff.renamelimit => diff.renameLimit in message
In the warning message printed when rename or unmodified copy
detection was skipped due to too many files, change "diff.renamelimit"
to "diff.renameLimit", in order to make it consistent with git
documentation, which consistently uses "diff.renameLimit".

Signed-off-by: Max Nanasy <max.nanasy@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-21 14:06:49 -07:00
Jeff King
b8527d5fa6 wt-status: fix possible use of uninitialized variable
In wt_status_print_change_data, we accept a change_type flag
that is meant to be either WT_STATUS_UPDATED or
WT_STATUS_CHANGED.  We then switch() on this value to set
the local variable "status" for each case, but do not
provide a fallback "default" label to the switch statement.

As a result, the compiler realizes that "status" might be
unset, and complains with a warning. To silence this
warning, we use the "int status = status" trick.  This is
correct with the current code, as all callers provide one of
the two expected change_type flags. However, it's also a
maintenance trap, as there is nothing to prevent future
callers from passing another flag, nor to document this
assumption.

Instead of using the "x = x" hack, let's handle the default
case in the switch() statement with a die("BUG"). That tells
the compiler and any readers of the code exactly what the
function's input assumptions are.

We could also convert the flag to an enum, which would
provide a compile-time check on the function input. However,
since these flags are part of a larger enum, that would make
the code unnecessarily complex (we would have to make a new
enum with just the two flags, and then convert it to the old
enum for passing to sub-functions).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-21 14:06:49 -07:00
Jeff King
3aa99df802 fast-import: clarify "inline" logic in file_change_m
When we read a fast-import line like:

  M 100644 :1 foo.c

we point the local object_entry variable "oe" to the object
named by the mark ":1". When the input uses the "inline"
construct, however, we do not have such an object_entry.

The current code is careful not to access "oe" in the inline
case, but we can make the assumption even more obvious (and
catch violations of it) by setting oe to NULL and adding a
comment. As a bonus, this also squelches an over-zealous gcc
-Wuninitialized warning, which means we can drop the "oe =
oe" initialization hack.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-21 14:06:49 -07:00
Jeff King
25043d8aea run-command: always set failed_errno in start_command
When we fail to fork, we set the failed_errno variable to
the value of errno so it is not clobbered by later syscalls.
However, we do so in a conditional, and it is hard to see
later under what conditions the variable has a valid value.

Instead of setting it only when fork fails, let's just
always set it after forking. This is more obvious for human
readers (as we are no longer setting it as a side effect of
a strerror call), and it is more obvious to gcc, which no
longer generates a spurious -Wuninitialized warning. It also
happens to match what the WIN32 half of the #ifdef does.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-21 14:06:48 -07:00
Jeff King
c5d5c9a9a3 transport: drop "int cmp = cmp" hack
According to 47ec794, this initialization is meant to
squelch an erroneous uninitialized variable warning from gcc
4.0.1.  That version is quite old at this point, and gcc 4.1
and up handle it fine, with one exception. There seems to be
a regression in gcc 4.6.3, which produces the warning;
however, gcc versions 4.4.7 and 4.7.2 do not.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-21 14:06:44 -07:00
Jeff King
cbfd5e1cbb drop some obsolete "x = x" compiler warning hacks
In cases where the setting and access of a variable are
protected by the same conditional flag, older versions of
gcc would generate a "might be used unitialized" warning. We
silence the warning by initializing the variable to itself,
a hack that gcc recognizes.

Modern versions of gcc are smart enough to get this right,
going back to at least version 4.3.5. gcc 4.1 does get it
wrong in both cases, but is sufficiently old that we
probably don't need to care about it anymore.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-21 14:06:38 -07:00
Jeff King
4db34cc134 fast-import: use pointer-to-pointer to keep list tail
This is shorter, idiomatic, and it means the compiler does
not get confused about whether our "e" pointer is valid,
letting us drop the "e = e" hack.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-21 14:06:19 -07:00
Junio C Hamano
28ed8d7be9 Merge branch 'we/submodule-update-prefix-output'
"git submodule update", when recursed into sub-submodules, did not
acccumulate the prefix paths.

* we/submodule-update-prefix-output:
  submodule update: when using recursion, show full path
2013-03-21 14:03:10 -07:00
Junio C Hamano
8115c9386c Merge branch 'jk/mailsplit-maildir-muttsort'
Sort filenames read from the maildir/ in a way that is more likely
to sort messages in the order the writing MUA meant to, by sorting
numeric segment in numeric order and non-numeric segment in
alphabetical order.

* jk/mailsplit-maildir-muttsort:
  mailsplit: sort maildir filenames more cleverly
2013-03-21 14:03:08 -07:00
Junio C Hamano
e9bebbb67c Merge branch 'rs/zip-compresssed-size-with-export-subst'
When export-subst is used, "zip" output recorded incorrect
size of the file.

* rs/zip-compresssed-size-with-export-subst:
  archive-zip: fix compressed size for stored export-subst files
2013-03-21 14:03:04 -07:00
Junio C Hamano
95ef66df43 Merge branch 'mn/send-email-works-with-credential'
Hooks the credential system to send-email.

* mn/send-email-works-with-credential:
  git-send-email: use git credential to obtain password
  Git.pm: add interface for git credential command
  Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe
  Git.pm: refactor command_close_bidi_pipe to use _cmd_close
  Git.pm: fix example in command_close_bidi_pipe documentation
  Git.pm: allow command_close_bidi_pipe to be called as method
2013-03-21 14:03:02 -07:00
Junio C Hamano
ea11711210 Merge branch 'tz/credential-authinfo'
A new read-only credential helper (in contrib/) to interact with
the .netrc/.authinfo files.  Hopefully mn/send-email-authinfo topic
can rebuild on top of something like this.

* tz/credential-authinfo:
  Add contrib/credentials/netrc with GPG support
2013-03-21 14:03:00 -07:00
Junio C Hamano
31b12a1999 Merge branch 'jk/utf-8-can-be-spelled-differently'
Some platforms and users spell UTF-8 differently; retry with the
most official "UTF-8" when the system does not understand the
user-supplied encoding name that are the common alternative
spellings of UTF-8.

* jk/utf-8-can-be-spelled-differently:
  utf8: accept alternate spellings of UTF-8
2013-03-21 14:02:58 -07:00
Junio C Hamano
0f6875dbe2 Merge branch 'mg/gpg-interface-using-status'
Call "gpg" using the right API when validating the signature on
tags.

* mg/gpg-interface-using-status:
  pretty: make %GK output the signing key for signed commits
  pretty: parse the gpg status lines rather than the output
  gpg_interface: allow to request status return
  log-tree: rely upon the check in the gpg_interface
  gpg-interface: check good signature in a reliable way
2013-03-21 14:02:55 -07:00
Junio C Hamano
dcf0d12aed Merge branch 'rt/commit-cleanup-config'
Fix tests that contaminated their environments and affected new
tests introduced later in the sequence by containing their effects
in their own subshells.

* rt/commit-cleanup-config:
  t7502: perform commits using alternate editor in a subshell
2013-03-21 14:02:53 -07:00
Junio C Hamano
42e129f47a Merge branch 'nd/branch-error-cases'
"git branch" had more cases where it did not bother to check
nonsense command line parameters.

* nd/branch-error-cases:
  branch: segfault fixes and validation
2013-03-21 14:02:51 -07:00
Junio C Hamano
6d7e0c522e Merge branch 'ap/maint-update-index-h-is-for-help'
"git update-index -h" did not do the usual "-h(elp)" thing.

* ap/maint-update-index-h-is-for-help:
  update-index: allow "-h" to also display options
2013-03-21 14:02:48 -07:00
Junio C Hamano
8d747e17e0 Merge branch 'jc/perl-cat-blob'
perl/Git.pm::cat_blob slurped everything in core only to write it
out to a file descriptor, which was not a very smart thing to do.

* jc/perl-cat-blob:
  Git.pm: fix cat_blob crashes on large files
2013-03-21 14:02:46 -07:00
Junio C Hamano
98ed062a92 Merge branch 'da/difftool-fixes'
Minor maintenance updates to difftool, and updates to its tests.

* da/difftool-fixes:
  t7800: "defaults" is no longer a builtin tool name
  t7800: modernize tests
  t7800: update copyright notice
  difftool: silence uninitialized variable warning
2013-03-21 14:02:44 -07:00
Junio C Hamano
e3b3b73c6e Merge branch 'ob/imap-send-ssl-verify'
Correctly connect to SSL/TLS sites that serve multiple hostnames on
a single IP by including Server Name Indication in the client-hello.

* ob/imap-send-ssl-verify:
  imap-send: support Server Name Indication (RFC4366)
2013-03-21 14:02:40 -07:00
Junio C Hamano
54797b98b8 Merge branch 'bc/commit-complete-lines-given-via-m-option'
'git commit -m "$str"' when $str was already terminated with a LF
now avoids adding an extra LF to the message.

* bc/commit-complete-lines-given-via-m-option:
  Documentation/git-commit.txt: rework the --cleanup section
  git-commit: only append a newline to -m mesg if necessary
  t7502: demonstrate breakage with a commit message with trailing newlines
  t/t7502: compare entire commit message with what was expected
2013-03-21 14:02:37 -07:00
Junio C Hamano
f5715de54a Merge branch 'nd/count-garbage'
"git count-objects -v" did not count leftover temporary packfiles
and other kinds of garbage.

* nd/count-garbage:
  count-objects: report how much disk space taken by garbage files
  count-objects: report garbage files in pack directory too
  sha1_file: reorder code in prepare_packed_git_one()
  git-count-objects.txt: describe each line in -v output
2013-03-21 14:02:34 -07:00
Junio C Hamano
e4e1c54990 Merge branch 'jc/fetch-raw-sha1'
Allows requests to fetch objects at any tip of refs (including
hidden ones).  It seems that there may be use cases even outside
Gerrit (e.g. $gmane/215701).

* jc/fetch-raw-sha1:
  fetch: fetch objects by their exact SHA-1 object names
  upload-pack: optionally allow fetching from the tips of hidden refs
  fetch: use struct ref to represent refs to be fetched
  parse_fetch_refspec(): clarify the codeflow a bit
2013-03-21 14:02:27 -07:00
Junio C Hamano
c241e285e5 Merge branch 'nd/preallocate-hash'
When we know approximately how many entries we will have in the
hash-table, it makes sense to size the hash table to that number
from the beginning to avoid unnecessary rehashing.

* nd/preallocate-hash:
  Preallocate hash tables when the number of inserts are known in advance
2013-03-21 14:02:19 -07:00
Junio C Hamano
09386fff33 Merge branch 'nd/index-pack-l10n-buf-overflow'
* nd/index-pack-l10n-buf-overflow:
  index-pack: fix buffer overflow caused by translations
2013-03-21 14:02:16 -07:00
Junio C Hamano
5d04924e19 Merge branch 'tb/document-status-u-tradeoff'
Suggest users to look into using--untracked=no option when "git
status" takes too long.

* tb/document-status-u-tradeoff:
  status: advise to consider use of -u when read_directory takes too long
  git status: document trade-offs in choosing parameters to the -u option
2013-03-21 14:02:10 -07:00
Junio C Hamano
03da85b954 Merge branch 'jn/shell-disable-interactive'
When the interactive access to git-shell is not enabled, we issue a
message meant to help the system admininstrator to enable it. Add
an explicit way to help the end users who connect to the service by
issuing custom messages to refuse such an access.

* jn/shell-disable-interactive:
  shell: new no-interactive-login command to print a custom message
  shell doc: emphasize purpose and security model
2013-03-21 14:01:53 -07:00
Junio C Hamano
858c2e050f Merge branch 'jc/maint-push-refspec-default-doc'
Clarify in the documentation "what" gets pushed to "where" when the
command line to "git push" does not say these explicitly.

* jc/maint-push-refspec-default-doc:
  Documentation/git-push: clarify the description of defaults
2013-03-21 14:01:48 -07:00
Junio C Hamano
7b9a41987a The first wave of topics for 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-19 12:30:28 -07:00
Junio C Hamano
4d5dcd976d Merge branch 'jc/add-2.0-u-A-sans-pathspec' (early part)
* 'jc/add-2.0-u-A-sans-pathspec' (early part):
  t2200: check that "add -u" limits itself to subdirectory
2013-03-19 12:21:27 -07:00
Junio C Hamano
a6da9cba61 Merge branch 'lf/bundle-verify-list-prereqs'
* lf/bundle-verify-list-prereqs:
  bundle: Add colons to list headings in "verify"
  bundle: Fix "verify" output if history is complete
2013-03-19 12:21:09 -07:00
Junio C Hamano
c278e6f53d Merge branch 'jk/graph-c-expose-symbols-for-cgit'
In the v1.8.0 era, we changed symbols that do not have to be global
to file scope static, but a few functions in graph.c were used by
CGit from sideways bypassing the entry points of the API the
in-tree users use.

* jk/graph-c-expose-symbols-for-cgit:
  Revert "graph.c: mark private file-scope symbols as static"
2013-03-19 12:20:56 -07:00
Junio C Hamano
dbe71f9e24 Merge branch 'tk/doc-filter-branch'
* tk/doc-filter-branch:
  Documentation: filter-branch env-filter example
  git-filter-branch.txt: clarify ident variables usage
2013-03-19 12:20:50 -07:00
Junio C Hamano
118f542e92 Merge branch 'wk/user-manual-literal-format'
* wk/user-manual-literal-format:
  user-manual: Standardize backtick quoting
2013-03-19 12:20:44 -07:00
Junio C Hamano
9b79956018 Merge branch 'rj/msvc-build'
* rj/msvc-build:
  msvc: avoid collisions between "tags" and "TAGS"
  msvc: test-svn-fe: Fix linker "unresolved external" error
  msvc: Fix build by adding missing symbol defines
  msvc: git-daemon: Fix linker "unresolved external" errors
  msvc: Fix compilation errors caused by poll.h emulation
2013-03-19 12:20:40 -07:00
Junio C Hamano
31ccd35df4 Merge branch 'dm/ni-maxhost-may-be-missing'
On systems without NI_MAXHOST in their system header files,
connect.c (hence most of the transport) did not compile.

* dm/ni-maxhost-may-be-missing:
  git-compat-util.h: Provide missing netdb.h definitions
2013-03-19 12:18:21 -07:00
Junio C Hamano
3ae5d5016e Merge branch 'gp/describe-match-uses-glob-pattern'
The syntax of the pattern given to the "--match=<pattern>" argument
to "git describe" was not documented to be a glob.

* gp/describe-match-uses-glob-pattern:
  describe: Document --match pattern format
2013-03-19 12:16:31 -07:00
Junio C Hamano
9adf272a38 Merge branch 'gp/avoid-explicit-mention-of-dot-git-refs'
* gp/avoid-explicit-mention-of-dot-git-refs:
  Fix ".git/refs" stragglers
2013-03-19 12:16:22 -07:00
Junio C Hamano
c2bf648b84 Merge branch 'da/downcase-u-in-usage'
* da/downcase-u-in-usage:
  contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string
  contrib/examples/git-remote.perl: use a lowercase "usage:" string
  tests: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  Documentation/user-manual.txt: use a lowercase "usage:" string
  templates/hooks--update.sample: use a lowercase "usage:" string
  contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
  contrib/examples: use a lowercase "usage:" string
  contrib/fast-import/import-zips.py: use spaces instead of tabs
  contrib/fast-import/import-zips.py: fix broken error message
  contrib/fast-import: use a lowercase "usage:" string
  contrib/credential: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsexportcommit: use a lowercase "usage:" string
  git-archimport: use a lowercase "usage:" string
  git-merge-one-file: use a lowercase "usage:" string
  git-relink: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  git-sh-setup: use a lowercase "usage:" string
2013-03-19 12:15:54 -07:00
Junio C Hamano
865e99b5fd Merge branch 'nd/doc-index-format'
Update the index format documentation to mention the v4 format.

* nd/doc-index-format:
  update-index: list supported idx versions and their features
  read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr()
  index-format.txt: mention of v4 is missing in some places
2013-03-19 12:15:14 -07:00
Junio C Hamano
f944ec9aa5 Merge branch 'wk/doc-pre-rebase'
* wk/doc-pre-rebase:
  Documentation/githooks: Explain pre-rebase parameters
2013-03-19 12:14:05 -07:00
Junio C Hamano
3e1b08bbf5 Merge branch 'jc/color-diff-doc'
The --color[=<when>] option to the diff family was documented in a
confusing way.

* jc/color-diff-doc:
  diff-options: unconfuse description of --color
2013-03-19 12:11:32 -07:00
Junio C Hamano
048d4d98b3 Start the post 1.8.2 cycle
Again, tentatively let's call this cycle 1.8.3.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-18 15:01:19 -07:00
Junio C Hamano
1c71541ddd Merge branch 'maint'
* maint:
  t1507: Test that branchname@{upstream} is interpreted as branch
2013-03-17 15:39:43 -07:00
Kacper Kornet
617cf93182 t1507: Test that branchname@{upstream} is interpreted as branch
Syntax branchname@{upstream} should interpret its argument as a name of
a branch. Add the test to check that it doesn't try to interpret it as a
refname if the branch in question does not exist.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-17 15:38:23 -07:00
Junio C Hamano
bb79a827a2 Merge branch 'maint'
* maint:
  rev-parse: clarify documentation of $name@{upstream} syntax
  sha1_name: pass object name length to diagnose_invalid_sha1_path()
  Makefile: keep LIB_H entries together and sorted
2013-03-17 00:11:11 -07:00
Kacper Kornet
47e329ef7c rev-parse: clarify documentation of $name@{upstream} syntax
"git rev-parse" interprets string in string@{upstream} as a name of
a branch not a ref. For example, refs/heads/master@{upstream} looks
for an upstream branch that is merged by git-pull to ref
refs/heads/refs/heads/master not to refs/heads/master.

However the documentation could mislead a user to believe that the
string is interpreted as ref.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-17 00:10:59 -07:00
René Scharfe
b2981d0622 sha1_name: pass object name length to diagnose_invalid_sha1_path()
The only caller of diagnose_invalid_sha1_path() extracts a substring from
an object name by creating a NUL-terminated copy of the interesting part.
Add a length parameter to the function and thus avoid the need for an
allocation, thereby simplifying the code.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-17 00:10:51 -07:00
Nguyễn Thái Ngọc Duy
c73592812d Preallocate hash tables when the number of inserts are known in advance
This avoids unnecessary re-allocations and reinsertions. On webkit.git
(i.e. about 182k inserts to the name hash table), this reduces about
100ms out of 3s user time.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-16 22:57:29 -07:00