git.git
16 years agounpack-object: cache for non written objects
Martin Koegler [Mon, 25 Feb 2008 21:46:10 +0000 (22:46 +0100)]
unpack-object: cache for non written objects

Preventing objects with broken links entering the repository
means, that write of some objects must be delayed.

This patch adds a cache to keep the object data in memory. The delta
resolving code must also search in the cache.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoadd common fsck error printing function
Martin Koegler [Mon, 25 Feb 2008 21:46:09 +0000 (22:46 +0100)]
add common fsck error printing function

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-fsck: move common object checking code to fsck.c
Martin Koegler [Mon, 25 Feb 2008 21:46:08 +0000 (22:46 +0100)]
builtin-fsck: move common object checking code to fsck.c

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-fsck: reports missing parent commits
Martin Koegler [Mon, 25 Feb 2008 21:46:07 +0000 (22:46 +0100)]
builtin-fsck: reports missing parent commits

parse_commit ignores parent commits with certain errors
(eg. a non commit object is already loaded under the sha1 of
the parent). To make fsck reports such errors, it has to compare
the nummer of parent commits returned by parse commit with the
number of parent commits in the object or in the graft/shallow file.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRemove unused object-ref code
Martin Koegler [Mon, 25 Feb 2008 21:46:06 +0000 (22:46 +0100)]
Remove unused object-ref code

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-fsck: move away from object-refs to fsck_walk
Martin Koegler [Mon, 25 Feb 2008 21:46:05 +0000 (22:46 +0100)]
builtin-fsck: move away from object-refs to fsck_walk

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoadd generic, type aware object chain walker
Martin Koegler [Mon, 25 Feb 2008 21:46:04 +0000 (22:46 +0100)]
add generic, type aware object chain walker

The requirements are:
* it may not crash on NULL pointers
* a callback function is needed, as index-pack/unpack-objects
  need to do different things
* the type information is needed to check the expected <-> real type
  and print better error messages

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopeel_onion: handle NULL
Martin Koegler [Mon, 18 Feb 2008 20:47:58 +0000 (21:47 +0100)]
peel_onion: handle NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocheck return value from parse_commit() in various functions
Martin Koegler [Mon, 18 Feb 2008 20:48:03 +0000 (21:48 +0100)]
check return value from parse_commit() in various functions

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoparse_commit: don't fail, if object is NULL
Martin Koegler [Mon, 18 Feb 2008 20:48:02 +0000 (21:48 +0100)]
parse_commit: don't fail, if object is NULL

Some codepaths (eg. builtin-rev-parse -> get_merge_bases -> parse_commit)
can pass NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorevision.c: handle tag->tagged == NULL
Martin Koegler [Mon, 18 Feb 2008 20:48:01 +0000 (21:48 +0100)]
revision.c: handle tag->tagged == NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoreachable.c::process_tree/blob: check for NULL
Martin Koegler [Mon, 18 Feb 2008 20:48:00 +0000 (21:48 +0100)]
reachable.c::process_tree/blob: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoprocess_tag: handle tag->tagged == NULL
Martin Koegler [Mon, 18 Feb 2008 20:47:59 +0000 (21:47 +0100)]
process_tag: handle tag->tagged == NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocheck results of parse_commit in merge_bases
Martin Koegler [Mon, 18 Feb 2008 20:47:57 +0000 (21:47 +0100)]
check results of parse_commit in merge_bases

