gitweb.git
Merge branch 'jc/maint-pathspec-stdin-and-cmdline'... Junio C Hamano Thu, 26 May 2011 16:38:44 +0000 (09:38 -0700)

Merge branch 'jc/maint-pathspec-stdin-and-cmdline' into maint

* jc/maint-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

Merge branch 'jk/cherry-pick-root-with-resolve' into... Junio C Hamano Thu, 26 May 2011 16:37:41 +0000 (09:37 -0700)

Merge branch 'jk/cherry-pick-root-with-resolve' into maint

* jk/cherry-pick-root-with-resolve:
t3503: test cherry picking and reverting root commits
revert: allow reverting a root commit
cherry-pick: handle root commits with external strategies

Merge branch 'rg/copy-gecos-username' into maintJunio C Hamano Thu, 26 May 2011 16:37:04 +0000 (09:37 -0700)

Merge branch 'rg/copy-gecos-username' into maint

* rg/copy-gecos-username:
copy_gecos: fix not adding nlen to len when processing "&"

Merge branch 'fc/completion-zsh' into maintJunio C Hamano Thu, 26 May 2011 16:36:33 +0000 (09:36 -0700)

Merge branch 'fc/completion-zsh' into maint

* fc/completion-zsh:
git-completion: fix regression in zsh support

Merge branch 'jk/git-connection-deadlock-fix' into... Junio C Hamano Thu, 26 May 2011 16:33:25 +0000 (09:33 -0700)

Merge branch 'jk/git-connection-deadlock-fix' into maint

* jk/git-connection-deadlock-fix:
test core.gitproxy configuration
send-pack: avoid deadlock on git:// push with failed pack-objects
connect: let callers know if connection is a socket
connect: treat generic proxy processes like ssh processes

Conflicts:
connect.c

Merge branch 'js/maint-send-pack-stateless-rpc-deadlock... Junio C Hamano Thu, 26 May 2011 16:32:14 +0000 (09:32 -0700)

Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix' into maint

* js/maint-send-pack-stateless-rpc-deadlock-fix:
sideband_demux(): fix decl-after-stmt
send-pack: unbreak push over stateless rpc
send-pack: avoid deadlock when pack-object dies early

compat/fnmatch/fnmatch.c: give a fall-back definition... Junio C Hamano Thu, 26 May 2011 16:25:47 +0000 (09:25 -0700)

compat/fnmatch/fnmatch.c: give a fall-back definition for NULL

Somebody tried to compile fnmatch.c compatibility file on Interix and got
an error because no header included in the file on that platform defined
NULL. It usually comes from stddef.h and indirectly from other headers
like string.h, unistd.h, stdio.h, stdlib.h, etc., but with the way we
compile this file from our Makefile, inclusion of the header files that
are expected to define NULL in fnmatch.c do not happen because they are
protected with "#ifdef STDC_HEADERS", etc. which we do not pass.

As the least-impact workaround, give a fall-back definition when none of
the headers define NULL.

Noticed-by: Markus Duft <mduft@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'svn-fe-maint' of git://repo.or.cz/git... Junio C Hamano Thu, 26 May 2011 15:52:11 +0000 (08:52 -0700)

Merge branch 'svn-fe-maint' of git://repo.or.cz/git/jrn into maint

* 'svn-fe-maint' of git://repo.or.cz/git/jrn:
Revert "t0081 (line-buffer): add buffering tests"

Merge branch 'jc/bigfile'Junio C Hamano Wed, 25 May 2011 23:23:26 +0000 (16:23 -0700)

Merge branch 'jc/bigfile'

* jc/bigfile:
Bigfile: teach "git add" to send a large file straight to a pack
index_fd(): split into two helper functions
index_fd(): turn write_object and format_check arguments into one flag

Merge branch 'js/log-abbrev-commit-config'Junio C Hamano Wed, 25 May 2011 23:23:22 +0000 (16:23 -0700)

Merge branch 'js/log-abbrev-commit-config'

* js/log-abbrev-commit-config:
Add log.abbrevCommit config variable
"git log -h": typofix misspelled 'suppress'

Merge branch 'maint'Junio C Hamano Wed, 25 May 2011 22:25:44 +0000 (15:25 -0700)

Merge branch 'maint'

* maint:
init/clone: remove short option -L and document --separate-git-dir

Teach read-tree the -n|--dry-run optionJens Lehmann Wed, 25 May 2011 20:10:41 +0000 (22:10 +0200)

Teach read-tree the -n|--dry-run option

The option can be used to check if read-tree with the same set of other
options like "-m" and "-u" would succeed without actually changing either
the index or the working tree.

The relevant tests in the t10?? range were extended to do a read-tree -n
before the real read-tree to make sure neither the index nor any local
files were changed with -n and the same exit code as without -n is
returned. The helper functions added for that purpose reside in the new
t/lib-read-tree.sh file.

The only exception is #13 in t1004 ("unlinking an un-unlink-able
symlink"). As this is an issue of wrong directory permissions it is not
detected with -n.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees: add the dry_run flag to unpack_trees_optionsJens Lehmann Wed, 25 May 2011 20:07:51 +0000 (22:07 +0200)

unpack-trees: add the dry_run flag to unpack_trees_options

Until now there was no way to test if unpack_trees() with update=1 would
succeed without really updating the work tree. The reason for that is that
setting update to 0 does skip the tests for new files and deactivates the
sparse handling, thereby making that unsuitable as a dry run.

Add the new dry_run flag to struct unpack_trees_options unpack_trees().
Setting that together with the update flag will check if the work tree
update would be successful without doing it for real.

The only class of problems that is not detected at the moment are file
system conditions like ENOSPC or missing permissions. Also the index
entries of updated files are not as they would be after a real checkout
because lstat() isn't run as the files aren't updated for real.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

userformat_find_requirements(): find requirement for... Junio C Hamano Wed, 25 May 2011 19:23:44 +0000 (12:23 -0700)

userformat_find_requirements(): find requirement for the correct format

This function was introduced in 5b16360 (pretty: Initialize notes if %N is
used, 2010-04-13) to check what kind of information the "log --format=..."
user format string wants. The function can be passed a NULL instead of a
format string to ask it to check user_format variable kept by an earlier
call to save_user_format().

