Commit Graph

27166 Commits

Author SHA1 Message Date
Junio C Hamano
79cfe0c5c4 Merge branch 'ml/mailmap' into maint
* ml/mailmap:
  mailmap: xcalloc mailmap_info

Conflicts:
	mailmap.c
2011-11-18 11:14:00 -08:00
Junio C Hamano
01e0f162a7 Merge branch 'jn/maint-notes-avoid-va-args' into maint
* jn/maint-notes-avoid-va-args:
  notes merge: eliminate OUTPUT macro

Conflicts:
	notes-merge.c
2011-11-18 11:11:50 -08:00
Jonathan Nieder
487da9cdf4 Makefile: add missing header file dependencies
When the streaming filter API was introduced in v1.7.7-rc0~60^2~7
(2011-05-20), we forgot to add its header to LIB_H.  Most translation
units depend on streaming.h via cache.h.

v1.7.5-rc0~48 (Fix sparse warnings, 2011-03-22) introduced undeclared
dependencies by url.o on url.h and thread-utils.o on thread-utils.h.

Noticed by make CHECK_HEADER_DEPENDENCIES=1.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 10:45:33 -08:00
Jonathan Nieder
5f9f8d15f1 notes merge: eliminate OUTPUT macro
The macro is variadic, which breaks support for pre-C99 compilers,
and it hides an "if", which can make code hard to understand on
first reading if some arguments have side-effects.

The OUTPUT macro seems to have been inspired by the "output" function
from merge-recursive.  But that function in merge-recursive exists to
indent output based on the level of recursion and there is no similar
justification for such a function in "notes merge".

Noticed with 'make CC="gcc -std=c89 -pedantic"':

 notes-merge.c:24:22: warning: anonymous variadic macros were introduced in C99 [-Wvariadic-macros]

Encouraged-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-17 23:35:22 -08:00
Jonathan Nieder
418c9b176c do not let git_path clobber errno when reporting errors
Because git_path() calls vsnprintf(), code like

	fd = open(git_path("SQUASH_MSG"), O_WRONLY | O_CREAT, 0666);
	die_errno(_("Could not write to '%s'"), git_path("SQUASH_MSG"));

can end up printing an error indicator from vsnprintf() instead of
open() by mistake.  Store the path we are trying to write to in a
temporary variable and pass _that_ to die_errno(), so the messages
written by git cherry-pick/revert and git merge can avoid this source
of confusion.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-17 15:06:27 -08:00
Junio C Hamano
4d2440fe0d Git 1.7.8-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-17 11:06:15 -08:00
Junio C Hamano
09116a1c31 refs: loosen over-strict "format" check
The add_extra_ref() interface is used to add an extra-ref that is _not_
our ref for the purpose of helping auto-following of tags and reducing
object transfer from remote repository, and they are typically formatted
as a tagname followed by ^{} to make sure no valid refs match that
pattern. In other words, these entries are deliberately formatted not to
pass check-refname-format test.

A recent series however added a test unconditionally to the add_ref()
function that is called from add_extra_ref(). The check may be sensible
for other two callsites of the add_ref() interface, but definitely is
a wrong thing to do in add_extra_ref(). Disable it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
2011-11-16 21:52:24 -08:00
Marc-André Lureau
74b531f65f mailmap: xcalloc mailmap_info
This is to avoid reaching free of uninitialized members.

With an invalid .mailmap (and perhaps in other cases), it can reach
free(mi->name) with garbage for example.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-16 18:00:56 -08:00
Ramkumar Ramachandra
5e1e6b93d0 revert: prettify fatal messages
Some of the fatal messages printed by revert and cherry-pick look ugly
like the following:

  fatal: Could not open .git/sequencer/todo.: No such file or directory