An error is signaled by returning NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agolist-objects.c::process_tree/blob: check for NULL
Martin Koegler [Mon, 18 Feb 2008 20:47:56 +0000 (21:47 +0100)]
list-objects.c::process_tree/blob: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoreachable.c::add_one_tree: handle NULL from lookup_tree
Martin Koegler [Mon, 18 Feb 2008 20:47:55 +0000 (21:47 +0100)]
reachable.c::add_one_tree: handle NULL from lookup_tree

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomark_blob/tree_uninteresting: check for NULL
Martin Koegler [Mon, 18 Feb 2008 20:47:54 +0000 (21:47 +0100)]
mark_blob/tree_uninteresting: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoget_sha1_oneline: check return value of parse_object
Martin Koegler [Mon, 18 Feb 2008 20:47:53 +0000 (21:47 +0100)]
get_sha1_oneline: check return value of parse_object

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoread_object_with_reference: don't read beyond the buffer
Martin Koegler [Mon, 18 Feb 2008 20:47:52 +0000 (21:47 +0100)]
read_object_with_reference: don't read beyond the buffer

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGIT 1.5.4.2 v1.5.4.2
Junio C Hamano [Sun, 17 Feb 2008 06:44:31 +0000 (22:44 -0800)]
GIT 1.5.4.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-reset: Add an example of resetting selected paths
Pieter de Bie [Sat, 16 Feb 2008 16:48:46 +0000 (17:48 +0100)]
Documentation/git-reset: Add an example of resetting selected paths

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-reset: don't mention --mixed for selected-paths reset
Pieter de Bie [Sat, 16 Feb 2008 16:48:45 +0000 (17:48 +0100)]
Documentation/git-reset: don't mention --mixed for selected-paths reset

The option is accepted, but that is the only form selected-paths
variant of the reset command takes, so there is no point mentioning it.
And while we're at it, use the dashless git call.

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-reset:
Junio C Hamano [Sat, 16 Feb 2008 18:38:12 +0000 (10:38 -0800)]
Documentation/git-reset:

Since 3368d11 (Remove unnecessary git-rm --cached reference from
status output), the status output marks the "Added but not yet
committed" section as "Changes to be committed".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocommit: discard index after setting up partial commit
Jeff King [Thu, 14 Feb 2008 17:18:23 +0000 (12:18 -0500)]
commit: discard index after setting up partial commit

There may still be some entries from the original index that
should be discarded before we show the status. In
particular, if a file was added in the index but not
included in the partial commit, it would still show up in
the status listing as staged for commit.

Ultimately the correct fix is to keep the two states in
separate index_state variables. Then we can avoid having
to reload the cache from the temporary file altogether, and
just point wt_status_print at the correct index.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch: handle filenames that need quoting
Junio C Hamano [Sat, 16 Feb 2008 07:57:26 +0000 (23:57 -0800)]
filter-branch: handle filenames that need quoting

The command used a very old fashioned construct to extract
filenames out of diff-index and ended up corrupting the output.
We can simply use --name-only and pipe into --stdin mode of
update-index.  It's been like that for the past 2 years or so
since a94d994 (update-index: work with c-quoted name).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff: Fix miscounting of --check output
Junio C Hamano [Sat, 16 Feb 2008 04:30:05 +0000 (20:30 -0800)]
diff: Fix miscounting of --check output

c1795bb (Unify whitespace checking) incorrectly made the
checking function return without incrementing the line numbers
when there is no whitespace problem is found on a '+' line.

This resurrects the earlier behaviour.

Noticed and reported by Jay Soffian.  The test script was stolen
from Jay's independent fix.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agohg-to-git: fix parent analysis
Stelian Pop [Fri, 15 Feb 2008 21:20:44 +0000 (22:20 +0100)]
hg-to-git: fix parent analysis

Fix a bug in the hg-to-git convertor introduced by commit
1bc7c13af9f936aa80893100120b542338a10bf4: when searching the changeset
parents, 'hg log' returns an extra space at the end of the line, which
confuses the .split(' ') based tokenizer:

    Traceback (most recent call last):
      File "hg-to-git.py", line 123, in <module>
          hgchildren[mparent] += ( str(cset), )
      KeyError: ''

Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomailinfo: feed only one line to handle_filter() for QP input
Jay Soffian [Fri, 15 Feb 2008 21:53:36 +0000 (16:53 -0500)]
mailinfo: feed only one line to handle_filter() for QP input

The function is intended to be fed one logical line at a time to
inspect, but a QP encoded raw input line can have more than one
lines, just like BASE64 encoded one.