But it unconditionally checked user_format and not the string it was
given. The only caller introduced by the change passes NULL, which
kept the bug unnoticed, until a new GCC noticed that there is an
assignment to fmt that is never used.

Noticed-by: Chris Wilson's compiler
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Jeff King <peff@peff.net>

gitweb: Refactor reading and parsing config file into... Jakub Narebski Wed, 25 May 2011 16:35:26 +0000 (18:35 +0200)

gitweb: Refactor reading and parsing config file into read_config_file

Beside being obvious reduction of duplicated code, this is enables us
to easily call site-wide config file in per-installation config file.

The actual update to documentation is left for next commit, because of
possible exclusive alternative (possible other next commit) of always
reading system-wide config file and relying on per-instalation config
file overriding system-wide defaults.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sh-18n: quell "unused variable" warningMichael J Gruber Wed, 25 May 2011 09:55:43 +0000 (11:55 +0200)

sh-18n: quell "unused variable" warning

show_variables is set but never used. Comment it out rather than remove it so
that the relation with upstream remains clear.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

init/clone: remove short option -L and document --separ... Nguyen Thai Ngoc Duy Tue, 24 May 2011 16:40:32 +0000 (23:40 +0700)

init/clone: remove short option -L and document --separate-git-dir

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

handle_options(): do not miscount how many arguments... Junio C Hamano Tue, 24 May 2011 22:50:35 +0000 (18:50 -0400)

handle_options(): do not miscount how many arguments were used

The handle_options() function advances the base of the argument array and
returns the number of arguments it used. The caller in handle_alias()
wants to reallocate the argv array it passes to this function, and
attempts to do so by subtracting the returned value to compensate for the
change handle_options() makes to the new_argv.

But handle_options() did not correctly count when "-c <config=value>" is
given, causing a wrong pointer to be passed to realloc().

Fix it by saving the original argv at the beginning of handle_options(),
and return the difference between the final value of argv, which will
relieve the places that move the array pointer from the additional burden
of keeping track of "handled" counter.

Noticed-by: Kazuki Tsujimoto
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: always parse GIT_CONFIG_PARAMETERS during git_c... Jeff King Tue, 24 May 2011 22:49:55 +0000 (18:49 -0400)

config: always parse GIT_CONFIG_PARAMETERS during git_config

Previously we parsed GIT_CONFIG_PARAMETERS lazily into a
linked list, and then checked that list during future
invocations of git_config. However, that ignores the fact
that the environment variable could change during our run
(e.g., because we parse more "-c" as part of an alias).

Instead, let's just re-parse the environment variable each
time. It's generally not very big, and it's no more work
than parsing the config files, anyway.

As a bonus, we can ditch all of the linked list storage code
entirely, making the code much simpler.

The test unfortunately still does not pass because of an
unrelated bug in handle_options.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git_config: don't peek at global config_parametersJeff King Tue, 24 May 2011 22:49:45 +0000 (18:49 -0400)

git_config: don't peek at global config_parameters

The config_parameters list in config.c is an implementation
detail of git_config_from_parameters; instead, that function
should tell us whether it found anything.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: make environment parsing routines staticJeff King Tue, 24 May 2011 22:49:36 +0000 (18:49 -0400)

config: make environment parsing routines static

Nobody outside of git_config_from_parameters should need
to use the GIT_CONFIG_PARAMETERS parsing functions, so let's
make them private.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: discuss textconv versus external diff driversJeff King Tue, 24 May 2011 19:45:27 +0000 (15:45 -0400)

doc: discuss textconv versus external diff drivers

We already talk about how to use each one and how they work,
but it is a reasonable question to wonder why one might use
one over the other.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

require-work-tree wants more than what its name saysJunio C Hamano Thu, 5 May 2011 02:11:18 +0000 (19:11 -0700)

require-work-tree wants more than what its name says

Somebody tried "git pull" from a random place completely outside the work
tree, while exporting GIT_DIR and GIT_WORK_TREE that are set to correct
places, e.g.

GIT_WORK_TREE=$HOME/git.git
GIT_DIR=$GIT_WORK_TREE/.git
export GIT_WORK_TREE GIT_DIR
cd /tmp
git pull

At the beginning of git-pull, we check "require-work-tree" and then
"cd-to-toplevel". I _think_ the original intention when I wrote the
command was "we MUST have a work tree, our $(cwd) might not be at the
top-level directory of it", and no stronger than that. That check is a
very sensible thing to do before doing cd-to-toplevel. We check that the
place we would want to go exists, and then go there.

But the implementation of require_work_tree we have today is quite
different. I don't have energy to dig the history, but currently it says:

test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true ||
die "fatal: $0 cannot be used without a working tree."

Which is completely bogus. Even though we may happen to be just outside
of it right now, we may have a working tree that we can cd_to_toplevel
back to.

Add a function "require_work_tree_exists" that implements the check
this function originally intended (this is so that third-party scripts
that rely on the current behaviour do not have to get broken).

For now, update _no_ in-tree scripts, not even "git pull", as nobody on
the list seems to really care about the above corner case workflow that
triggered this. Scripts can be updated after vetting that they do want the
"we want to make sure the place we are going to go actually exists"
semantics.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Make JavaScript ability to adjust timezones... Jakub Narebski Thu, 28 Apr 2011 19:04:11 +0000 (21:04 +0200)

gitweb: Make JavaScript ability to adjust timezones configurable

Configure JavaScript-based ability to select common timezone for git
dates via %feature mechanism, namely 'javascript-timezone' feature.

The following settings are configurable:
* default timezone (defaults to 'local' i.e. browser timezone);
this also can function as a way to disable this ability,
by setting it to false-ish value (undef or '')
* name of cookie to store user's choice of timezone
* class name to mark dates

NOTE: This is a bit of abuse of %feature system, which can store only
sequence of values, rather than dictionary (hash); usually but not
always only a single value is used.

Based-on-code-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
Helped-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb.js: Add UI for selecting common timezone to... John 'Warthog9' Hawley Thu, 28 Apr 2011 19:04:10 +0000 (21:04 +0200)

gitweb.js: Add UI for selecting common timezone to display dates

This will modify HTML, add CSS rules and add DOM event handlers so
that clicking on any date (the common part, not the localtime part)
will display a drop down menu to choose the timezone to change to.

Currently menu displays only the following timezones:

utc
local
-1200
-1100
...
+1100
+1200
+1300
+1400

