gitweb.git
Test tracking of non-commit upstreamsMichael J Gruber Mon, 11 May 2009 14:42:53 +0000 (16:42 +0200)

Test tracking of non-commit upstreams

git-checkout and git-branch allow setting up an arbitrary committish as
the upstream reference for --track. In particular, tags are allowed. But
they and git-status barf on non-commit upstreams as soon as they are
asked for trackings stats.

Expose this shortcoming by adding two tests: annotated tags are affected
but lightweight tags are OK.

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

Quote LF in urls git fetch saves in FETCH_HEADAlex Riesen Wed, 13 May 2009 18:08:53 +0000 (20:08 +0200)

Quote LF in urls git fetch saves in FETCH_HEAD

The fmt-merge-msg does a strong syntax checking of its input and fails
with if it is incorrect. The LF character is the only character
important for fmt-merge-msg. As the url in FETCH_HEAD plays only
informational role, a quoted representation of the url should be good
and true enough.
The url often comes from either user-editable config or command line,
so it is reasonable to expect all kinds of characters in it, including
the characters which the format of FETCH_HEAD considers special (line
separator in this case).

Noticed and reported by Hugo Mildenberger.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: clarify / requirement in 'git check... Michael J Gruber Wed, 13 May 2009 15:43:06 +0000 (17:43 +0200)

Documentation: clarify / requirement in 'git check-ref-format'

'git check-ref-format' checks for the presence of at least one '/', the
idea being that there should be no refs directly below 'refs/', so there
should be a category like 'heads/' or 'tags/' in a refname.

Try and make this clearer in the man page.

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

bash completion: complete variable names for "git confi... Stephen Boyd Sat, 9 May 2009 01:23:32 +0000 (18:23 -0700)

bash completion: complete variable names for "git config" with options

This makes it easier for users to get and unset their configuration
variables without having to open documentation or dig through their
configuration file.

__git_config_get_set_variables() retrieves the set configuration
variables from the appropriate configuration file. For example, if
the user has previously specified --global only the global variables
are returned. The same applies for --system, and --file. If no
location has been specified, all set variables are returned.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Remove unused $hash_base parameter from normali... Jakub Narebski Mon, 11 May 2009 17:45:11 +0000 (19:45 +0200)

gitweb: Remove unused $hash_base parameter from normalize_link_target

...since it was decided for normalize_link_target to only mangle
pathname, and do not try to check if target is present in $hash_base
tree, for performance reasons.

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

gitweb: Simplify snapshot format detection logic in... Jakub Narebski Mon, 11 May 2009 17:42:47 +0000 (19:42 +0200)

gitweb: Simplify snapshot format detection logic in evaluate_path_info

This issue was caught by perlcritic in harsh severity level noticing
that catch variable was used outside conditional thanks to the
Perl::Critic::Policy::RegularExpressions::ProhibitCaptureWithoutTest
policy. See "Perl Best Practices", chapter 12. Regular Expressions,
section 12.15. Captured Values:

Pattern matches that fail never assign anything to $1, $2, etc.,
nor do they leave those variables undefined. After an unsuccessful
pattern match, the numeric capture variables remain exactly as they
were before the match was attempted.

New version is in my opinion much easier to understand; previous
version worked correctly due to the fact that we returned from loop
on first found match.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Use capturing parentheses only when you intend... Jakub Narebski Mon, 11 May 2009 17:39:43 +0000 (19:39 +0200)

gitweb: Use capturing parentheses only when you intend to capture

Non-capturing groups are useful because they have better runtime
performance and do not copy strings to the magic global capture
variables.

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

gitweb: Replace wrongly added tabs with spacesJakub Narebski Mon, 11 May 2009 17:37:28 +0000 (19:37 +0200)

gitweb: Replace wrongly added tabs with spaces

In two places there was hard tab character instead of space.
Fix this.

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

Merge branch 'maint'Junio C Hamano Wed, 13 May 2009 05:51:09 +0000 (22:51 -0700)

Merge branch 'maint'

* maint:
GIT 1.6.3.1
Revert "checkout branch: prime cache-tree fully"

GIT 1.6.3.1 v1.6.3.1Junio C Hamano Wed, 13 May 2009 05:28:22 +0000 (22:28 -0700)

GIT 1.6.3.1

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

Merge branch 'maint-1.6.2' into maintJunio C Hamano Tue, 12 May 2009 16:58:34 +0000 (09:58 -0700)

Merge branch 'maint-1.6.2' into maint

* maint-1.6.2:
Revert "checkout branch: prime cache-tree fully"

Merge branch 'jc/maint-read-tree-multi' into maint... Junio C Hamano Tue, 12 May 2009 16:58:21 +0000 (09:58 -0700)