Quoting LF as =0A may be unusual but RFC2045 allows it.

The issue was noticed and fixed by Jay Soffian.  JC added a test
to protect the fix from regressing later.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"
Christian Couder [Sat, 16 Feb 2008 05:02:17 +0000 (06:02 +0100)]
diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"

Also use "git_config_string" to simplify code where "cmd" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd "const" qualifier to "char *excludes_file".
Christian Couder [Sat, 16 Feb 2008 05:01:59 +0000 (06:01 +0100)]
Add "const" qualifier to "char *excludes_file".

Also use "git_config_string" to simplify "config.c" code
where "excludes_file" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd "const" qualifier to "char *editor_program".
Christian Couder [Sat, 16 Feb 2008 05:01:41 +0000 (06:01 +0100)]
Add "const" qualifier to "char *editor_program".

Also use "git_config_string" to simplify "config.c" code
where "editor_program" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd "const" qualifier to "char *pager_program".
Christian Couder [Sat, 16 Feb 2008 05:01:11 +0000 (06:01 +0100)]
Add "const" qualifier to "char *pager_program".

Also use "git_config_string" to simplify "config.c" code
where "pager_program" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconfig: add 'git_config_string' to refactor string config variables.
Christian Couder [Sat, 16 Feb 2008 05:00:24 +0000 (06:00 +0100)]
config: add 'git_config_string' to refactor string config variables.

In many places we just check if a value from the config file is not
NULL, then we duplicate it and return 0. This patch introduces the new
'git_config_string' function to do that.

This function is also used to refactor some code in 'config.c'.
Refactoring other files is left for other patches.

Also not all the code in "config.c" is refactored, because the function
takes a "const char **" as its first parameter, but in many places a
"char *" is used instead of a "const char *". (And C does not allow
using a "char **" instead of a "const char **" without a warning.)

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff.c: remove useless check for value != NULL
Christian Couder [Sat, 16 Feb 2008 04:59:53 +0000 (05:59 +0100)]
diff.c: remove useless check for value != NULL

It is not necessary to check if value != NULL before calling
'parse_lldiff_command' as there is already a check inside this
function.

By the way this patch also improves the existing check inside
'parse_lldiff_command' by using:
return config_error_nonbool(var);
instead of:
return error("%s: lacks value", var);

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofast-import: check return value from unpack_entry()
Shawn O. Pearce [Thu, 14 Feb 2008 06:34:34 +0000 (01:34 -0500)]
fast-import: check return value from unpack_entry()

If the tree object we have asked for is deltafied in the packfile and
the delta did not apply correctly or was not able to be decompressed
from the packfile then we can get back NULL instead of the tree data.
This is (part of) the reason why read_sha1_file() can return NULL, so
we need to also handle it the same way.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoValidate nicknames of remote branches to prohibit confusing ones
Daniel Barkalow [Fri, 15 Feb 2008 19:14:18 +0000 (14:14 -0500)]
Validate nicknames of remote branches to prohibit confusing ones

The original problem was that the parsers for configuration files were
getting confused by seeing as nicknames remotes that involved
directory-changing characters. In particular, the branches config file
for ".." was particularly mystifying on platforms that can open
directories and read odd data from them.

The validation function was written by Junio Hamano (with a typo
corrected).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff.c: replace a 'strdup' with 'xstrdup'.
Christian Couder [Thu, 14 Feb 2008 05:50:00 +0000 (06:50 +0100)]
diff.c: replace a 'strdup' with 'xstrdup'.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff.c: fixup garding of config parser from value=NULL
Junio C Hamano [Fri, 15 Feb 2008 17:37:54 +0000 (09:37 -0800)]
diff.c: fixup garding of config parser from value=NULL

Christian Couder noticed that there still were a handcrafted error()
call that we should have converted to config_error_nonbool() where
parse_lldiff_command() parses the configuration file.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconfig: add test cases for empty value and no value config variables.
Christian Couder [Thu, 7 Feb 2008 05:23:46 +0000 (06:23 +0100)]
config: add test cases for empty value and no value config variables.