In timezone selection menu each timezone is +1hr to the previous. The
code is capable of handling fractional timezones, but those have not
been added to the menu.

All changes are saved to a cookie, so page changes and closing /
reopening browser retains the last known timezone setting used.

[jn: Changed from innerHTML to DOM, moved to event delegation for
onclick to trigger menu, added close button and cookie refreshing]

Helped-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: JavaScript ability to adjust time based on... John 'Warthog9' Hawley Thu, 28 Apr 2011 19:04:09 +0000 (21:04 +0200)

gitweb: JavaScript ability to adjust time based on timezone

This patch is based on Kevin Cernekee's <cernekee@gmail.com>
patch series entitled "gitweb: introduce localtime feature". While
Kevin's patch changed the server side output so that the timezone
was output from gitweb itself, this has a number of drawbacks, in
particular with respect to gitweb-caching.

This patch takes the same basic goal, display the appropriate times in
a given common timezone, and implements it in JavaScript. This
requires adding / using a new class, "datetime", to be able to find
elements to be adjusted from JavaScript. Appropriate dates are
wrapped in a span with this class.

Timezone to be used can be retrieved from "gitweb_tz" cookie, though
currently there is no way to set / manipulate this cookie from gitweb;
this is left for later commit.

Valid timezones, currently, are: "utc", "local" (which means that
timezone is taken from browser), and "+/-ZZZZ" numeric timezone as in
RFC-2822. Default timezone is "local" (currently not configurable,
left for later commit).

Fallback (should JavaScript not be enabled) is to treat dates as they
have been and display them, only, in UTC.

Pages affected:
* 'summary' view, "last change" field (commit time from latest change)
* 'log' view, author time
* 'commit' and 'commitdiff' views, author/committer time
* 'tag' view, tagger time

Based-on-code-from: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Unify the way long timestamp is displayedJakub Narebski Thu, 28 Apr 2011 19:04:08 +0000 (21:04 +0200)

gitweb: Unify the way long timestamp is displayed

format_timestamp_html loses its "-localtime => 1" option, and now
always print the local time (in author/comitter/tagger local
timezone), with "atnight" warning if needed.

This means that both 'summary' and 'log' views now display localtime.
In the case of 'log' view this can be thought as an improvement, as
now one can easily see which commits in a series are made "atnight"
and should be examined closer.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Refactor generating of long dates into format_t... Jakub Narebski Thu, 28 Apr 2011 19:04:07 +0000 (21:04 +0200)

gitweb: Refactor generating of long dates into format_timestamp_html

It is pure refactoring and doesn't change gitweb output, though this
could potentially affect 'summary', 'log', and 'commit'-like views
('commit', 'commitdiff', 'tag').

Remove print_local_time and format_local_time, as their use is now
replaced (indirectly) by using format_timestamp_html.

While at it improve whitespace formatting.