The culprit here is that these callers of the die_errno() function did not
take it into account that the message string they give to it is followed
by ": <strerror>", hence the message typically should not end with the
full-stop.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-15 16:59:46 -08:00
Ramkumar Ramachandra
e4ac953b2a git-compat-util: don't assume value for undefined variable
Suggested-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-15 16:09:34 -08:00
Ramkumar Ramachandra
5e12e78e52 sha1_file: don't mix enum with int
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-15 16:09:20 -08:00
Ramkumar Ramachandra
7356b51e4b convert: don't mix enum with int
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-15 16:09:02 -08:00
Ramkumar Ramachandra
620771c83e http: remove unused function hex()
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-15 16:08:48 -08:00
Junio C Hamano
e8b14d7e3f name-rev --all: do not even attempt to describe non-commit object
This even dates back to the very beginning of "git name-rev";
it does not make much sense to dump all objects in the repository
and label non-commits as "undefined".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-15 15:51:05 -08:00
Junio C Hamano
f0c7fd49c0 Revert "upload-archive: use start_command instead of fork"
This reverts commit c09cd77ea2, expecting a
better version to be rerolled soon.
2011-11-15 15:39:33 -08:00
Junio C Hamano
bc1bbe0c19 Git 1.7.8-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-12 22:14:53 -08:00
Junio C Hamano
dc865af65f Merge branch 'ly/mktree-using-strbuf'
* ly/mktree-using-strbuf:
  mktree: fix a memory leak in write_tree()
2011-11-11 21:34:06 -08:00
Junio C Hamano
c444c16589 Merge "Move 'builtin-*' into a 'builtin/' subdirectory" 2011-11-10 09:10:51 -08:00
Junio C Hamano
77f143bf3e Merge 'build-in git-mktree'
* commit '633e3556ccbc': (5835 commits)
  build-in git-mktree
  allow -t abbreviation for --track in git branch
  gitweb: Remove function prototypes (cleanup)
  Documentation: cloning to empty directory is allowed
  Clarify kind of conflict in merge-one-file helper
  git config: clarify --add and --get-color
  archive-tar.c: squelch a type mismatch warning
  Start 1.6.4 development
  Start 1.6.3.1 maintenance series.
  GIT 1.6.3
  t4029: use sh instead of bash
  t4200: convert sed expression which operates on non-text file to perl
  t4200: remove two unnecessary lines
  t/annotate-tests.sh: avoid passing a non-newline terminated file to sed
  t4118: avoid sed invocation on file without terminating newline
  t4118: add missing '&&'
  t8005: use egrep when extended regular expressions are required
  git-clean doc: the command only affects paths under $(cwd)
  improve error message in config.c
  t4018-diff-funcname: add cpp xfuncname pattern to syntax test
  ...
2011-11-10 09:05:31 -08:00
Liu Yuan
cd9519bd2c mktree: fix a memory leak in write_tree()
We forget to call strbuf_release to release the buf memory.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-10 09:04:08 -08:00
Junio C Hamano
248dbbe832 Merge branch 'sn/complete-bash-wo-process-subst'
* sn/complete-bash-wo-process-subst:
  completion: don't leak variable from the prompt into environment
2011-11-09 05:46:39 -08:00
SZEDER Gábor
4804d43791 completion: don't leak variable from the prompt into environment
Commit e5b8eebc (completion: fix issue with process substitution not
working on Git for Windows, 2011-10-26) introduced a new variable in
__git_ps1_show_upstream(), but didn't declare it as local to prevent it
from leaking into the environment.

We may want to rewrite it like the following, but that can wait until the
next cycle.

	while read key value
	do
		...
	done <<-EOF
	$(git config -z --get-regexp ...)
	EOF

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-09 05:44:05 -08:00
Junio C Hamano
8a04247896 Update draft release notes to 1.7.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-08 16:42:33 -08:00
Junio C Hamano
d7a0129b3c Merge branch 'jc/remote-setbranches-usage-fix'
* jc/remote-setbranches-usage-fix:
  remote: fix set-branches usage
2011-11-08 16:40:31 -08:00
Junio C Hamano
8327ee8677 Merge branch 'fc/remote-seturl-usage-fix'
* fc/remote-seturl-usage-fix:
  remote: fix remote set-url usage
2011-11-08 16:40:27 -08:00
Junio C Hamano
14ba45a2e6 Sync with 1.7.7.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-08 16:38:14 -08:00
Junio C Hamano
d4d5ab4727 Git 1.7.7.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-08 16:37:00 -08:00
Junio C Hamano
916034b93c Merge branch 'jc/maint-remove-renamed-ref' into maint
* jc/maint-remove-renamed-ref:
  branch -m/-M: remove undocumented RENAMED-REF