The tests in 't1300-repo-config.sh' did not check what happens when
an empty value like the following is used in the config file:

[emptyvalue]
variable =

Also it was not checked that a variable with no value like the
following:

[novalue]
variable

gives a boolean "true" value, while an ampty value gives a boolean
"false" value.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocvsimport: have default merge regex also match beginning of commit message
Gerrit Pape [Thu, 7 Feb 2008 09:36:10 +0000 (09:36 +0000)]
cvsimport: have default merge regex also match beginning of commit message

The default value of @mergerx uses \W, which matches a non-word
character; this means that commit messages like "Merging FOO" are not
matched by default; using \b, which matches a word boundary, instead of
\W fixes that.

This change was suggested by Frédéric Brière through
 http://bugs.debian.org/463468

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit clone -s documentation: force a new paragraph for the NOTE
Miklos Vajna [Tue, 12 Feb 2008 00:12:57 +0000 (01:12 +0100)]
git clone -s documentation: force a new paragraph for the NOTE

It should be loud and clear.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agostatus: suggest "git rm --cached" to unstage for initial commit
Jeff King [Tue, 12 Feb 2008 05:45:18 +0000 (00:45 -0500)]
status: suggest "git rm --cached" to unstage for initial commit

It makes no sense to suggest "git reset HEAD" since we have
no HEAD commit. This actually used to work but regressed in
f26a0012.

wt_status_print_cached_header was updated to take the whole
wt_status struct rather than just the reference field.
Previously the various code paths were sometimes sending in
s->reference and sometimes sending in NULL, making the
decision on whether this was an initial commit before we
even got to this function. Now we must check the initial
flag here.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoProtect get_author_ident_from_commit() from filenames in work tree
Junio C Hamano [Wed, 13 Feb 2008 21:13:21 +0000 (13:13 -0800)]
Protect get_author_ident_from_commit() from filenames in work tree

We used to use "cat-file commit $commit" to extract the original
author information from existing commit, but an earlier commit
5ac2715 (Consistent message encoding while reusing log from an
existing commit) changed it to use "git show -s $commit".  If
you have a file in your work tree that can be interpreted as a
valid object name (e.g. "HEAD"), this conversion will not work.

Disambiguate by marking the end of revision parameter on the
comand line with an explicit "--" to fix this.

This breakage is most visible with rebase when a file called
"HEAD" exists in the worktree.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoupload-pack: Initialize the exec-path.
Johannes Sixt [Tue, 12 Feb 2008 11:28:01 +0000 (12:28 +0100)]
upload-pack: Initialize the exec-path.

Since git-upload-pack has to spawn git-pack-objects, it has to make sure
that the latter can be found in the PATH. Without this patch an attempt
to clone or pull via ssh from a server fails if the git tools are not in
the standard PATH on the server even though git clone or git pull were
invoked with --upload-pack=/path/to/git-upload-pack.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobisect: use verbatim commit subject in the bisect log
Johannes Schindelin [Tue, 12 Feb 2008 19:50:57 +0000 (19:50 +0000)]
bisect: use verbatim commit subject in the bisect log

Due to a typo, the commit subject was shell expanded in the bisect log.
That is, if you had some shell pattern in the commit subject, bisect
would happily put all matching file names into the log.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Tested-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-cvsimport.txt: fix '-M' description.
Sergei Organov [Wed, 13 Feb 2008 14:31:17 +0000 (17:31 +0300)]
git-cvsimport.txt: fix '-M' description.

Fix '-M' description. Old one reads as if the user can somehow "see"
the default regex when using -M along with -m.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRevert "pack-objects: only throw away data during memory pressure"
Junio C Hamano [Wed, 13 Feb 2008 07:39:03 +0000 (23:39 -0800)]
Revert "pack-objects: only throw away data during memory pressure"

This reverts commit 9c2174350cc0ae0f6bad126e15fe1f9f044117ab.

Nico analyzed and found out that this does not really help, and
I agree with it.