Inspired-by-code-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb.js: Provide getElementsByClassName method (if... Jakub Narebski Thu, 28 Apr 2011 19:04:06 +0000 (21:04 +0200)

gitweb.js: Provide getElementsByClassName method (if it not exists)

The code is simplified and does not support full specification of
native getElementsByClassName method, but implements just subset that
would be enough for gitweb, supporting only single class name.

Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb.js: Introduce code to handle cookies from JavaScriptJakub Narebski Thu, 28 Apr 2011 19:04:05 +0000 (21:04 +0200)

gitweb.js: Introduce code to handle cookies from JavaScript

Introduced gitweb/static/js/cookies.js file provides functions for
setting, getting and deleting cookies.

Code taken from subsection "Cookies in JavaScript" of "Professional
JavaScript for Web Developers" by Nicholas C. Zakas and from cookie
plugin for jQuery (dual licensed under the MIT and GPL licenses).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb.js: Extract and improve datetime handlingJakub Narebski Thu, 28 Apr 2011 19:04:04 +0000 (21:04 +0200)

gitweb.js: Extract and improve datetime handling

Move formatDateISOLocal(epoch, timezone) function (and also helper
timezoneOffset(timezoneInfo) function it requires) from common-lib.js to
datetime.js

Add new functions:
* localTimezoneOffset - to get browser timezone offset in seconds
* localTimezoneInfo - to get browser timezone in '(+|-)HHMM' format
* formatTimezoneInfo - turn offset in hours and minutes into '(+|-)HHMM'
* parseRFC2822Date - to parse RFC-2822 dates that gitweb uses into epoch
* formatDateRFC2882 - like formatDateISOLocal, only RFC-2822 format

All those functions are meant to be used in future commit
'gitweb: javascript ability to adjust time based on timezone'

An alternative would be to use e.g. Datejs (http://www.datejs.com)
library, or JavaScript framework that has date formatting (perhaps as
a plugin).

While at it escape '-' in character class inside tzRe regexp, as
recommended by JSLint (http://www.jslint.com).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb.js: Provide default values for padding in padLef... Jakub Narebski Thu, 28 Apr 2011 19:04:03 +0000 (21:04 +0200)

gitweb.js: Provide default values for padding in padLeftStr and padLeft

This means that one can use padLeft(4, 2) and it would be equivalent
to runing padLeft(4, 2, '0'), and it would return '04' i.e. '4' padded
with '0' to width 2, to be used e.g. in formatting date and time.

This should make those functions easier to use. Current code doesn't
yet make use of this feature.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb.js: Update and improve comments in JavaScript... Jakub Narebski Thu, 28 Apr 2011 19:04:02 +0000 (21:04 +0200)

gitweb.js: Update and improve comments in JavaScript files

This consists of adding a few extra explanation, fixing descriptions
of functions to match names of parameters in code, adding a few
separators, and fixing spelling -- while at it spell 'neighbor' using
American spelling (and not as 'neighbour').

This is post-split cleanup.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Split JavaScript for maintability, combining... Jakub Narebski Thu, 28 Apr 2011 19:04:01 +0000 (21:04 +0200)

gitweb: Split JavaScript for maintability, combining on build

Split originally single gitweb.js file into smaller files, each
dealing with single issue / area of responsibility. This move should
make gitweb's JavaScript code easier to maintain.

For better webapp performance it is recommended[1][2][3] to combine
JavaScript files. Do it during build time (in gitweb/Makefile), by
straight concatenation of files into gitweb.js file (which is now
ignored as being generated). This means that there are no changes to
gitweb script itself - it still uses gitweb.js or gitweb.min.js, but
now generated.

[1]: http://developer.yahoo.com/performance/rules.html
"Minimize HTTP Requests" section
[2]: http://code.google.com/speed/articles/include-scripts-properly.html
"1. Combine external JavaScript files"
[3]: http://javascript-reference.info/speed-up-your-javascript-load-time.htm
"Combine Your Files" section.

See also new gitweb/static/js/README file.

Inspired-by-patch-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-grep: Update tests (mainly for -P)Michał Kiedrowicz Sun, 22 May 2011 11:37:28 +0000 (13:37 +0200)

git-grep: Update tests (mainly for -P)

Add few more tests for "-P/--perl-regexp" option of "git grep".

While at it, add some generic tests for grep.extendedRegexp config option,
for detecting invalid regexep and check if "last one wins" rule works for
selecting regexp type.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

userdiff/perl: tighten BEGIN/END block pattern to rejec... Jonathan Nieder Sun, 22 May 2011 17:29:32 +0000 (12:29 -0500)

userdiff/perl: tighten BEGIN/END block pattern to reject here-doc delimiters

A naive method of treating BEGIN/END blocks with a brace on the second
line as diff/grep funcname context involves also matching unrelated
lines that consist of all-caps letters:

sub foo {
print <<'EOF'
text goes here
...
EOF
... rest of foo ...
}

That's not so great, because it means that "git diff" and "git grep
--show-function" would write "=EOF" or "@@ EOF" as context instead of
a more useful reminder like "@@ sub foo {".

To avoid this, tighten the pattern to only match the special block
names that perl accepts (namely BEGIN, END, INIT, CHECK, UNITCHECK,
AUTOLOAD, and DESTROY). The list is taken from perl's toke.c.

Suggested-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update 1.7.6 draft release notesJunio C Hamano Mon, 23 May 2011 17:54:54 +0000 (10:54 -0700)

Update 1.7.6 draft release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'tr/add-i-no-escape'Junio C Hamano Mon, 23 May 2011 17:50:06 +0000 (10:50 -0700)

Merge branch 'tr/add-i-no-escape'

* tr/add-i-no-escape:
add -i: ignore terminal escape sequences

Merge branch 'jm/maint-diff-words-with-sbe'Junio C Hamano Mon, 23 May 2011 17:27:42 +0000 (10:27 -0700)

Merge branch 'jm/maint-diff-words-with-sbe'

* jm/maint-diff-words-with-sbe:
do not read beyond end of malloc'd buffer

Merge branch 'js/mingw-shutdown'Junio C Hamano Mon, 23 May 2011 17:27:12 +0000 (10:27 -0700)

Merge branch 'js/mingw-shutdown'

* js/mingw-shutdown:
Windows: add a wrapper for the shutdown() system call

Merge branch 'ms/ls-remote-exit-with-status'Junio C Hamano Mon, 23 May 2011 17:27:08 +0000 (10:27 -0700)

Merge branch 'ms/ls-remote-exit-with-status'

* ms/ls-remote-exit-with-status:
ls-remote: the --exit-code option reports "no matching refs"

Merge branch 'mg/config-symbolic-constants'Junio C Hamano Mon, 23 May 2011 16:59:05 +0000 (09:59 -0700)

Merge branch 'mg/config-symbolic-constants'

* mg/config-symbolic-constants:
config: Give error message when not changing a multivar
config: define and document exit codes

Merge branch 'ab/i18n-scripts-basic'Junio C Hamano Mon, 23 May 2011 16:58:45 +0000 (09:58 -0700)

Merge branch 'ab/i18n-scripts-basic'

* ab/i18n-scripts-basic:
Makefile: add xgettext target for *.sh files
git-sh-i18n.sh: add GIT_GETTEXT_POISON support
git-sh-i18n.sh: add no-op gettext() and eval_gettext() wrappers
git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext()

Merge branch 'jc/magic-pathspec'Junio C Hamano Mon, 23 May 2011 16:58:35 +0000 (09:58 -0700)

Merge branch 'jc/magic-pathspec'

* jc/magic-pathspec:
setup.c: Fix some "symbol not declared" sparse warnings
t3703: Skip tests using directory name ":" on Windows
revision.c: leave a note for "a lone :" enhancement
t3703, t4208: add test cases for magic pathspec
rev/path disambiguation: further restrict "misspelled index entry" diag
fix overslow :/no-such-string-ever-existed diagnostics
fix overstrict :<path> diagnosis
grep: use get_pathspec() correctly
pathspec: drop "lone : means no pathspec" from get_pathspec()
Revert "magic pathspec: add ":(icase)path" to match case insensitively"
magic pathspec: add ":(icase)path" to match case insensitively
magic pathspec: futureproof shorthand form
magic pathspec: add tentative ":/path/from/top/level" pathspec support

Merge branch 'jk/blame-line-porcelain'Junio C Hamano Mon, 23 May 2011 16:58:31 +0000 (09:58 -0700)

Merge branch 'jk/blame-line-porcelain'

* jk/blame-line-porcelain:
blame: add --line-porcelain output format
blame: refactor porcelain output
add tests for various blame formats

tests: make test_expect_code quieter on successJonathan Nieder Sat, 21 May 2011 19:40:32 +0000 (14:40 -0500)

tests: make test_expect_code quieter on success

A command exiting with the expected status is not particularly
notable.

While the indication of progress might be useful when tracking down
where in a test a failure has happened, the same applies to most other
test helpers, which are quiet about success, so this single helper's
output stands out in an unpleasant way. An alternative method for
showing progress information might to invent a --progress option that
runs tests with "set -x", or until that is available, to run tests
using commands like

prove -v -j2 --shuffle --exec='sh -x' t2202-add-addremove.sh

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

userdiff/perl: catch sub with brace on second lineJonathan Nieder Sat, 21 May 2011 19:38:26 +0000 (14:38 -0500)

userdiff/perl: catch sub with brace on second line

Accept

sub foo
{
}

as an alternative to a more common style that introduces perl
functions with a brace on the first line (and likewise for BEGIN/END
blocks). The new regex is a little hairy to avoid matching

# forward declaration
sub foo;

while continuing to match "sub foo($;@) {" and

sub foo { # This routine is interesting;
# in fact, the lines below explain how...

While at it, pay attention to Perl 5.14's "package foo {" syntax as an
alternative to the traditional "package foo;".

Requested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

userdiff/perl: match full line of POD headersJonathan Nieder Sat, 21 May 2011 19:35:51 +0000 (14:35 -0500)

userdiff/perl: match full line of POD headers

The builtin perl userdiff driver is not greedy enough about catching
POD header lines. Capture the whole line, so instead of just
declaring that we are in some "@@ =head1" section, diff/grep output
can explain that the enclosing section is about "@@ =head1 OPTIONS".

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

userdiff/perl: anchor "sub" and "package" patterns... Jonathan Nieder Sat, 21 May 2011 19:29:01 +0000 (14:29 -0500)

userdiff/perl: anchor "sub" and "package" patterns on the left

The userdiff funcname mechanism has no concept of nested scopes ---
instead, "git diff" and "git grep --show-function" simply label the
diff header with the most recent matching line. Unfortunately that
means text following a subroutine in a POD section:

=head1 DESCRIPTION

You might use this facility like so:

sub example {
foo;
}

Now, having said that, let's say more about the facility.
Blah blah blah ... etc etc.

gets the subroutine name instead of the POD header in its diff/grep
funcname header, making it harder to get oriented when reading a
diff without enough context.

The fix is simple: anchor the funcname syntax to the left margin so
nested subroutines and packages like this won't get picked up. (The
builtin C++ funcname pattern already does the same thing.) This means
the userdiff driver will misparse the idiom

{
my $static;
sub foo {
... use $static ...
}
}

but I think that's worth it; we can revisit this later if the userdiff
mechanism learns to keep track of the beginning and end of nested
scopes.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4018 (funcname patterns): minor cleanupsJonathan Nieder Sat, 21 May 2011 19:25:14 +0000 (14:25 -0500)

t4018 (funcname patterns): minor cleanups

Introduce a test_expect_funcname function to make a diff and apply a
regexp anchored on the left to the function name it writes, avoiding
some repetition.

Omit the space after >, <<, and < operators for consistency with
other scripts. Quote the <<here document delimiter and $ signs in
quotes so readers don't have to worry about the effect of shell
metacharacters.

Remove some unnecessary blank lines.

Run "git diff" as a separate command instead of as upstream of a pipe
that checks its output, so the exit status can be tested. In
particular, this way if "git diff" starts segfaulting the test harness
will notice.

Allow "error:" as a synonym for "fatal:" when checking error messages,
since whether a command uses die() or "return error()" is a small
implementation detail.

Anchor some more regexes on the right.

None of the above is very important on its own; the point is just to
make the script a little easier to read and the code less scary to
modify.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4018 (funcname patterns): make configuration easier... Jonathan Nieder Sat, 21 May 2011 19:22:28 +0000 (14:22 -0500)

t4018 (funcname patterns): make configuration easier to track

Introduce a "test_config" function to set a configuration variable
for use by a single test (automatically unsetting it when the
assertion finishes). If this function is used consistently, the
configuration used in a test_expect_success block can be read at the
beginning of that block instead of requiring reading all the tests
that come before. So it becomes a little easier to add new tests or
rearrange existing ones without fear of breaking configuration.

In particular, the test of alternation in xfuncname patterns also
checks that xfuncname takes precedence over funcname variable as a
sort of side-effect, since the latter leaks in from previous tests.
In the new syntax, the test has to say explicitly what variables it is
using, making the test clearer and a future regression in coverage
from carelessly editing the script less likely.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4018 (funcname patterns): make .gitattributes state... Jonathan Nieder Sat, 21 May 2011 19:11:33 +0000 (14:11 -0500)

t4018 (funcname patterns): make .gitattributes state easier to track

Most, but not all, tests in this script rely on attributes declaring
that files with a .java extension should use the "java" driver:

*.java diff=java

Split out a "set up" test to put such a .gitattributes in place after
the tests that do not want it have run, to make it more likely that
individual tests other than this setup test can be safely modified,
rearranged, or skipped. Presumably this setup code will learn to
request other drivers for other extensions in the same place when the
test suite learns to exercise other diff drivers.

Similarly, make sure that early test assertions that do not use these
default attributes set up .gitattributes appropriately for themselves,
so tests that run before can be modified with less risk of breaking
something.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sat, 21 May 2011 01:50:29 +0000 (18:50 -0700)

Merge branch 'maint'

* maint:
git-svn: Fix git svn log --show-commit

do not read beyond end of malloc'd bufferJim Meyering Fri, 20 May 2011 17:20:12 +0000 (19:20 +0200)

do not read beyond end of malloc'd buffer

With diff.suppress-blank-empty=true, "git diff --word-diff" would
output data that had been read from uninitialized heap memory.
The problem was that fn_out_consume did not account for the
possibility of a line with length 1, i.e., the empty context line
that diff.suppress-blank-empty=true converts from " \n" to "\n".
Since it assumed there would always be a prefix character (the space),
it decremented "len" unconditionally, thus passing len=0 to emit_line,
which would then blindly call emit_line_0 with len=-1 which would
pass that value on to fwrite as SIZE_MAX. Boom.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: Fix git svn log --show-commitMichael J Gruber Fri, 20 May 2011 11:16:34 +0000 (13:16 +0200)

git-svn: Fix git svn log --show-commit

git svn log --show-commit had no tests and, consequently, no attention
by the author of

b1b4755 (git-log: put space after commit mark, 2011-03-10)

who kept git svn log working only without --show-commit.

Introduce a test and fix it.

Reported-by: Bernt Hansen <bernt@norang.ca>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.6Junio C Hamano Fri, 20 May 2011 03:50:07 +0000 (20:50 -0700)

Update draft release notes to 1.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'Junio C Hamano Fri, 20 May 2011 04:02:14 +0000 (21:02 -0700)

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'

* jc/maint-1.7.4-pathspec-stdin-and-cmdline:

Merge branch 'rg/copy-gecos-username'Junio C Hamano Fri, 20 May 2011 03:37:21 +0000 (20:37 -0700)

Merge branch 'rg/copy-gecos-username'

* rg/copy-gecos-username:
copy_gecos: fix not adding nlen to len when processing "&"

Merge branch 'jl/submodule-conflicted-gitmodules'Junio C Hamano Fri, 20 May 2011 03:37:21 +0000 (20:37 -0700)

Merge branch 'jl/submodule-conflicted-gitmodules'

* jl/submodule-conflicted-gitmodules:
Submodules: Don't parse .gitmodules when it contains, merge conflicts
test that git status works with merge conflict in, .gitmodules

Merge branch 'jc/replacing'Junio C Hamano Fri, 20 May 2011 03:37:21 +0000 (20:37 -0700)

Merge branch 'jc/replacing'

* jc/replacing:
read_sha1_file(): allow selective bypassing of replacement mechanism
inline lookup_replace_object() calls
read_sha1_file(): get rid of read_sha1_file_repl() madness
t6050: make sure we test not just commit replacement
Declare lookup_replace_object() in cache.h, not in commit.h

Conflicts:
environment.c

Merge branch 'nd/sparse-co-fix'Junio C Hamano Fri, 20 May 2011 03:37:21 +0000 (20:37 -0700)

Merge branch 'nd/sparse-co-fix'

* nd/sparse-co-fix:
sparse checkout: do not eagerly decide the fate for whole directory
t1011: fix sparse-checkout initialization and add new file

Merge branch 'ld/p4-preserve-user-names'Junio C Hamano Fri, 20 May 2011 03:37:20 +0000 (20:37 -0700)

Merge branch 'ld/p4-preserve-user-names'

* ld/p4-preserve-user-names:
git-p4: warn if git authorship won't be retained
git-p4: small improvements to user-preservation
git-p4: add option to preserve user names

Merge branch 'ms/tagname-does-not-begin-with-dash'Junio C Hamano Fri, 20 May 2011 03:37:20 +0000 (20:37 -0700)

Merge branch 'ms/tagname-does-not-begin-with-dash'

* ms/tagname-does-not-begin-with-dash:
tag: disallow '-' as tag name

Merge branch 'jk/git-connection-deadlock-fix'Junio C Hamano Fri, 20 May 2011 03:37:20 +0000 (20:37 -0700)

Merge branch 'jk/git-connection-deadlock-fix'

* jk/git-connection-deadlock-fix:
test core.gitproxy configuration
send-pack: avoid deadlock on git:// push with failed pack-objects
connect: let callers know if connection is a socket
connect: treat generic proxy processes like ssh processes

Conflicts:
connect.c

Merge branch 'js/maint-send-pack-stateless-rpc-deadlock... Junio C Hamano Fri, 20 May 2011 03:37:19 +0000 (20:37 -0700)

Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'

* js/maint-send-pack-stateless-rpc-deadlock-fix:
sideband_demux(): fix decl-after-stmt

Merge branch 'jk/cherry-pick-root-with-resolve'Junio C Hamano Fri, 20 May 2011 03:37:19 +0000 (20:37 -0700)

Merge branch 'jk/cherry-pick-root-with-resolve'

* jk/cherry-pick-root-with-resolve:
t3503: test cherry picking and reverting root commits
revert: allow reverting a root commit
cherry-pick: handle root commits with external strategies

Merge branch 'jc/maint-pathspec-stdin-and-cmdline'Junio C Hamano Fri, 20 May 2011 03:37:18 +0000 (20:37 -0700)

Merge branch 'jc/maint-pathspec-stdin-and-cmdline'

* jc/maint-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

Conflicts:
revision.c

Merge 1.7.5.2 inJunio C Hamano Fri, 20 May 2011 03:37:08 +0000 (20:37 -0700)

Merge 1.7.5.2 in

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "Merge branch 'en/merge-recursive'"Junio C Hamano Fri, 20 May 2011 03:17:44 +0000 (20:17 -0700)

Revert "Merge branch 'en/merge-recursive'"

As the band-aid to merge-recursive seems to regress complex merges in an
unpleasant way. The merge-recursive implementation needs to be rewritten
in such a way that it resolves renames and D/F conflicts entirely in-core
and not to touch working tree at all while doing so. But in the meantime,
this reverts commit ac9666f84 that merged the topic in its entirety.

Git 1.7.5.2 v1.7.5.2Junio C Hamano Fri, 20 May 2011 03:30:44 +0000 (20:30 -0700)

Git 1.7.5.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>

receive-pack: eliminate duplicate .have refsJeff King Thu, 19 May 2011 21:34:46 +0000 (17:34 -0400)

receive-pack: eliminate duplicate .have refs

When receiving a push, we advertise ref tips from any
alternate repositories, in case that helps the client send a
smaller pack. Since these refs don't actually exist in the
destination repository, we don't transmit the real ref
names, but instead use the pseudo-ref ".have".

If your alternate has a large number of duplicate refs (for
example, because it is aggregating objects from many related
repositories, some of which will have the same tags and
branch tips), then we will send each ".have $sha1" line
multiple times. This is a pointless waste of bandwidth, as
we are simply repeating the same fact to the client over and
over.

This patch eliminates duplicate .have refs early on. It does
so efficiently by sorting the complete list and skipping
duplicates. This has the side effect of re-ordering the
.have lines by ascending sha1; this isn't a problem, though,
as the original order was meaningless.

There is a similar .have system in fetch-pack, but it
does not suffer from the same problem. For each alternate
ref we consider in fetch-pack, we actually open the object
and mark it with the SEEN flag, so duplicates are
automatically culled.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: refactor sha1_array into a generic sha1 listJeff King Thu, 19 May 2011 21:34:33 +0000 (17:34 -0400)

bisect: refactor sha1_array into a generic sha1 list

This is a generally useful abstraction, so let's let others
make use of it. The refactoring is more or less a straight
copy; however, functions and struct members have had their
names changed to match string_list, which is the most
similar data structure.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refactor refs_from_alternate_cb to allow passing extra... Jeff King Thu, 19 May 2011 21:33:17 +0000 (17:33 -0400)

refactor refs_from_alternate_cb to allow passing extra data

The foreach_alt_odb function triggers a callback for each
alternate object db we have, with room for a single void
pointer as data. Currently, we always call refs_from_alternate_cb
as the callback function, and then pass another callback (to
receive each ref individually) as the void pointer.

This has two problems:

1. C technically forbids stuffing a function pointer into
a "void *". In practice, this probably doesn't matter
on any architectures git runs on, but it never hurts to
follow the letter of the law.

2. There is no room for an extra data pointer. Indeed, the
alternate_ref_fn that refs_from_alternate_cb calls
takes a void* for data, but we always pass it NULL.

Instead, let's properly stuff our function pointer into a
data struct, which also leaves room for an extra
caller-supplied data pointer. And to keep things simple for
existing callers, let's make a for_each_alternate_ref
function that takes care of creating the extra struct.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: sort TEST_PROGRAMS listJeff King Thu, 19 May 2011 21:24:24 +0000 (17:24 -0400)

Makefile: sort TEST_PROGRAMS list

We usually keep these lists in sorted order, but the last
few entries were just tacked on the end.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch: avoid repeated commits in mark_completeJeff King Thu, 19 May 2011 20:48:51 +0000 (16:48 -0400)

fetch: avoid repeated commits in mark_complete

We add every local ref to a list so that we can mark them
and all of their ancestors back to a certain cutoff point.
However, if some refs point to the same commit, we will end
up adding them to the list many times.

Furthermore, since commit_lists are stored as linked lists,
we must do an O(n) traversal of the list in order to find
the right place to insert each commit. This makes building
the list O(n^2) in the number of refs.

For normal repositories, this isn't a big deal. We have a
few hundreds refs at most, and most of them are unique. But
consider an "alternates" repo that serves as an object
database for many other similar repos. For reachability, it
needs to keep a copy of the refs in each child repo. This
means it may have a large number of refs, many of which
point to the same commits.

By noting commits we have already added to the list, we can
shrink the size of "n" in such a repo to the number of
unique commits, which is on the order of what a normal repo
would contain (it's actually more than a normal repo, since child repos
may have branches at different states, but in practice it tends
to be much smaller than the list with duplicates).

Here are the results on one particular giant repo
(containing objects for all Rails forks on GitHub):

$ git for-each-ref | wc -l
112514

[before]
$ git fetch --no-tags ../remote.git
63.52user 0.12system 1:03.68elapsed 99%CPU (0avgtext+0avgdata 137648maxresident)k
1856inputs+48outputs (11major+19603minor)pagefaults 0swaps

$ git fetch --no-tags ../remote.git
6.15user 0.08system 0:06.25elapsed 99%CPU (0avgtext+0avgdata 123856maxresident)k
0inputs+40outputs (0major+18872minor)pagefaults 0swaps

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ident: add NO_GECOS_IN_PWENT for systems without pw_gec... Rafael Gieschke Thu, 19 May 2011 11:37:55 +0000 (13:37 +0200)

ident: add NO_GECOS_IN_PWENT for systems without pw_gecos in struct passwd

Allow NO_GECOS_IN_PWENT to be defined in the Makefile for platforms that
lack the pw_gecos field in their "struct passwd", in which case the
uppercased user name is used instead via the standard '&' replacement
mechanism.

Signed-off-by: Rafael Gieschke <rafael@gieschke.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

provide a copy of the LGPLv2.1Jonathan Nieder Thu, 19 May 2011 15:14:25 +0000 (10:14 -0500)

provide a copy of the LGPLv2.1

The LGPL seems to require providing a copy of the license when
distributing xdiff, compat/fnmatch, and so on, or altering the license
notices to refer to the GPL intead. Since we don't want to do the
latter, let's do the former. It's nice to let people know their
rights anyway.

Inspired-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

show: --ignore-missingJunio C Hamano Thu, 19 May 2011 01:08:09 +0000 (18:08 -0700)

show: --ignore-missing

Instead of barfing, simply ignore bad object names seen in the
input. This is useful when reading from "git notes list" output
that may refer to objects that have already been garbage collected.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes remove: --stdin reads from the standard inputJunio C Hamano Wed, 18 May 2011 23:44:30 +0000 (16:44 -0700)

notes remove: --stdin reads from the standard input

Teach the command to read object names to remove from the standard
input, in addition to the object names given from the command line.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes remove: --ignore-missingJunio C Hamano Wed, 18 May 2011 23:02:58 +0000 (16:02 -0700)

notes remove: --ignore-missing

Depending on the application, it is not necessarily an error for an object
to lack a note, especially if the only thing the caller wants to make sure
is that notes are cleared for an object. By passing this option from the
command line, the "git notes remove" command considers it a success if the
object did not have any note to begin with.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes remove: allow removing more than oneJunio C Hamano Wed, 18 May 2011 22:44:37 +0000 (15:44 -0700)

notes remove: allow removing more than one

While "xargs -n1 git notes rm" is certainly a possible way to remove notes
from many objects, this would create one notes "commit" per removal, which
is not quite suitable for seasonal housekeeping.

Allow taking more than one on the command line, and record their removal
as a single atomic event if everthing goes well.

Even though the old code insisted that "git notes rm" must be given only
one object (or zero, in which case it would default to HEAD), this
condition was not tested. Add tests to handle the new case where we feed
multiple objects, and also make sure if there is a bad input, no change
is recorded.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

ls-remote: the --exit-code option reports "no matching... Michael Schubert Wed, 18 May 2011 20:06:00 +0000 (22:06 +0200)

ls-remote: the --exit-code option reports "no matching refs"

The "git ls-remote" uses its exit status to indicate if it successfully
talked with the remote repository. A new option "--exit-code" makes the
command exit with status "2" when there is no refs to be listed, even when
the command successfully talked with the remote repository.

This way, the caller can tell if we failed to contact the remote, or the
remote did not have what we wanted to see. Of course, you can inspect the
output from the command, which has been and will continue to be a valid
way to check the same thing.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Windows: add a wrapper for the shutdown() system callJohannes Sixt Wed, 18 May 2011 20:24:37 +0000 (22:24 +0200)

Windows: add a wrapper for the shutdown() system call

Even though Windows's socket functions look like their POSIX counter parts,
they do not operate on file descriptors, but on "socket objects". To bring
the functions in line with POSIX, we have proxy functions that wrap and
unwrap the socket objects in file descriptors using open_osfhandle and
get_osfhandle. But shutdown() was not proxied, yet. Fix this.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test core.gitproxy configurationJeff King Wed, 18 May 2011 08:57:44 +0000 (04:57 -0400)

test core.gitproxy configuration

This is just a basic sanity test to see whether
core.gitproxy works at all. Until now, we were not testing
anywhere.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add log.abbrevCommit config variableJay Soffian Wed, 18 May 2011 17:56:04 +0000 (13:56 -0400)

Add log.abbrevCommit config variable

Add log.abbrevCommit config variable as a convenience for users who
often use --abbrev-commit with git log and friends. Allow the option
to be overridden with --no-abbrev-commit. Per 635530a2fc and 4f62c2bc57,
the config variable is ignored when log is given "--pretty=raw".

(Also, a drive-by spelling correction in git log's short help.)

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

"git log -h": typofix misspelled 'suppress'Jay Soffian Wed, 18 May 2011 17:56:04 +0000 (13:56 -0400)

"git log -h": typofix misspelled 'suppress'

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

copy_gecos: fix not adding nlen to len when processing "&"Rafael Gieschke Mon, 16 May 2011 20:08:21 +0000 (22:08 +0200)

copy_gecos: fix not adding nlen to len when processing "&"

nlen has to be added to len when inserting (capitalized) pw_name as
substitution for "&" in pw_gecos. Otherwise, pw_gecos will be truncated
and data might be written beyond name+sz.

Signed-off-by: Rafael Gieschke <rafael@gieschke.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

setup.c: Fix some "symbol not declared" sparse warningsRamsay Jones Tue, 17 May 2011 17:43:10 +0000 (18:43 +0100)

setup.c: Fix some "symbol not declared" sparse warnings

In particular, sparse issues the "symbol 'a_symbol' was not declared.
Should it be static?" warnings for the following symbols:

setup.c:159:3: 'pathspec_magic'
setup.c:176:12: 'prefix_pathspec'

These symbols only require file scope, so we add the static modifier
to their declarations.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: Give error message when not changing a multivarMichael J Gruber Tue, 17 May 2011 15:38:53 +0000 (17:38 +0200)

config: Give error message when not changing a multivar

When trying to set a multivar with "git config var value", "git config"
issues

warning: remote.repoor.push has multiple values

leaving the user under the impression that the operation succeeded,
unless one checks the return value.

Instead, make it

warning: remote.repoor.push has multiple values
error: cannot overwrite multiple values with a single value
Use a regexp, --add or --set-all to change remote.repoor.push.

to be clear and helpful.

Note: The "warning" is raised through other code paths also so that it
needs to remain a warning for these (which do not raise the error). Only
the caller can determine how to go on from that.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: define and document exit codesMichael J Gruber Tue, 17 May 2011 15:38:52 +0000 (17:38 +0200)

config: define and document exit codes

The return codes of git_config_set() and friends are magic numbers right
in the source. #define them in cache.h where the functions are declared,
and use the constants in the source.

Also, mention the resulting exit codes of "git config" in its man page
(and complete the list).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add -i: ignore terminal escape sequencesThomas Rast Tue, 17 May 2011 15:19:08 +0000 (17:19 +0200)

add -i: ignore terminal escape sequences

On the author's terminal, the up-arrow input sequence is ^[[A, and
thus fat-fingering an up-arrow into 'git checkout -p' is quite
dangerous: git-add--interactive.perl will ignore the ^[ and [
characters and happily treat A as "discard everything".

As a band-aid fix, use Term::Cap to get all terminal capabilities.
Then use the heuristic that any capability value that starts with ^[
(i.e., \e in perl) must be a key input sequence. Finally, given an
input that starts with ^[, read more characters until we have read a
full escape sequence, then return that to the caller. We use a
timeout of 0.5 seconds on the subsequent reads to avoid getting stuck
if the user actually input a lone ^[.

Since none of the currently recognized keys start with ^[, the net
result is that the sequence as a whole will be ignored and the help
displayed.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update release notes to 1.7.6Junio C Hamano Mon, 16 May 2011 23:58:35 +0000 (16:58 -0700)

Update release notes to 1.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc... Junio C Hamano Tue, 17 May 2011 00:01:03 +0000 (17:01 -0700)

Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/maint-send-pack-stateless-rpc-deadlock-fix

* js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix:
sideband_demux(): fix decl-after-stmt

Merge branch 'jc/convert'Junio C Hamano Mon, 16 May 2011 23:47:16 +0000 (16:47 -0700)

Merge branch 'jc/convert'

* jc/convert:
convert: make it harder to screw up adding a conversion attribute
convert: make it safer to add conversion attributes
convert: give saner names to crlf/eol variables, types and functions
convert: rename the "eol" global variable to "core_eol"

Merge branch 'ci/commit--interactive-atomic'Junio C Hamano Mon, 16 May 2011 23:47:10 +0000 (16:47 -0700)

Merge branch 'ci/commit--interactive-atomic'

* ci/commit--interactive-atomic:
Test atomic git-commit --interactive
Add commit to list of config.singlekey commands
Add support for -p/--patch to git-commit
Allow git commit --interactive with paths
t7501.8: feed a meaningful command
Use a temporary index for git commit --interactive

Merge branch 'sg/completion-updates'Junio C Hamano Mon, 16 May 2011 23:47:00 +0000 (16:47 -0700)

Merge branch 'sg/completion-updates'

* sg/completion-updates:
Revert "completion: don't declare 'local words' to make zsh happy"
git-completion: fix regression in zsh support
completion: move private shopt shim for zsh to __git_ namespace
completion: don't declare 'local words' to make zsh happy

Merge branch 'kk/maint-prefix-in-config-mak'Junio C Hamano Mon, 16 May 2011 23:46:53 +0000 (16:46 -0700)

Merge branch 'kk/maint-prefix-in-config-mak'

* kk/maint-prefix-in-config-mak:
Honor $(prefix) set in config.mak* when defining ETC_GIT*
Revert "Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir"
Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir

Merge branch 'mg/merge-ff-config'Junio C Hamano Mon, 16 May 2011 23:46:23 +0000 (16:46 -0700)

Merge branch 'mg/merge-ff-config'

* mg/merge-ff-config:
tests: check git does not barf on merge.ff values for future versions of git
merge: introduce merge.ff configuration variable

Conflicts:
t/t7600-merge.sh

Merge branch 'maint'Junio C Hamano Mon, 16 May 2011 23:44:57 +0000 (16:44 -0700)

Merge branch 'maint'

* maint:
Update draft release notes to 1.7.5.2
Documentation/git-fsck.txt: fix typo: unreadable -> unreachable

Update draft release notes to 1.7.5.2Junio C Hamano Mon, 16 May 2011 23:44:50 +0000 (16:44 -0700)

Update draft release notes to 1.7.5.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>