Conflicts:
	refs.c
2011-11-08 16:35:53 -08:00
Junio C Hamano
1a61a9dae8 Merge branch 'jm/maint-gitweb-filter-forks-fix' into maint
* jm/maint-gitweb-filter-forks-fix:
  gitweb: fix regression when filtering out forks
2011-11-08 16:26:50 -08:00
Junio C Hamano
992499d853 Merge branch 'dm/pack-objects-update' into maint
* dm/pack-objects-update:
  pack-objects: don't traverse objects unnecessarily
  pack-objects: rewrite add_descendants_to_write_order() iteratively
  pack-objects: use unsigned int for counter and offset values
  pack-objects: mark add_to_write_order() as inline
2011-11-08 16:26:45 -08:00
Junio C Hamano
fcbebfdd33 docs: Update install-doc-quick
The preformatted documentation pages live in their own repositories
these days. Adjust the installation procedure to the updated layout.

Tested-by: Stefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-08 13:37:10 -08:00
Jeff King
939ca96b0e docs: don't mention --quiet or --exit-code in git-log(1)
These are diff-options, but they don't actually make sense
in the context of log.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-08 13:37:02 -08:00
Junio C Hamano
4cb6764227 Git 1.7.8-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-07 16:48:34 -08:00
Junio C Hamano
92622e6214 Merge branch 'ss/blame-textconv-fake-working-tree'
* ss/blame-textconv-fake-working-tree:
  blame.c: Properly initialize strbuf after calling textconv_object(), again
2011-11-07 16:43:19 -08:00
Sebastian Schuberth
8518088fe8 blame.c: Properly initialize strbuf after calling textconv_object(), again
2564aa4 started to initialize buf.alloc, but that should actually be one
more byte than the string length due to the trailing \0. Also, do not
modify buf.alloc out of the strbuf code. Use the existing strbuf_attach
instead.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-07 16:42:57 -08:00
Junio C Hamano
5ae0f68160 Merge branch 'ab/i18n-test-fix'
* ab/i18n-test-fix:
  t/t7508-status.sh: use test_i18ncmp
  t/t6030-bisect-porcelain.sh: use test_i18ngrep
2011-11-06 21:22:22 -08:00
Junio C Hamano
78c17b9943 Merge branch 'sn/http-auth-with-netrc-fix'
* sn/http-auth-with-netrc-fix:
  http: don't always prompt for password
2011-11-06 21:22:19 -08:00
Junio C Hamano
de26347950 Merge branch 'pw/p4-appledouble-fix'
* pw/p4-appledouble-fix:
  git-p4: ignore apple filetype
2011-11-06 21:21:57 -08:00
Felipe Contreras
c49904efb5 remote: fix remote set-url usage
Bad copy-paste.

Otherwise the help text for "git remote set-url --help" would show help
for "git remote update" subcommand.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-06 21:16:34 -08:00
Junio C Hamano
656cdf0c9e remote: fix set-branches usage
Bad copy-paste.

Otherwise "git remote set-branches" without necessary argument
will result in an error message and help for set-url subcommand.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-06 21:15:30 -08:00
Ævar Arnfjörð Bjarmason
83838d5c1b cast variable in call to free() in builtin/diff.c and submodule.c
Both of these free() calls are freeing a "const unsigned char (*)[20]"
type while free() expects a "void *". This results in the following
warning under clang 2.9:

    builtin/diff.c:185:7: warning: passing 'const unsigned char (*)[20]' to parameter of type 'void *' discards qualifiers
            free(parent);
                 ^~~~~~

    submodule.c:394:7: warning: passing 'const unsigned char (*)[20]' to parameter of type 'void *' discards qualifiers
            free(parents);
                 ^~~~~~~