By the time this gets into action and data is actively thrown
away, performance simply goes down the drain due to the data
constantly being reloaded over and over and over and over and
over and over again, to the point of virtually making no
relative progress at all.  The previous behavior of enforcing
the memory limit by dynamically shrinking the window size at
least had the effect of allowing some kind of progress, even if
the end result wouldn't be optimal.

And that's the whole point behind this memory limiting feature:
allowing some progress to be made when resources are too limited
to let the repack go unbounded.

16 years agoconfig.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 21:10:27 +0000 (13:10 -0800)]
config.c: guard config parser from value=NULL

user.{name,email}, core.{pager,editor,excludesfile,whitespace} and
i18n.{commit,logoutput}encoding all expect string values.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-log.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 21:09:16 +0000 (13:09 -0800)]
builtin-log.c: guard config parser from value=NULL

format.suffix expects a string value.  format.numbered is bool plus "auto"

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoimap-send.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 20:04:00 +0000 (12:04 -0800)]
imap-send.c: guard config parser from value=NULL

None of the configuration variables this expects is boolean.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agowt-status.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 19:00:57 +0000 (11:00 -0800)]
wt-status.c: guard config parser from value=NULL

status.color.* and color.status.* expect a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosetup.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 19:00:32 +0000 (11:00 -0800)]
setup.c: guard config parser from value=NULL

core.worktree expects a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoremote.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 19:00:10 +0000 (11:00 -0800)]
remote.c: guard config parser from value=NULL

branch.*.{remote,merge} expect a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomerge-recursive.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:59:17 +0000 (10:59 -0800)]
merge-recursive.c: guard config parser from value=NULL

merge.default, merge.*.{name,driver} expect a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agohttp.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:57:22 +0000 (10:57 -0800)]
http.c: guard config parser from value=NULL

http.sslcert and friends expect a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agohelp.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:56:26 +0000 (10:56 -0800)]
help.c: guard config parser from value=NULL

help.format configuration expects a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:56:06 +0000 (10:56 -0800)]
git.c: guard config parser from value=NULL

alias.* configuration expects a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:53:56 +0000 (10:53 -0800)]
diff.c: guard config parser from value=NULL

diff.external, diff.*.command, diff.color.*, color.diff.* and
diff.*.funcname configuration variables expect a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconvert.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:53:36 +0000 (10:53 -0800)]
convert.c: guard config parser from value=NULL

filter.*.smudge and filter.*.clean configuration variables expect a
string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconnect.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:52:15 +0000 (10:52 -0800)]
connect.c: guard config parser from value=NULL

core.gitproxy configuration expects a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-tag.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:51:31 +0000 (10:51 -0800)]
builtin-tag.c: guard config parser from value=NULL

user.signingkey configuration expects a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-show-branch.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:51:03 +0000 (10:51 -0800)]
builtin-show-branch.c: guard config parser from value=NULL

showbranch.default configuration expects a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-reflog.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:50:06 +0000 (10:50 -0800)]
builtin-reflog.c: guard config parser from value=NULL

gc.reflogexpire and gc.reflogexpireunreachable configuration expect
 a string value suitable for calling approxidate() with.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-log.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:48:55 +0000 (10:48 -0800)]
builtin-log.c: guard config parser from value=NULL

format.subjectprefix configuration expects a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-config.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:48:12 +0000 (10:48 -0800)]
builtin-config.c: guard config parser from value=NULL

color configuration variables expect a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:46:39 +0000 (10:46 -0800)]
builtin-commit.c: guard config parser from value=NULL

commit.template configuration expects a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-branch.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:45:50 +0000 (10:45 -0800)]
builtin-branch.c: guard config parser from value=NULL

color.branch.* configuration variables expect a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-apply.c: guard config parser from value=NULL
Junio C Hamano [Mon, 11 Feb 2008 18:44:49 +0000 (10:44 -0800)]
builtin-apply.c: guard config parser from value=NULL