Merge branch 'jc/maint-read-tree-multi' into maint-1.6.2

* jc/maint-read-tree-multi:
Revert "checkout branch: prime cache-tree fully"

Revert "checkout branch: prime cache-tree fully"Junio C Hamano Tue, 12 May 2009 16:41:28 +0000 (09:41 -0700)

Revert "checkout branch: prime cache-tree fully"

The logic in 83ae209 (checkout branch: prime cache-tree fully,
2009-04-20) is bogus; checkout can switch branches with a dirty
index and in such a case the tree won't match HEAD.

Add t2014-switch to catch this breakage.

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

t3900: ISO-2022-JP has more than one popular variantsJunio C Hamano Tue, 12 May 2009 09:01:51 +0000 (02:01 -0700)

t3900: ISO-2022-JP has more than one popular variants

When converting from other encodings (e.g. EUC-JP or UTF-8), there are
subtly different variants of ISO-2022-JP, all of which are valid. At the
end of line or when a run of string switches to 1-byte sequence, ESC ( B
can be used to switch to ASCII or ESC ( J can be used to switch to ISO
646:JP (JIS X 0201) but they essentially are the same character set and
are used interchangeably. Similarly the set ESC $ @ switches to (JIS X
0208-1978) and ESC $ B switches to (JIS X 0208-1983) are in practice used
interchangeably.

Depending on the iconv library and the locale definition on the system, a
program that converts from another encoding to ISO-2022-JP can produce
different byte sequence, and GIT_TEST_CMP (aka "diff -u") will report the
difference as a failure.

Fix this by converting the expected and the actual output to UTF-8 before
comparing when the end result is ISO-2022-JP. The test vector string in
t3900/ISO-2022-JP.txt is expressed with ASCII and JIS X 0208-1983, but it
can be expressed with any other possible variant, and when converted back
to UTF-8, these variants produce identical byte sequences.

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

gitweb: Use block form of map/grep in a few cases moreJakub Narebski Sun, 10 May 2009 00:40:37 +0000 (02:40 +0200)

gitweb: Use block form of map/grep in a few cases more

Use block form of 'grep' i.e. 'grep {BLOCK} LIST' rather than
'grep(EXPR, LIST)' in filter_snapshot_fmts subroutine. This makes
code more readable, as expression is rather long, and statement above
there is 'map' with very similar expression also in the block form.

Remove unnecessary and misleading parentheses around block form 'map'
arguments in quote_command subroutine.

The inner "map" in format_snapshot_links was left alone, as it is not
clear whether adding parentheses or changing it into block form would
improve readibility and clarity of this code.

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

gitweb: Always use three argument form of openJakub Narebski Mon, 11 May 2009 01:29:40 +0000 (03:29 +0200)

gitweb: Always use three argument form of open

From 94638fb6edf3ea693228c680a6a30271ccd77522 Mon Sep 17 00:00:00 2001
From: Jakub Narebski <jnareb@gmail.com>
Date: Mon, 11 May 2009 03:25:55 +0200
Subject: [PATCH] gitweb: Localize magic variable $/

Instead of undefining and then restoring magic variable $/ (input
record separator) for 'slurp mode', localize it.

While at it, state explicitely that "local $/;" makes it undefined, by
using explicit "local $/ = undef;".

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

gitweb: Always use three argument form of openJakub Narebski Sun, 10 May 2009 00:38:34 +0000 (02:38 +0200)

gitweb: Always use three argument form of open

In most cases (except insert_file() subroutine) we used old two argument
form of 'open' to open files for reading. This can cause subtle bugs when
$projectroot or $projects_list file starts with mode characters ('>', '<',
'+<', '|', etc.) or with leading whitespace; and also when $projects_list
file or $mimetypes_file or ctags files end with trailing whitespace or '|'.

Additionally it is also more clear to explicitly state that we open those
files for reading.

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

gitweb: Do not use bareword filehandlesJakub Narebski Mon, 11 May 2009 01:21:06 +0000 (03:21 +0200)

gitweb: Do not use bareword filehandles

gitweb: Do not use bareword filehandles

The script was using bareword filehandles. This is considered a bad
practice so they have been changed to indirect filehandles.

Changes touch git_get_project_ctags and mimetype_guess_file;
while at it rename local variable from $mime to $mimetype (in
mimetype_guess_file) to better reflect its value (its contents).

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

bisect: make "git bisect" use new "--next-all" bisect... Christian Couder Sat, 9 May 2009 15:55:47 +0000 (17:55 +0200)

bisect: make "git bisect" use new "--next-all" bisect-helper function

This patch replace the "--next-exit" option of "git bisect--helper"
with a "--next-all" option that does merge base checking using
the "check_good_are_ancestors_of_bad" function implemented in
"bisect.c" in a former patch.

The new "--next-all" option is then used in "git-bisect.sh" instead
of the "--next-exit" option, and all the shell functions in
"git-bisect.sh" that are now unused are removed.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: add "check_good_are_ancestors_of_bad" functionChristian Couder Sat, 9 May 2009 15:55:46 +0000 (17:55 +0200)

bisect: add "check_good_are_ancestors_of_bad" function

This is a port of the function with the same name that is in
"git-bisect.sh". The new function is not used yet but will be in
a later patch.

We also implement an helper "check_ancestors" function that use
"start_command" and "finish_command" to launch
"git rev-list $good ^$bad".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: implement the "check_merge_bases" functionChristian Couder Sat, 9 May 2009 15:55:45 +0000 (17:55 +0200)

bisect: implement the "check_merge_bases" function

And all functions needed to make it work.

This is a port from the shell function with the same name
"git-bisect.sh". This function is not used yet but it will be used
later.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: automatically sort sha1_array if needed when... Christian Couder Sat, 9 May 2009 15:55:44 +0000 (17:55 +0200)

bisect: automatically sort sha1_array if needed when looking it up

This makes sha1_array easier to use, so later patches will be simpler.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: make skipped array functions more genericChristian Couder Sat, 9 May 2009 15:55:43 +0000 (17:55 +0200)

bisect: make skipped array functions more generic

So they can be used on the good array too.

This is done by renaming many functions and some variables to
remove "skip" in the name, and by adding a
"struct sha1_array *array" argument where needed.

While at it, make the second argument to "lookup_sha1_array"
const. It becomes "const unsigned char *sha1".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: remove too much function nestingChristian Couder Sat, 9 May 2009 15:55:42 +0000 (17:55 +0200)

bisect: remove too much function nesting

This patch moves some function calls into "bisect_next_exit" so
that functions are nesting less.

The call to "bisect_rev_setup" is moved from "bisect_common" into
"bisect_next_exit" and the call to "read_bisect_refs" from
"bisect_rev_setup" into "bisect_next_exit".

While at it, "rev_argv" is moved into "bisect_rev_setup".

This will make it easier and cleaner to implement checking merge
bases.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: use new "struct argv_array" to prepare argv... Christian Couder Sat, 9 May 2009 15:55:41 +0000 (17:55 +0200)

bisect: use new "struct argv_array" to prepare argv for "setup_revisions"

Because we will use other instances of this struct.

The "rev_argv_push" function is changed into 2 functions
"argv_array_push" and "argv_array_push_sha1" that take a "struct
argv_array *" as first argument. And these functions are used to
simplify "bisect_rev_setup".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: store good revisions in a "sha1_array"Christian Couder Sat, 9 May 2009 15:55:40 +0000 (17:55 +0200)

bisect: store good revisions in a "sha1_array"

This will make it easier to use good revisions for checking merge
bases later.

To simplify the code, a new "sha1_array_push" function is also
introduced.

And while at it we move the earlier part of the code to fill the
argv that is passed to "setup_revisions", so that all this code is
now completely after "read_bisect_refs".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: implement "rev_argv_push" to fill an argv with... Christian Couder Sat, 9 May 2009 15:55:39 +0000 (17:55 +0200)

bisect: implement "rev_argv_push" to fill an argv with revs

This patch is a minor clean up right now, but the new function
will evolve and be used more later.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: use "sha1_array" to store skipped revisionsChristian Couder Sat, 9 May 2009 15:55:38 +0000 (17:55 +0200)

bisect: use "sha1_array" to store skipped revisions

This patch creates a "struct sha1_array" to store skipped revisions,
so that the same struct can be reused in a later patch for good
revisions.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ls-tree manpage: output of ls-tree is compatible with... Alex Riesen Sun, 10 May 2009 16:14:49 +0000 (18:14 +0200)

ls-tree manpage: output of ls-tree is compatible with update-index

Such format relationships are very useful things to remember for
script writers.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ls-tree manpage: use "unless" instead of "when ...... Alex Riesen Sun, 10 May 2009 16:13:45 +0000 (18:13 +0200)

ls-tree manpage: use "unless" instead of "when ... is not"

Delayed negation in a statement is harder to spot and keep in mind.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

am: simplify "sq" function by using "git rev-parse... Christian Couder Fri, 24 Apr 2009 06:29:01 +0000 (08:29 +0200)

am: simplify "sq" function by using "git rev-parse --sq-quote"

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: use "git rev-parse --sq-quote" instead of a... Christian Couder Fri, 24 Apr 2009 06:29:00 +0000 (08:29 +0200)

bisect: use "git rev-parse --sq-quote" instead of a custom "sq" function

As the "sq" function was the only place using Perl in "git-bisect.sh",
this removes the Perl dependency in this script.

While at it, we also remove the sed instruction in the Makefile that
substituted @@PERL@@ with the Perl path in shell scripts, as this is
not needed anymore. (It is now only needed in "git-instaweb.sh" but
this command is dealt with separately in the Makefile.)

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-parse: add --sq-quote to shell quote argumentsChristian Couder Sat, 25 Apr 2009 04:55:26 +0000 (06:55 +0200)

rev-parse: add --sq-quote to shell quote arguments

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-list: remove stringed output flag from "show_bisect... Christian Couder Tue, 21 Apr 2009 05:54:10 +0000 (07:54 +0200)

rev-list: remove stringed output flag from "show_bisect_vars"

Because it was used only by "git bisect--helper --next-vars" but
the "--next-vars" option has been removed.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect--helper: remove "--next-vars" option as it is... Christian Couder Tue, 21 Apr 2009 05:54:09 +0000 (07:54 +0200)

bisect--helper: remove "--next-vars" option as it is now useless

Because it has been replaced by "--next-exit".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: use "git bisect--helper --next-exit" in "git... Christian Couder Sun, 19 Apr 2009 09:56:16 +0000 (11:56 +0200)

bisect: use "git bisect--helper --next-exit" in "git-bisect.sh"

instead of "git bisect--helper --next-vars".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect--helper: add "--next-exit" to output bisect... Christian Couder Sun, 19 Apr 2009 09:56:07 +0000 (11:56 +0200)

bisect--helper: add "--next-exit" to output bisect results

The goal of this patch is to port more shell code from the "bisect_next"
function in "git-bisect.sh" to C code in "builtin-bisect--helper.c".

So we port the code that interprets the bisection result and stops or
continues (by checking out the next revision) the bisection process.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: move common bisect functionality to "bisect_common"Christian Couder Sun, 19 Apr 2009 09:55:57 +0000 (11:55 +0200)

bisect: move common bisect functionality to "bisect_common"

So we can easily reuse the code in a later patch.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-list: refactor printing bisect varsChristian Couder Sun, 19 Apr 2009 09:55:43 +0000 (11:55 +0200)

rev-list: refactor printing bisect vars

This simplifies the code, and while at it we create the
"print_commit_list" function that will be reused later.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-list: make "estimate_bisect_steps" non staticChristian Couder Sun, 19 Apr 2009 09:55:38 +0000 (11:55 +0200)

rev-list: make "estimate_bisect_steps" non static

Because it will be used from "bisect.c" too.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: never leave index unmerged while recursingDave Olszewski Sat, 9 May 2009 21:49:59 +0000 (14:49 -0700)

merge-recursive: never leave index unmerged while recursing

When you are trying to come up with the final result (i.e. depth=0), you
want to record how the conflict arose by registering the state of the
common ancestor, your branch and the other branch in the index, hence you
want to do update_stages().

When you are merging with positive depth, that is because of a criss-cross
merge situation. In such a case, you would need to record the tentative
result, with conflict markers and all, as if the merge went cleanly, even
if there are conflicts, in order to write it out as a tree object later to
be used as a common ancestor tree.

update_file() calls update_file_flags() with update_cache=1 to signal that
the result needs to be written to the index at stage #0 (i.e. merged), and
the code should not clobber the index further by calling update_stages().

The codepath to deal with rename/delete conflict in a recursive merge
however left the index unmerged.

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

Teach 'git checkout' to preload the index contentsLinus Torvalds Sat, 9 May 2009 22:11:17 +0000 (15:11 -0700)

Teach 'git checkout' to preload the index contents

This makes git checkout know to use the threaded index preloading if it
is enabled in the config file. You need to have

[core]
preloadindex = true

in your config file to see it, and for that feature to make sense your
filesystem needs to be able to do concurrent 'lstat()' lookups, but when
that is the case (especially NFS over a high-latency network), this can
be a noticeable performance win.

But with a low-latency network and at least older Linux NFS clients, this
will clearly potentially cause a lot of lock contention. It may still
speed up the uncached case, but the threading and locking overhead will
result in the cached case likely slowing down.

That was almost certainly fixed by Linux commit fc0f684c2 ("NFS: Remove
BKL from NFS lookup code"), but that one got merged into 2.6.27-rc1, so
older kernel versions than 2.6.27 will not scale very well.

But regardless, it's the right thing to do. If your filesystem doesn't
scale, don't enable index preloading.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Avoid unnecessary 'lstat()' calls in 'get_stat_data()'Linus Torvalds Sat, 9 May 2009 21:57:30 +0000 (14:57 -0700)

Avoid unnecessary 'lstat()' calls in 'get_stat_data()'

When we ask get_stat_data() to get the mode and size of an index entry,
we can avoid the lstat() call if we have marked the index entry as being
uptodate due to earlier lstat() calls.

This avoids a lot of unnecessary lstat() calls in eg 'git checkout',
where the last phase shows the differences to the working tree
(requiring a diff), but earlier phases have already verified the index.

On the kernel repo (with a fast machine and everything cached), this
changes timings of a nul 'git checkout' from

- Before (best of ten):

0.14user 0.05system 0:00.19elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+13237minor)pagefaults 0swaps

- After
0.11user 0.03system 0:00.15elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+13235minor)pagefaults 0swaps

so it can obviously be noticeable, although equally obviously it's not a
show-stopper on this particular machine. The difference is likely larger
on slower machines, or with operating systems that don't do as good a job
of name caching.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sat, 9 May 2009 16:27:43 +0000 (09:27 -0700)

Merge branch 'maint'

* maint:
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

allow -t abbreviation for --track in git branchSitaram Chamarty Tue, 28 Apr 2009 15:21:20 +0000 (20:51 +0530)

allow -t abbreviation for --track in git branch

also makes it consistent with git-checkout

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

Add --reference option to git submodule.Michael S. Tsirkin Mon, 4 May 2009 19:30:01 +0000 (22:30 +0300)

Add --reference option to git submodule.

This adds --reference option to git submodule add and
git submodule update commands, which is passed to git clone.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add: don't complain when adding empty project rootJeff King Wed, 29 Apr 2009 03:21:01 +0000 (23:21 -0400)

add: don't complain when adding empty project root

We try to warn the user if one of their pathspecs caused no
matches, as it may have been a typo. However, we disable the
warning if the pathspec points to an existing file, since
that means it is not a typo but simply an empty directory.

Unfortunately, the file_exists() test was broken for one
special case: the pathspec of the project root is just "".
This patch detects this special case and acts as if the file
exists (which it must, since it is the project root).

The user-visible effect is that this:

$ mkdir repo && cd repo && git init && git add .

used to complain like:

fatal: pathspec '' did not match any files

but now is a silent no-op.

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

Git.pm: Always set Repository to absolute path if autod... Frank Lichtenheld Thu, 7 May 2009 13:41:28 +0000 (15:41 +0200)

Git.pm: Always set Repository to absolute path if autodetecting

So far we only set it to absolute paths in some cases which lead
to problems like wc_chdir not working.

Signed-off-by: Frank Lichtenheld <flichtenheld@astaro.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git.pm: Set GIT_WORK_TREE if we set GIT_DIRFrank Lichtenheld Thu, 7 May 2009 13:41:27 +0000 (15:41 +0200)

Git.pm: Set GIT_WORK_TREE if we set GIT_DIR

Otherwise git will use the current directory as work tree which will
lead to unexpected results if we operate in sub directory of the
work tree.

Signed-off-by: Frank Lichtenheld <flichtenheld@astaro.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetool--lib: specialize diff options for emerge... David Aguilar Sat, 2 May 2009 08:57:21 +0000 (01:57 -0700)

mergetool--lib: specialize diff options for emerge and ecmerge

The ecmerge documentation mentions the following form:

ecmerge --mode=diff2 $1 $2

Since git-difftool is about diffing, we should use that instead
of --mode=merge2. Likewise, this drops the $MERGED argument to
emerge, as discussed on the git list ($gmane/117930).

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

format-patch let -k override a config-specified format... Jim Meyering Sat, 9 May 2009 08:12:01 +0000 (10:12 +0200)

format-patch let -k override a config-specified format.numbered

Let a command-line --keep-subject (-k) override a config-specified
format.numbered (--numbered (-n)), rather than provoking the
"-n and -k are mutually exclusive" failure.
* t4021-format-patch-numbered.sh: Test for the above

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

fix GIT_TRACE segfault with shell-quoted aliasesJeff King Fri, 8 May 2009 09:06:15 +0000 (05:06 -0400)

fix GIT_TRACE segfault with shell-quoted aliases

The alias argv comes from the split_cmdline function, which
splits the config text for the alias into an array of
strings. It returns the number of elements in the array, but
does not actually put a NULL at the end of the array.
Later, the trace function tries to print this argv and
assumes that it has the trailing NULL.

The split_cmdline function is probably at fault, since argv
lists almost always end with a NULL signal. This patch adds
one, in addition to the returned count; this doesn't hurt
the other callers at all, since they were presumably using
the count already (and will never look at the NULL).

While we're there and using ALLOC_GROW, let's clean up the
other manual grow.

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

Disallow '\' in ref namesRobin Rosenberg Fri, 8 May 2009 05:32:37 +0000 (07:32 +0200)

Disallow '\' in ref names

This is asking for trouble since '\' is a directory separator in
Windows and thus may produce unpredictable results.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Remove function prototypes (cleanup)Jakub Narebski Thu, 7 May 2009 17:11:29 +0000 (19:11 +0200)

gitweb: Remove function prototypes (cleanup)

Use of function prototypes is considered bad practice in Perl. The
ones used here didn't accomplish anything anyhow, so they've been
removed.

>From perlsub(1):

[...] the intent of this feature [prototypes] is primarily to let
you define subroutines that work like built-in functions [...]
you can generate new syntax with it [...]

We don't want to have subroutines behaving exactly like built-in
functions, we don't want to define new syntax / syntactic sugar, so
prototypes in gitweb are not needed... and they can have unintended
consequences.

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

Documentation: cloning to empty directory is allowedAlexander Potashev Thu, 7 May 2009 12:04:08 +0000 (16:04 +0400)

Documentation: cloning to empty directory is allowed

Cloning into an existing empty directory is now allowed:
commit 55892d23981917aefdb387ad7d0429f90cbd446a
("Allow cloning to an existing empty directory")

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Extend sample update hook, disable modifying of existin... Heiko Voigt Fri, 8 May 2009 15:22:30 +0000 (17:22 +0200)

Extend sample update hook, disable modifying of existing tags

Because no special rule for this existed it was allowed by default

Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: use parseoptRené Scharfe Thu, 7 May 2009 19:46:48 +0000 (21:46 +0200)

grep: use parseopt

Convert git-grep to parseopt.

The bitfields in struct grep_opt are converted to full ints,
increasing its size. This shouldn't be a problem as there is only a
single instance in memory.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: remove global variable builtin_grepRené Scharfe Thu, 7 May 2009 19:46:17 +0000 (21:46 +0200)

grep: remove global variable builtin_grep

Replace the only global variable in builtin-grep.c, builtin_grep, by a
local one and a function parameter with reversed meaning.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parseopt: add PARSE_OPT_NODASHRené Scharfe Thu, 7 May 2009 19:45:42 +0000 (21:45 +0200)

parseopt: add PARSE_OPT_NODASH

Add support for options that don't start with a dash. Initially, they
don't accept arguments and can only be short options, i.e. consist of a
single character.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parseopt: add OPT_NUMBER_CALLBACKRené Scharfe Thu, 7 May 2009 19:45:08 +0000 (21:45 +0200)

parseopt: add OPT_NUMBER_CALLBACK

Add a way to recognize numerical options. The number is passed to
a callback function as a string.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parseopt: add OPT_NEGBITJeff King Fri, 8 May 2009 05:01:17 +0000 (01:01 -0400)

parseopt: add OPT_NEGBIT

On Thu, May 07, 2009 at 09:44:17PM +0200, René Scharfe wrote:
Subject: [PATCH] ls-files: make --no-empty-directory properly negatable

This option was specified to parseopt as an OPT_BIT; however, we
actually want to _set_ the bit on --no-empty-directory. Thus the
existing implementation used --no-empty-directory, and required
--no-no-empty-directory to negate it.

Now that OPT_NEGBIT exists, we can properly support it as
--empty-directory and --no-empty-directory (but of course
still defaulting to showing empty directories).

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

parseopt: add OPT_NEGBITRené Scharfe Thu, 7 May 2009 19:44:17 +0000 (21:44 +0200)

parseopt: add OPT_NEGBIT

Add OPTION_NEGBIT and OPT_NEGBIT, mirroring OPTION_BIT and OPT_BIT.
OPT_NEGBIT can be used together with OPT_BIT to define two options
that cancel each other out.

Note: this patch removes the reminder from the test script because
it adds a test for --no-or4 and there already was one for --or4.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Clarify kind of conflict in merge-one-file helperAlex Riesen Wed, 29 Apr 2009 21:40:50 +0000 (23:40 +0200)

Clarify kind of conflict in merge-one-file helper

Not as verbose as the recursive merge driver, but better still.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git config: clarify --add and --get-colorFelipe Contreras Wed, 6 May 2009 22:57:08 +0000 (01:57 +0300)

git config: clarify --add and --get-color

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive-tar.c: squelch a type mismatch warningJunio C Hamano Thu, 7 May 2009 08:08:19 +0000 (01:08 -0700)

archive-tar.c: squelch a type mismatch warning

On some systems, giving a value of type time_t to printf "%lo" that
expects an unsigned long would give a type mismatch warning.

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

Start 1.6.4 developmentJunio C Hamano Sat, 9 May 2009 04:56:57 +0000 (21:56 -0700)

Start 1.6.4 development

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

Start 1.6.3.1 maintenance series.Junio C Hamano Sat, 9 May 2009 04:49:14 +0000 (21:49 -0700)

Start 1.6.3.1 maintenance series.

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

Merge branch 'maint-1.6.1' into maint-1.6.2Junio C Hamano Sat, 9 May 2009 04:13:47 +0000 (21:13 -0700)

Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:

Merge branch 'maint-1.6.0' into maint-1.6.1Junio C Hamano Sat, 9 May 2009 04:12:41 +0000 (21:12 -0700)

Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
dir.c: Fix two minor grammatical errors in comments

GIT 1.6.3 v1.6.3Junio C Hamano Thu, 7 May 2009 00:13:27 +0000 (17:13 -0700)

GIT 1.6.3

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

t4029: use sh instead of bashNguyễn Thái Ngọc Duy Wed, 6 May 2009 14:33:34 +0000 (00:33 +1000)

t4029: use sh instead of bash

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

t4200: convert sed expression which operates on non... Brandon Casey Wed, 6 May 2009 22:56:18 +0000 (17:56 -0500)

t4200: convert sed expression which operates on non-text file to perl

POSIX only requires sed to work on text files and MERGE_RR is not a text
file. Some versions of sed complain that this file is not newline
terminated, and exit non-zero. Use perl instead which does not have a
problem with it.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4200: remove two unnecessary linesBrandon Casey Wed, 6 May 2009 22:56:17 +0000 (17:56 -0500)

t4200: remove two unnecessary lines

These two lines appear to be unnecessary. They set variables which are not
used afterwards. The primary motivation to remove them is that the sed
invocation exits non-zero for seds which require newline termination of
input files.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/annotate-tests.sh: avoid passing a non-newline termin... Brandon Casey Wed, 6 May 2009 18:29:16 +0000 (13:29 -0500)

t/annotate-tests.sh: avoid passing a non-newline terminated file to sed

Some versions of sed exit non-zero if the file they are supplied is not
newline terminated. Solaris's /usr/xpg4/bin/sed is one such sed. So
rework this test to avoid doing so.

This affects tests t8001-annotate.sh and t8002-blame.sh.

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

t4118: avoid sed invocation on file without terminating... Brandon Casey Wed, 6 May 2009 18:29:15 +0000 (13:29 -0500)

t4118: avoid sed invocation on file without terminating newline

Some versions of sed exit non-zero if the file they are supplied is not
newline terminated. Solaris's /usr/xpg4/bin/sed is one such sed. In
this case the sed invocation can be avoided entirely since the resulting
file is equivalent to a previously created file. So, just copy that file
into place instead.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4118: add missing '&&'Brandon Casey Wed, 6 May 2009 18:29:14 +0000 (13:29 -0500)

t4118: add missing '&&'

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t8005: use egrep when extended regular expressions... Brandon Casey Wed, 6 May 2009 18:31:42 +0000 (13:31 -0500)

t8005: use egrep when extended regular expressions are required

Not all versions of grep understand backslashed extended regular
expressions. Possibly only gnu grep does.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-clean doc: the command only affects paths under... Junio C Hamano Wed, 6 May 2009 17:48:26 +0000 (10:48 -0700)

git-clean doc: the command only affects paths under $(cwd)

Fredrik Skolmli and Thomas Rast noticed that it was left unstated that
"git clean" ran from a subdirectory will not affect anything outside it,
with or without path limiters.

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

Merge branch 'maint'Junio C Hamano Wed, 6 May 2009 05:52:17 +0000 (22:52 -0700)

Merge branch 'maint'

* maint:
improve error message in config.c
t4018-diff-funcname: add cpp xfuncname pattern to syntax test
Work around BSD whose typeof(tv.tv_sec) != time_t
git-am.txt: reword extra headers in message body
git-am.txt: Use date or value instead of time or timestamp
git-am.txt: add an 'a', say what 'it' is, simplify a sentence
dir.c: Fix two minor grammatical errors in comments
git-svn: fix a sloppy Getopt::Long usage

Merge branch 'rj/maint-1.6.0-svn-parse-fix' into maintJunio C Hamano Wed, 6 May 2009 05:51:49 +0000 (22:51 -0700)

Merge branch 'rj/maint-1.6.0-svn-parse-fix' into maint

* rj/maint-1.6.0-svn-parse-fix:
git-svn: fix a sloppy Getopt::Long usage

Merge branch 'maint-1.6.0' into maintJunio C Hamano Wed, 6 May 2009 05:51:31 +0000 (22:51 -0700)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
dir.c: Fix two minor grammatical errors in comments

improve error message in config.cAlex Riesen Wed, 29 Apr 2009 21:27:54 +0000 (23:27 +0200)

improve error message in config.c

Show errno if opening a lockfile fails.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4018-diff-funcname: add cpp xfuncname pattern to synta... Brandon Casey Sat, 2 May 2009 14:31:16 +0000 (09:31 -0500)

t4018-diff-funcname: add cpp xfuncname pattern to syntax test

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Work around BSD whose typeof(tv.tv_sec) != time_tBernd Ahlers Mon, 6 Apr 2009 17:26:37 +0000 (19:26 +0200)

Work around BSD whose typeof(tv.tv_sec) != time_t

According to POSIX, tv_sec is supposed to be a time_t, but OpenBSD
(and FreeBSD, too) defines it to be a long, which triggers a type
mismatch when a pointer to it is given to localtime_r().

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

git-am.txt: reword extra headers in message bodyStephen Boyd Mon, 4 May 2009 06:46:58 +0000 (23:46 -0700)

git-am.txt: reword extra headers in message body

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am.txt: Use date or value instead of time or timestampStephen Boyd Tue, 5 May 2009 05:19:00 +0000 (22:19 -0700)

git-am.txt: Use date or value instead of time or timestamp

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am.txt: add an 'a', say what 'it' is, simplify... Stephen Boyd Tue, 5 May 2009 05:18:42 +0000 (22:18 -0700)

git-am.txt: add an 'a', say what 'it' is, simplify a sentence

It's nice to know that 'it' is git-am or the subject line. Whitespace
implies characters so just remove characters.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: complete values for send-emailStephen Boyd Mon, 4 May 2009 06:25:35 +0000 (23:25 -0700)

completion: complete values for send-email

Add completion for --confirm, --suppress-cc, and --smtp-encryption
command line arguments. Add completion for aliasfiletype and confirm
configuration variables.

Since --smtp-ssl is deprecated, replace it with --smtp-encryption and
the two options ssl and tls.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: complete values for log.dateStephen Boyd Mon, 4 May 2009 06:25:34 +0000 (23:25 -0700)

completion: complete values for log.date

Add raw to the date formats too.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: complete values for help.formatStephen Boyd Mon, 4 May 2009 06:25:33 +0000 (23:25 -0700)

completion: complete values for help.format

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add {gui,diff,merge}tool, man, and pager... Stephen Boyd Mon, 4 May 2009 06:25:32 +0000 (23:25 -0700)

completion: add {gui,diff,merge}tool, man, and pager config variables

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add missing configuration variables to... Stephen Boyd Mon, 4 May 2009 06:25:31 +0000 (23:25 -0700)

completion: add missing configuration variables to _git_config()

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: Fix two minor grammatical errors in commentsAllan Caffee Mon, 4 May 2009 17:37:30 +0000 (13:37 -0400)

dir.c: Fix two minor grammatical errors in comments

Signed-off-by: Allan Caffee <allan.caffee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: fix a sloppy Getopt::Long usageRobin H. Johnson Tue, 5 May 2009 18:16:14 +0000 (11:16 -0700)

git-svn: fix a sloppy Getopt::Long usage

Getopt-Long v2.38 is much stricter about sloppy getopt usage. The
trailing pipe causes git-svn testcases to fail for all of the --stdin
argument calls.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with GIT 1.6.2.5Junio C Hamano Sun, 3 May 2009 23:46:34 +0000 (16:46 -0700)

Sync with GIT 1.6.2.5

GIT 1.6.2.5 v1.6.2.5Junio C Hamano Sun, 3 May 2009 23:14:58 +0000 (16:14 -0700)

GIT 1.6.2.5

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

Merge branch 'np/maint-no-ofs-delta' into maintJunio C Hamano Sun, 3 May 2009 23:50:47 +0000 (16:50 -0700)

Merge branch 'np/maint-no-ofs-delta' into maint

* np/maint-no-ofs-delta:
honor repack.usedeltabaseoffset when fetching packs

Merge branch 'maint-1.6.1' into maintJunio C Hamano Sun, 3 May 2009 23:14:07 +0000 (16:14 -0700)

Merge branch 'maint-1.6.1' into maint

* maint-1.6.1:
GIT 1.6.1.4

Conflicts:
GIT-VERSION-GEN

GIT 1.6.1.4 v1.6.1.4Junio C Hamano Sun, 3 May 2009 22:20:03 +0000 (15:20 -0700)

GIT 1.6.1.4

With a handful of fixes backmerged from 1.6.2.X series

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

Merge branch 'jc/maint-read-tree-multi' into maintJunio C Hamano Sun, 3 May 2009 22:02:59 +0000 (15:02 -0700)

Merge branch 'jc/maint-read-tree-multi' into maint

* jc/maint-read-tree-multi:
checkout branch: prime cache-tree fully
read-tree -m A B: prime cache-tree from the switched-to tree
Move prime_cache_tree() to cache-tree.c
read-tree A B: do not corrupt cache-tree