This free()-ing without a cast was added by Jim Meyering to
builtin/diff.c in v1.7.6-rc3~4 and later by Fredrik Gustafsson in
submodule.c in v1.7.7-rc1~25^2.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-06 10:43:18 -08:00
Ævar Arnfjörð Bjarmason
473f4c96e3 apply: get rid of useless x < 0 comparison on a size_t type
According to the C standard size_t is always unsigned, therefore the
comparison "n1 < 0 || n2 < 0" when n1 and n2 are size_t will always be
false.

This was raised by clang 2.9 which throws this warning when compiling
apply.c:

    builtin/apply.c:253:9: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
            if (n1 < 0 || n2 < 0)
                ~~ ^ ~
    builtin/apply.c:253:19: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
            if (n1 < 0 || n2 < 0)
                          ~~ ^ ~

This check was originally added in v1.6.5-rc0~53^2 by Giuseppe Bilotta
while adding an option to git-apply to ignore whitespace differences.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-06 10:36:59 -08:00
Pete Wyckoff
9f7ef0eaf2 git-p4: ignore apple filetype
Revert 97a21ca (git-p4: stop ignoring apple filetype, 2011-10-16)
and add a test case.

Reported-by: Michael Wookey <michaelwookey@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-05 23:17:52 -07:00
Ævar Arnfjörð Bjarmason
ca0f515d75 t/t7508-status.sh: use test_i18ncmp
Change a i18n-specific comparison in t/t7508-status.sh to use
test_i18ncmp instead. This was introduced in v1.7.6.3~11^2 and has
been broken under GETTEXT_POISON=YesPlease since.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-05 23:14:26 -07:00
Ævar Arnfjörð Bjarmason
475b3777bd t/t6030-bisect-porcelain.sh: use test_i18ngrep
Change a i18n-specific grep in t/t6030-bisect-porcelain.sh to use
test_i18ngrep instead. This was introduced in v1.7.7.2~5^2~11 and has
been broken under GETTEXT_POISON=YesPlease since.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-05 23:14:25 -07:00
Stefan Naewe
986bbc0842 http: don't always prompt for password
When a username is already specified at the beginning of any HTTP
transaction (e.g. "git push https://user@hosting.example.com/project.git"
or "git ls-remote https://user@hosting.example.com/project.git"), the code
interactively asks for a password before calling into the libcurl library.
It is very likely that the reason why user included the username in the
URL is because the user knows that it would require authentication to
access the resource. Asking for the password upfront would save one
roundtrip to get a 401 response, getting the password and then retrying
the request. This is a reasonable optimization.

HOWEVER.

This is done even when $HOME/.netrc might have a corresponding entry to
access the site, or the site does not require authentication to access the
resource after all. But neither condition can be determined until we call
into libcurl library (we do not read and parse $HOME/.netrc ourselves). In
these cases, the user is forced to respond to the password prompt, only to
give a password that is not used in the HTTP transaction. If the password
is in $HOME/.netrc, an empty input would later let the libcurl layer to
pick up the password from there, and if the resource does not require
authentication, any input would be taken and then discarded without
getting used. It is wasteful to ask this unused information to the end
user.

Reduce the confusion by not trying to optimize for this case and always
incur roundtrip penalty. An alternative might be to document this and keep
this round-trip optimization as-is.

Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-04 09:47:18 -07:00
Junio C Hamano
ee6dfb2d83 receive-pack: do not expect object 0{40} to exist
When pushing to delete a ref, it uses 0{40} as an object name to signal
that the request is a deletion. We shouldn't trigger "deletion of a
corrupt ref" warning in such a case, which was designed to notice that a
ref points at an object that is truly missing from the repository.

Reported-by: Stefan Näwe
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-03 14:27:04 -07:00
Stefan Naewe
db85b3a74f t3200: add test case for 'branch -m'
Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-02 12:36:56 -07:00
Tay Ray Chuan
3706ed298c branch -m: handle no arg properly
Modify the option parsing heuristic to handle all -m (rename) cases,
including the no-arg case.

Previously, this "fell through" to the (argc <= 2) case and caused
segfault.

Reported-by: Stefan Näwe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-02 12:35:37 -07:00
Junio C Hamano
87bf9a7048 Update draft release notes to 1.7.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-01 16:44:57 -07:00