apply.whitespace configuration expects a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd config_error_nonbool() helper function
Junio C Hamano [Mon, 11 Feb 2008 18:41:18 +0000 (10:41 -0800)]
Add config_error_nonbool() helper function

This is used to report misconfigured configuration file that does not
give any value to a non-boolean variable, e.g.

[section]
var

It is perfectly fine to say it if the section.var is a boolean (it means
true), but if a variable expects a string value it should be flagged as
a configuration error.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-gc.c: guard config parser from value=NULL
Miklos Vajna [Fri, 8 Feb 2008 14:26:18 +0000 (15:26 +0100)]
builtin-gc.c: guard config parser from value=NULL

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoarchive-tar.c: guard config parser from value=NULL
Junio C Hamano [Sat, 9 Feb 2008 04:38:22 +0000 (20:38 -0800)]
archive-tar.c: guard config parser from value=NULL

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoWork around curl-gnutls not liking to be reinitialized
Mike Hommey [Sat, 9 Feb 2008 09:41:36 +0000 (10:41 +0100)]
Work around curl-gnutls not liking to be reinitialized

curl versions 7.16.3 to 7.18.0 included had a regression in which https
requests following curl_global_cleanup/init sequence would fail with ASN1
parser errors with curl-gnutls. Such sequences happen in some cases such
as git fetch.

We work around this by removing the http_init and http_cleanup calls from
get_refs_via_curl, replacing them with a transport->data initialization
with the http_walker (which does http_init).

While the http_walker is not currently used in get_refs_via_curl, http
and walker code refactor will make it use it.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoman pages are littered with .ft C and others
Jonas Fonseca [Mon, 4 Feb 2008 22:01:20 +0000 (23:01 +0100)]
man pages are littered with .ft C and others

Jakub Narebski <jnareb@gmail.com> wrote Sun, Feb 03, 2008:
> Junio C Hamano wrote:
> > Jakub Narebski <jnareb@gmail.com> writes:
> >
> > [From] http://thread.gmane.org/gmane.comp.version-control.git/53457/focus=53458
> Julian Phillips:
> > Are you using docbook xsl 1.72?  There are known problems building the
> > manpages with that version.  1.71 works, and 1.73 should work when it get
> > released.

I was able to solve this problem with this patch, which adds a XSL file
used specifically for DOCBOOK_XSL_172=YesPlease and where dots and
backslashes are escaped properly so they won't be substituted to the
wrong thing further down the "DocBook XSL pipeline". Doing the escaping
in the existing callout.xsl breaks v1.70.1. Hopefully v1.73 will end
this part of the manpage nightmare.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd a BuildRequires for gettext in the spec file.
James Bowes [Mon, 4 Feb 2008 13:13:07 +0000 (08:13 -0500)]
Add a BuildRequires for gettext in the spec file.

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopack-objects: only throw away data during memory pressure
Martin Koegler [Mon, 11 Feb 2008 07:26:25 +0000 (08:26 +0100)]
pack-objects: only throw away data during memory pressure

If pack-objects hit the memory limit, it deletes objects from the delta
window.

This patch make it only delete the data, which is recomputed, if needed again.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: remove .git/SQUASH_MSG upon successful commit
Gerrit Pape [Fri, 8 Feb 2008 09:53:58 +0000 (09:53 +0000)]
builtin-commit: remove .git/SQUASH_MSG upon successful commit

After doing a merge --squash, and commit afterwards, the commit message
template SQUASH_MSG in the git directory is not removed, which means that
the content of SQUASH_MSG is used as default commit message for all
subsequent commits.  So have git commit remove the file SQUASH_MSG from
the git directory upon a successful commit.

The problem was discovered by Frédéric Brière, reported through
 http://bugs.debian.org/464656

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake git prune remove temporary packs that look like write failures
David Steven Tweed [Thu, 7 Feb 2008 02:55:14 +0000 (02:55 +0000)]
Make git prune remove temporary packs that look like write failures

Write errors when repacking (eg, due to out-of-space conditions)
can leave temporary packs (and possibly other files beginning
with "tmp_") lying around which no existing
codepath removes and which aren't obvious to the casual user.
These can also be multi-megabyte files wasting noticeable space.
Unfortunately there's no way to definitely tell in builtin-prune
that a tmp_ file is not being used by a concurrent process,
such as a fetch. However, it is documented that pruning should
only be done on a quiet repository and --expire is honoured
(using code from Johannes Schindelin, along with a test case
he wrote) so that its safety is the same as that of loose
object pruning.

Since they might be signs of a problem (unlike orphaned loose
objects) the names of any removed files are printed.

Signed-off-by: David Tweed (david.tweed@gmail.com)
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase -i: accept -m as advertised in the man page
Uwe Kleine-K\e,Av\e(Bnig [Mon, 11 Feb 2008 13:45:26 +0000 (14:45 +0100)]
rebase -i: accept -m as advertised in the man page

Signed-off-by: Uwe Kleine-K\e,Av\e(Bnig <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocument that the default of branch.autosetupmerge is true
Johannes Schindelin [Mon, 11 Feb 2008 11:27:20 +0000 (11:27 +0000)]
Document that the default of branch.autosetupmerge is true

In 34a3e69 (git-branch: default to --track) the default was changed to
true, to help new git users.  But yours truly forgot to update the
documentation.  This fixes it.

Noticed by Kalle Olavi Niemitalo.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobisect: allow starting with a detached HEAD
Johannes Schindelin [Sun, 10 Feb 2008 13:59:50 +0000 (13:59 +0000)]
bisect: allow starting with a detached HEAD

Instead of insisting on a symbolic ref, bisect now accepts detached
HEADs, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-pull documentation: fix markup
Junio C Hamano [Mon, 11 Feb 2008 19:22:01 +0000 (11:22 -0800)]
git-pull documentation: fix markup

A note paragraph was mistakenly made into an indented monospace display.
Noticed by Miklos Vajna.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconfig: Fix --unset for continuation lines
Frank Lichtenheld [Mon, 11 Feb 2008 00:23:03 +0000 (01:23 +0100)]
config: Fix --unset for continuation lines

find_beginning_of_line didn't take into account that the
previous line might have ended with \ in which case it shouldn't
stop but continue its search.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix typo in 'blame' documentation. v1.5.4.1
Tim Stoakes [Sun, 10 Feb 2008 04:19:08 +0000 (14:49 +1030)]
Fix typo in 'blame' documentation.

Signed-off-by: Tim Stoakes <tim@stoakes.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitattributes: fix relative path matching
Junio C Hamano [Thu, 7 Feb 2008 08:02:08 +0000 (00:02 -0800)]
gitattributes: fix relative path matching

There was an embarrassing pair of off-by-one miscounting that
failed to match path "a/b/c" when "a/.gitattributes" tried to
name it with relative path "b/c".

This fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix parsing numeric color values
Timo Hirvonen [Wed, 6 Feb 2008 12:16:08 +0000 (14:16 +0200)]
Fix parsing numeric color values

Numeric color only worked if it was at end of line.
Noticed by Chris Larson <clarson@kergoth.com>.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoINSTALL: git-merge no longer uses cpio
Gerrit Pape [Wed, 6 Feb 2008 07:03:53 +0000 (07:03 +0000)]
INSTALL: git-merge no longer uses cpio

Since a64d7784e830b3140e7d0f2b45cb3d8fafb84cca git merge doesn't use cpio
anymore, adapt the documentation.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-remote documentation: fix synopsis to match description
Jörg Sommer [Sat, 2 Feb 2008 23:58:07 +0000 (00:58 +0100)]
git-remote documentation: fix synopsis to match description

In the text, the argument of -m is <master> which should be used in the
command synopsis, too.

Signed-off-by: Jörg Sommer <joerg@alea.gnuu.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-am: fix type in its usage string
Jörg Sommer [Sat, 2 Feb 2008 23:58:06 +0000 (00:58 +0100)]
git-am: fix type in its usage string

Signed-off-by: Jörg Sommer <joerg@alea.gnuu.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix "git-commit -C $tag"
Junio C Hamano [Sun, 3 Feb 2008 08:00:09 +0000 (00:00 -0800)]
Fix "git-commit -C $tag"

The scripted version might not have handled this correctly
either, but the version rewritten in C definitely does not grok
this and complains $tag is not a commit object.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-stash.txt: Adjust SYNOPSIS command syntax (2)
Jari Aalto [Sat, 2 Feb 2008 14:03:48 +0000 (16:03 +0200)]
Documentation/git-stash.txt: Adjust SYNOPSIS command syntax (2)

Adjust the command syntax to better reflect the call parameters:
[save] [message...] => [save [<message>]].

Signed-off-by: Jari Aalto <jari.aalto AT cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate stale documentation links from the main documentation.
Junio C Hamano [Sat, 2 Feb 2008 04:40:30 +0000 (20:40 -0800)]
Update stale documentation links from the main documentation.

This could have been part of the 1.5.4 commit, but it isn't.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGIT 1.5.4 v1.5.4
Junio C Hamano [Sat, 2 Feb 2008 03:10:10 +0000 (19:10 -0800)]
GIT 1.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix "git checkout -b foo ':/substring'"
Junio C Hamano [Sat, 2 Feb 2008 03:06:56 +0000 (19:06 -0800)]
Fix "git checkout -b foo ':/substring'"

Because ':/substring' extended SHA1 expression cannot take
postfix modifiers such as ^{tree} and ^{commit}, we would need
to do it in multiple steps.  With the patch, you can start a new
branch from a randomly-picked commit whose message has the named
string in it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix typo in a comment in t/test-lib.sh
Michele Ballabio [Thu, 31 Jan 2008 21:59:11 +0000 (22:59 +0100)]
Fix typo in a comment in t/test-lib.sh

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit rev-parse manpage: spelling fix
Miklos Vajna [Thu, 31 Jan 2008 19:55:57 +0000 (20:55 +0100)]
git rev-parse manpage: spelling fix

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRevert "filter-branch docs: remove brackets so not to imply revision arg is optional"
Junio C Hamano [Thu, 31 Jan 2008 21:51:42 +0000 (13:51 -0800)]
Revert "filter-branch docs: remove brackets so not to imply revision arg is optional"

This reverts commit c41b439244c51b30c60953192816afc91e552578, as
we decided to default to HEAD when revision parameters are missing
and they are no longer mandatory.

16 years agoDocumentation/git-cvsserver: Fix typo
Jean-Luc Herren [Thu, 31 Jan 2008 02:06:04 +0000 (03:06 +0100)]
Documentation/git-cvsserver: Fix typo

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch: assume HEAD if no revision supplied
Brandon Casey [Wed, 30 Jan 2008 19:33:04 +0000 (13:33 -0600)]
filter-branch: assume HEAD if no revision supplied

filter-branch previously took the first non-option argument as the name for
a new branch. Since dfd05e38, it now takes a revision or a revision range
and modifies the current branch. Update to operate on HEAD by default to
conform with standard git interface practice.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch docs: remove brackets so not to imply revision arg is optional
Brandon Casey [Thu, 31 Jan 2008 00:41:25 +0000 (18:41 -0600)]
filter-branch docs: remove brackets so not to imply revision arg is optional

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUse 'printf %s $x' notation in t5401
Shawn O. Pearce [Wed, 30 Jan 2008 06:21:56 +0000 (01:21 -0500)]
Use 'printf %s $x' notation in t5401

We only care about getting what should be an empty string and
sending it to a file, without a trailing LF, so the empty string
translates into a 0 byte file.  Earlier when I originally wrote
these lines Mac OS X allowed the format string of printf to be
the empty string, but more recent versions appear to have been
'improved' with error messages if the format is not given.

This may cause problems if we ever wind up with changes to the hook
tests.  A minor cleanup makes the test more safe on all systems,
by conforming to accepted printf conventions.

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