git
14 years agoMerge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof
Junio C Hamano [Tue, 15 Sep 2009 18:20:46 +0000 (11:20 -0700)] 
Merge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof

* 'jc/maint-1.6.0-blank-at-eof' (early part):
  diff.c: emit_add_line() takes only the rest of the line
  diff.c: split emit_line() from the first char and the rest of the line

14 years agoMerge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof
Junio C Hamano [Tue, 15 Sep 2009 10:38:30 +0000 (03:38 -0700)] 
Merge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof

* 'jc/maint-1.6.0-blank-at-eof' (early part):
  diff.c: shuffling code around

14 years agoMerge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof
Junio C Hamano [Tue, 15 Sep 2009 10:28:08 +0000 (03:28 -0700)] 
Merge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof

* 'jc/maint-1.6.0-blank-at-eof' (early part):
  diff --whitespace: fix blank lines at end
  core.whitespace: split trailing-space into blank-at-{eol,eof}
  diff --color: color blank-at-eof
  diff --whitespace=warn/error: fix blank-at-eof check
  diff --whitespace=warn/error: obey blank-at-eof
  diff.c: the builtin_diff() deals with only two-file comparison
  apply --whitespace: warn blank but not necessarily empty lines at EOF
  apply --whitespace=warn/error: diagnose blank at EOF
  apply.c: split check_whitespace() into two
  apply --whitespace=fix: detect new blank lines at eof correctly
  apply --whitespace=fix: fix handling of blank lines at the eof

14 years agodiff -B: colour whitespace errors
Junio C Hamano [Tue, 15 Sep 2009 01:44:01 +0000 (18:44 -0700)] 
diff -B: colour whitespace errors

We used to send the old and new contents more or less straight out to the
output with only the original "old is red, new is green" colouring.  Now
all the necessary support routines have been prepared, call them with a
line of data at a time from the output code and have them check and color
whitespace errors in exactly the same way as they are called from the low
level diff callback routines.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff.c: emit_add_line() takes only the rest of the line
Junio C Hamano [Tue, 15 Sep 2009 01:44:01 +0000 (18:44 -0700)] 
diff.c: emit_add_line() takes only the rest of the line

As the first character on the line that is fed to this function is always
"+", it is pointless to send that along with the rest of the line.

This change will make it easier to reuse the logic when emitting the
rewrite diff, as we do not want to copy a line only to add "+"/"-"/" "
immediately before its first character when we produce rewrite diff
output.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff.c: split emit_line() from the first char and the rest of the line
Junio C Hamano [Tue, 15 Sep 2009 01:44:01 +0000 (18:44 -0700)] 
diff.c: split emit_line() from the first char and the rest of the line

A new helper function emit_line_0() takes the first line of diff output
(typically "-", " ", or "+") separately from the remainder of the line.
No other functional changes.

This change will make it easier to reuse the logic when emitting the
rewrite diff, as we do not want to copy a line only to add "+"/"-"/" "
immediately before its first character when we produce rewrite diff
output.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff.c: shuffling code around
Junio C Hamano [Tue, 15 Sep 2009 01:44:01 +0000 (18:44 -0700)] 
diff.c: shuffling code around

Move function, type, and structure definitions for fill_mmfile(),
count_trailing_blank(), check_blank_at_eof(), emit_line(),
new_blank_line_at_eof(), emit_add_line(), sane_truncate_fn, and
emit_callback up in the file, so that they can be refactored into helper
functions and reused by codepath for emitting rewrite patches.

This only moves the lines around to make the next two patches easier to
read.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff --whitespace: fix blank lines at end
Junio C Hamano [Tue, 15 Sep 2009 05:05:57 +0000 (22:05 -0700)] 
diff --whitespace: fix blank lines at end

The earlier logic tried to colour any and all blank lines that were added
beyond the last blank line in the original, but this was very wrong.  If
you added 96 blank lines, a non-blank line, and then 3 blank lines at the
end, only the last 3 lines should trigger the error, not the earlier 96
blank lines.

We need to also make sure that the lines are after the last non-blank line
in the postimage as well before deciding to paint them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Mon, 14 Sep 2009 21:48:27 +0000 (14:48 -0700)] 
Merge branch 'maint'

* maint:
  http.c: avoid freeing an uninitialized pointer

14 years agoMerge branch 'rc/maint-http-no-head-pack-check' into maint
Junio C Hamano [Mon, 14 Sep 2009 21:48:20 +0000 (14:48 -0700)] 
Merge branch 'rc/maint-http-no-head-pack-check' into maint

* rc/maint-http-no-head-pack-check:
  http.c: avoid freeing an uninitialized pointer

14 years agohttp.c: avoid freeing an uninitialized pointer
Junio C Hamano [Mon, 14 Sep 2009 21:48:15 +0000 (14:48 -0700)] 
http.c: avoid freeing an uninitialized pointer

An earlier 59b8d38 (http.c: remove verification of remote packs) left
the variable "url" uninitialized; "goto cleanup" codepath can free it
which is not very nice.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'master' into next
Junio C Hamano [Mon, 14 Sep 2009 09:29:27 +0000 (02:29 -0700)] 
Merge branch 'master' into next

* master:
  web--browse: fix Mac OS X GUI detection for 10.6
  remove logical typo in documentation of sample update hook
  Nicolas Pitre has a new email address
  git-archive: infer output format from filename when unspecified
  completion: Replace config --list with --get-regexp
  git-archive: add '-o' as a alias for '--output'
  test local clone by copying
  git-clone doc: typofix
  git-push: Accept -n as a synonym for --dry-run.
  git-commit doc: remove duplicated --dry-run description

Conflicts:
Documentation/git-commit.txt

14 years agoweb--browse: fix Mac OS X GUI detection for 10.6
Heiko Voigt [Mon, 14 Sep 2009 08:49:01 +0000 (10:49 +0200)] 
web--browse: fix Mac OS X GUI detection for 10.6

Since OS X 10.6 the variable $SECURITYSESSIONID does not exist anymore,
so lets look for the $TERM_PROGRAM variable as backup.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoremove logical typo in documentation of sample update hook
Heiko Voigt [Mon, 14 Sep 2009 08:47:06 +0000 (10:47 +0200)] 
remove logical typo in documentation of sample update hook

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoNicolas Pitre has a new email address
Nicolas Pitre [Mon, 14 Sep 2009 06:41:16 +0000 (02:41 -0400)] 
Nicolas Pitre has a new email address

Due to problems at cam.org, my nico@cam.org email address is no longer
valid.  From now on, nico@fluxnic.net should be used instead.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-archive: infer output format from filename when unspecified
Dmitry Potapov [Sun, 13 Sep 2009 20:17:01 +0000 (00:17 +0400)] 
git-archive: infer output format from filename when unspecified

A command line

    $ git archive -o my-v2.0.zip v2.0

almost certainly wants the output in zip format, even though it does not
specify any --format option.

When --format is not given, but output filename is, try to infer what
format is requested from the filename extension.  Currently this code only
knows about '.zip'.  When the format is unspecified and the filename does
not tell us, the output will be in 'tar' format as before.

Of course, an explicit --format will not trigger this guesswork.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocompletion: Replace config --list with --get-regexp
Todd Zullinger [Fri, 11 Sep 2009 23:23:45 +0000 (19:23 -0400)] 
completion: Replace config --list with --get-regexp

James Bardin noted that the completion spewed warnings when no git config
file is present.  This is likely a bug to be fixed in git config, but it's
also good to simplify the completion code by using the --get-regexp option
as Jeff King pointed out.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-archive: add '-o' as a alias for '--output'
Dmitry Potapov [Sun, 13 Sep 2009 12:05:52 +0000 (16:05 +0400)] 
git-archive: add '-o' as a alias for '--output'

The '-o' option is commonly used in many tools to specify the output file.
Typing '--output' every time is a bit too long to be a practical alternative
to redirecting output. But specifying the output name has the advantage of
making possible to guess the desired output format by filename extension.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotest local clone by copying
Clemens Buchacher [Sun, 13 Sep 2009 10:49:45 +0000 (12:49 +0200)] 
test local clone by copying

Test the effect of an earlier change by f7835a2 (preserve mtime of local
clone, 2009-09-12) to keep stale loose object files stale in the new
repository when a local clone is made by copying files in .git/
directory.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-clone doc: typofix
Johannes Gilger [Sun, 13 Sep 2009 13:35:05 +0000 (15:35 +0200)] 
git-clone doc: typofix

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-push: Accept -n as a synonym for --dry-run.
Nelson Elhage [Sun, 13 Sep 2009 16:56:45 +0000 (12:56 -0400)] 
git-push: Accept -n as a synonym for --dry-run.

git-push is not currently using -n for anything else, and it seems
unlikely we will want to use it to mean anything else in the future,
so add it as an alias for convenience.

Signed-off-by: Nelson Elhage <nelhage@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-commit doc: remove duplicated --dry-run description
Junio C Hamano [Sun, 13 Sep 2009 18:23:34 +0000 (11:23 -0700)] 
git-commit doc: remove duplicated --dry-run description

60c2993 (Documentation/git-commit.txt: describe --dry-run, 2009-08-15)
wanted to update the documentation to say that "git status" is not the
same as "git commit --dry-run" anymore, but it screwed up and also added
the description of --dry-run that was already present.

Noticed by Johannes Gilger.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'master' into next
Junio C Hamano [Sun, 13 Sep 2009 08:51:59 +0000 (01:51 -0700)] 
Merge branch 'master' into next

* master:
  GIT 1.6.5-rc1
  Improve --patch option documentation in git-add
  quiltimport documentation: --dry-run and -n are synonyms
  preserve mtime of local clone
  don't dereference NULL upon fdopen failure
  use write_str_in_full helper to avoid literal string lengths
  use write_str_in_full helper to avoid literal string lengths
  wrap git's main usage string.
  GIT 1.6.4.3
  svn: properly escape arguments for authors-prog
  http.c: remove verification of remote packs

14 years agoGIT 1.6.5-rc1 v1.6.5-rc1
Junio C Hamano [Sun, 13 Sep 2009 08:50:22 +0000 (01:50 -0700)] 
GIT 1.6.5-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoImprove --patch option documentation in git-add
Jari Aalto [Sun, 13 Sep 2009 06:43:10 +0000 (09:43 +0300)] 
Improve --patch option documentation in git-add

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'pk/fast-import-tars'
Junio C Hamano [Sun, 13 Sep 2009 08:33:29 +0000 (01:33 -0700)] 
Merge branch 'pk/fast-import-tars'

* pk/fast-import-tars:
  import-tars: Allow per-tar author and commit message.

14 years agoMerge branch 'pk/fast-import-dirs'
Junio C Hamano [Sun, 13 Sep 2009 08:33:26 +0000 (01:33 -0700)] 
Merge branch 'pk/fast-import-dirs'

* pk/fast-import-dirs:
  Add script for importing bits-and-pieces to Git.

14 years agoMerge branch 'jt/pushinsteadof'
Junio C Hamano [Sun, 13 Sep 2009 08:33:20 +0000 (01:33 -0700)] 
Merge branch 'jt/pushinsteadof'

* jt/pushinsteadof:
  Add url.<base>.pushInsteadOf: URL rewriting for push only
  Wrap rewrite globals in a struct in preparation for adding another set

14 years agoMerge branch 'jk/unwanted-advices'
Junio C Hamano [Sun, 13 Sep 2009 08:33:18 +0000 (01:33 -0700)] 
Merge branch 'jk/unwanted-advices'

* jk/unwanted-advices:
  status: make "how to stage" messages optional
  push: make non-fast-forward help message configurable

14 years agoMerge branch 'jc/merge-saner-messages'
Junio C Hamano [Sun, 13 Sep 2009 08:33:15 +0000 (01:33 -0700)] 
Merge branch 'jc/merge-saner-messages'

* jc/merge-saner-messages:
  merge-recursive: give less scary messages when merge did not start

14 years agoquiltimport documentation: --dry-run and -n are synonyms
Junio C Hamano [Sun, 13 Sep 2009 02:40:27 +0000 (19:40 -0700)] 
quiltimport documentation: --dry-run and -n are synonyms

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agopreserve mtime of local clone
Clemens Buchacher [Sat, 12 Sep 2009 09:03:48 +0000 (11:03 +0200)] 
preserve mtime of local clone

A local clone without hardlinks copies all objects, including dangling
ones, to the new repository. Since the mtimes are renewed, those
dangling objects cannot be pruned by "git gc --prune", even if they
would have been old enough for pruning in the original repository.

Instead, preserve mtime during copy. "git gc --prune" will then work
in the clone just like it did in the original.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodon't dereference NULL upon fdopen failure
Jim Meyering [Sat, 12 Sep 2009 08:43:27 +0000 (10:43 +0200)] 
don't dereference NULL upon fdopen failure

There were several unchecked use of fdopen(); replace them with xfdopen()
that checks and dies.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agouse write_str_in_full helper to avoid literal string lengths
Jim Meyering [Sat, 12 Sep 2009 08:54:32 +0000 (10:54 +0200)] 
use write_str_in_full helper to avoid literal string lengths

This is the same fix to use write_str_in_full() helper to write a constant
string out without counting the length of it ourselves.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'db/vcs-helper'
Junio C Hamano [Sun, 13 Sep 2009 08:31:55 +0000 (01:31 -0700)] 
Merge branch 'db/vcs-helper'

* db/vcs-helper:
  Makefile: remove remnant of separate http/https/ftp helpers
  Use a clearer style to issue commands to remote helpers
  Make the "traditionally-supported" URLs a special case
  Makefile: install hardlinks for git-remote-<scheme> supported by libcurl if possible
  Makefile: do not link three copies of git-remote-* programs
  Makefile: git-http-fetch does not need expat
  http-fetch: Fix Makefile dependancies
  Add transport native helper executables to .gitignore
  git-http-fetch: not a builtin
  Use an external program to implement fetching with curl
  Add support for external programs for handling native fetches

14 years agouse write_str_in_full helper to avoid literal string lengths
Jim Meyering [Sat, 12 Sep 2009 08:54:32 +0000 (10:54 +0200)] 
use write_str_in_full helper to avoid literal string lengths

In 2d14d65 (Use a clearer style to issue commands to remote helpers,
2009-09-03) I happened to notice two changes like this:

- write_in_full(helper->in, "list\n", 5);
+
+ strbuf_addstr(&buf, "list\n");
+ write_in_full(helper->in, buf.buf, buf.len);
+ strbuf_reset(&buf);

IMHO, it would be better to define a new function,

    static inline ssize_t write_str_in_full(int fd, const char *str)
    {
           return write_in_full(fd, str, strlen(str));
    }

and then use it like this:

-       strbuf_addstr(&buf, "list\n");
-       write_in_full(helper->in, buf.buf, buf.len);
-       strbuf_reset(&buf);
+       write_str_in_full(helper->in, "list\n");

Thus not requiring the added allocation, and still avoiding
the maintenance risk of literal string lengths.
These days, compilers are good enough that strlen("literal")
imposes no run-time cost.

Transformed via this:

    perl -pi -e \
        's/write_in_full\((.*?), (".*?"), \d+\)/write_str_in_full($1, $2)/'\
      $(git grep -l 'write_in_full.*"')

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowrap git's main usage string.
Matthieu Moy [Sat, 12 Sep 2009 10:39:30 +0000 (12:39 +0200)] 
wrap git's main usage string.

It's now similar wrapped the same way as in Documentation/git.txt, and
fits in a 67 characters wide terminal.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Sun, 13 Sep 2009 08:30:53 +0000 (01:30 -0700)] 
Merge branch 'maint'

* maint:
  GIT 1.6.4.3
  svn: properly escape arguments for authors-prog
  http.c: remove verification of remote packs
  grep: accept relative paths outside current working directory
  grep: fix exit status if external_grep() punts

Conflicts:
GIT-VERSION-GEN
RelNotes

14 years agoGIT 1.6.4.3 v1.6.4.3
Junio C Hamano [Sun, 13 Sep 2009 08:04:23 +0000 (01:04 -0700)] 
GIT 1.6.4.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agosvn: properly escape arguments for authors-prog
Mark Lodato [Sun, 13 Sep 2009 00:33:23 +0000 (20:33 -0400)] 
svn: properly escape arguments for authors-prog

Previously, the call to authors-prog was not properly escaped, so any
special characters in the Subversion username, such as spaces and
semi-colons, would be interpreted by the shell rather than being passed
in as the first argument.  Now all unsafe characters are escaped using
"git rev-parse --sq-quote"

[ew: switched from "\Q..\E" to "rev-parse --sq-quote"]

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'cb/maint-1.6.3-grep-relative-up' into maint
Junio C Hamano [Sun, 13 Sep 2009 08:24:20 +0000 (01:24 -0700)] 
Merge branch 'cb/maint-1.6.3-grep-relative-up' into maint

* cb/maint-1.6.3-grep-relative-up:
  grep: accept relative paths outside current working directory
  grep: fix exit status if external_grep() punts

Conflicts:
t/t7002-grep.sh

14 years agoSelftests verifying semantics when loading notes trees with various fanouts
Johan Herland [Sat, 12 Sep 2009 16:08:46 +0000 (18:08 +0200)] 
Selftests verifying semantics when loading notes trees with various fanouts

Add selftests verifying:
- that we are able to parse notes trees with various fanout schemes
- that notes trees with conflicting fanout schemes are parsed as expected

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoTeach the notes lookup code to parse notes trees with various fanout schemes
Johan Herland [Sat, 12 Sep 2009 16:08:45 +0000 (18:08 +0200)] 
Teach the notes lookup code to parse notes trees with various fanout schemes

The semantics used when parsing notes trees (with regards to fanout subtrees)
follow Dscho's proposal fairly closely:
- No concatenation/merging of notes is performed. If there are several notes
  objects referencing a given commit, only one of those objects are used.
- If a notes object for a given commit is present in the "root" notes tree,
  no subtrees are consulted; the object in the root tree is used directly.
- If there are more than one subtree that prefix-matches the given commit,
  only the subtree with the longest matching prefix is consulted. This
  means that if the given commit is e.g. "deadbeef", and the notes tree have
  subtrees "de" and "dead", then the following paths in the notes tree are
  searched: "deadbeef", "dead/beef". Note that "de/adbeef" is NOT searched.
- Fanout directories (subtrees) must references a whole number of bytes
  from the SHA1 sum they subdivide. E.g. subtrees "dead" and "de" are
  acceptable; "d" and "dea" are not.
- Multiple levels of fanout are allowed. All the above rules apply
  recursively. E.g. "de/adbeef" is preferred over "de/adbe/ef", etc.

This patch changes the in-memory datastructure for holding parsed notes:
Instead of holding all note (and subtree) entries in a hash table, a
simple 16-tree structure is used instead. The tree structure consists of
16-arrays as internal nodes, and note/subtree entries as leaf nodes. The
tree is traversed by indexing subsequent nibbles of the search key until
a leaf node is encountered. If a subtree entry is encountered while
searching for a note, the subtree is unpacked into the 16-tree structure,
and the search continues into that subtree.

The new algorithm performs significantly better in the cases where only
a fraction of the notes need to be looked up (this is assumed to be the
common case for notes lookup). The new code even performs marginally
better in the worst case (where _all_ the notes are looked up).

In addition to this, comes the massive performance win associated with
organizing the notes tree according to some fanout scheme. Even a simple
2/38 fanout scheme is dramatically quicker to traverse (going from tens of
seconds to sub-second runtimes).

As for memory usage, the new code is marginally better than the old code in
the worst case, but in the case of looking up only some notes from a notes
tree with proper fanout, the new code uses only a small fraction of the
memory needed to hold the entire notes tree.

However, there is one casualty of this patch. The old notes lookup code was
able to parse notes that were associated with non-SHA1s (e.g. refs). The new
code requires the referenced object to be named by a SHA1 sum. Still, this
is not considered a major setback, since the notes infrastructure was not
originally intended to annotate objects outside the Git object database.

Cc: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agonotes.[ch] fixup: avoid old-style declaration
Junio C Hamano [Sat, 12 Sep 2009 18:34:24 +0000 (11:34 -0700)] 
notes.[ch] fixup: avoid old-style declaration

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoTeach notes code to free its internal data structures on request.
Johan Herland [Sat, 12 Sep 2009 16:08:44 +0000 (18:08 +0200)] 
Teach notes code to free its internal data structures on request.

There's no need to be rude to memory-concious callers...

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd '%N'-format for pretty-printing commit notes
Johannes Schindelin [Sat, 12 Sep 2009 16:08:43 +0000 (18:08 +0200)] 
Add '%N'-format for pretty-printing commit notes

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd flags to get_commit_notes() to control the format of the note string
Johan Herland [Sat, 12 Sep 2009 16:08:42 +0000 (18:08 +0200)] 
Add flags to get_commit_notes() to control the format of the note string

This patch adds the following flags to get_commit_notes() for adjusting the
format of the produced note string:
- NOTES_SHOW_HEADER: Print "Notes:" line before the notes contents
- NOTES_INDENT: Indent notes contents by 4 spaces

Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot3302-notes-index-expensive: Speed up create_repo()
Johan Herland [Sat, 12 Sep 2009 16:08:41 +0000 (18:08 +0200)] 
t3302-notes-index-expensive: Speed up create_repo()

Creating repos with 10/100/1000/10000 commits and notes takes a lot of time.
However, using git-fast-import to do the job is a lot more efficient than
using plumbing commands to do the same.

This patch decreases the overall run-time of this test on my machine from
~3 to ~1 minutes.

Signed-off-by: Johan Herland <johan@herland.net>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: Add support for importing commit notes
Johan Herland [Sat, 12 Sep 2009 16:08:40 +0000 (18:08 +0200)] 
fast-import: Add support for importing commit notes

Introduce a 'notemodify' subcommand of the 'commit' command. This subcommand
is similar to 'filemodify', except that no mode is supplied (all notes have
mode 0644), and the path is set to the hex SHA1 of the given "comittish".

This enables fast import of note objects along with their associated commits,
since the notes can now be named using the mark references of their
corresponding commits.

The patch also includes a test case of the added functionality.

Signed-off-by: Johan Herland <johan@herland.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoTeach "-m <msg>" and "-F <file>" to "git notes edit"
Johan Herland [Sat, 12 Sep 2009 16:08:39 +0000 (18:08 +0200)] 
Teach "-m <msg>" and "-F <file>" to "git notes edit"

The "-m" and "-F" options are already the established method
(in both git-commit and git-tag) to specify a commit/tag message
without invoking the editor. This patch teaches "git notes edit"
to respect the same options for specifying a notes message without
invoking the editor.

Multiple "-m" and/or "-F" options are concatenated as separate
paragraphs.

The patch also updates the "git notes" documentation and adds
selftests for the new functionality. Unfortunately, the added
selftests include a couple of lines with trailing whitespace
(without these the test will fail). This may cause git to warn
about "whitespace errors".

This patch has been improved by the following contributions:
- Thomas Rast: fix trailing whitespace in t3301

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd an expensive test for git-notes
Johannes Schindelin [Sat, 12 Sep 2009 16:08:38 +0000 (18:08 +0200)] 
Add an expensive test for git-notes

git-notes have the potential of being pretty expensive, so test with
a lot of commits.  A lot.  So to make things cheaper, you have to
opt-in explicitely, by setting the environment variable
GIT_NOTES_TIMING_TESTS.

This patch has been improved by the following contributions:
- Junio C Hamano: tests: fix "export var=val"

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoSpeed up git notes lookup
Johannes Schindelin [Sat, 12 Sep 2009 16:08:37 +0000 (18:08 +0200)] 
Speed up git notes lookup

To avoid looking up each and every commit in the notes ref's tree
object, which is very expensive, speed things up by slurping the tree
object's contents into a hash_map.

The idea for the hashmap singleton is from David Reiss, initial
benchmarking by Jeff King.

Note: the implementation allows for arbitrary entries in the notes
tree object, ignoring those that do not reference a valid object.  This
allows you to annotate arbitrary branches, or objects.

This patch has been improved by the following contributions:
- Junio C Hamano: fixed an obvious error in initialize_hash_map()

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd a script to edit/inspect notes
Johannes Schindelin [Sat, 12 Sep 2009 16:08:36 +0000 (18:08 +0200)] 
Add a script to edit/inspect notes

The script 'git notes' allows you to edit and show commit notes, by
calling either

git notes show <commit>

or

git notes edit <commit>

This patch has been improved by the following contributions:
- Tor Arne Vestbø: fix printing of multi-line notes
- Michael J Gruber: test and handle empty notes gracefully
- Thomas Rast:
  - only clean up message file when editing
  - use GIT_EDITOR and core.editor over VISUAL/EDITOR
  - t3301: fix confusing quoting in test for valid notes ref
  - t3301: use test_must_fail instead of !
  - refuse to edit notes outside refs/notes/
- Junio C Hamano: tests: fix "export var=val"
- Christian Couder: documentation: fix 'linkgit' macro in "git-notes.txt"
- Johan Herland: minor cleanup and bugfixing in git-notes.sh (v2)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Tor Arne Vestbø <tavestbo@trolltech.com>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoIntroduce commit notes
Johannes Schindelin [Sat, 12 Sep 2009 16:08:35 +0000 (18:08 +0200)] 
Introduce commit notes

Commit notes are blobs which are shown together with the commit
message.  These blobs are taken from the notes ref, which you can
configure by the config variable core.notesRef, which in turn can
be overridden by the environment variable GIT_NOTES_REF.

The notes ref is a branch which contains "files" whose names are
the names of the corresponding commits (i.e. the SHA-1).

The rationale for putting this information into a ref is this: we
want to be able to fetch and possibly union-merge the notes,
maybe even look at the date when a note was introduced, and we
want to store them efficiently together with the other objects.

This patch has been improved by the following contributions:
- Thomas Rast: fix core.notesRef documentation
- Tor Arne Vestbø: fix printing of multi-line notes
- Alex Riesen: Using char array instead of char pointer costs less BSS

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Tor Arne Vestbø <tavestbo@trolltech.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jk/unwanted-advices' into next
Junio C Hamano [Sat, 12 Sep 2009 05:52:37 +0000 (22:52 -0700)] 
Merge branch 'jk/unwanted-advices' into next

* jk/unwanted-advices:
  status: make "how to stage" messages optional
  push: make non-fast-forward help message configurable

14 years agoMerge branch 'db/vcs-helper' (early part) into next
Junio C Hamano [Sat, 12 Sep 2009 05:52:36 +0000 (22:52 -0700)] 
Merge branch 'db/vcs-helper' (early part) into next

* 'db/vcs-helper' (early part):
  Makefile: remove remnant of separate http/https/ftp helpers

14 years agoMerge branch 'master' into next
Junio C Hamano [Sat, 12 Sep 2009 05:52:31 +0000 (22:52 -0700)] 
Merge branch 'master' into next

* master:
  rebase: use plumbing to show dirty state
  pager: set LESS=FRSX also on Windows
  start_command: do not clobber cmd->env on Windows code path

14 years agoMakefile: remove remnant of separate http/https/ftp helpers
Junio C Hamano [Sat, 12 Sep 2009 05:35:30 +0000 (22:35 -0700)] 
Makefile: remove remnant of separate http/https/ftp helpers

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorebase: use plumbing to show dirty state
Jeff King [Wed, 9 Sep 2009 14:59:37 +0000 (10:59 -0400)] 
rebase: use plumbing to show dirty state

Commit 4cfbe06 introduced the use of "git diff" to show
dirty state in a format more familiar to users. However, it
should have used the plumbing "git diff-files" instead.

Not only is it good practice in general to use plumbing in
scripts, but in this case we really don't want the automatic
pager to kick in for an error message.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agostatus: make "how to stage" messages optional
Jeff King [Wed, 9 Sep 2009 11:43:03 +0000 (07:43 -0400)] 
status: make "how to stage" messages optional

These messages are nice for new users, but experienced git
users know how to manipulate the index, and these messages
waste a lot of screen real estate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agopush: make non-fast-forward help message configurable
Jeff King [Wed, 9 Sep 2009 11:38:58 +0000 (07:38 -0400)] 
push: make non-fast-forward help message configurable

This message is designed to help new users understand what
has happened when refs fail to push. However, it does not
help experienced users at all, and significantly clutters
the output, frequently dwarfing the regular status table and
making it harder to see.

This patch introduces a general configuration mechanism for
optional messages, with this push message as the first
example.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agopager: set LESS=FRSX also on Windows
Johannes Sixt [Fri, 11 Sep 2009 17:45:07 +0000 (19:45 +0200)] 
pager: set LESS=FRSX also on Windows

Previously, this environment variable was set in the pager_preexec
callback, which is conditionally-compiled only on Unix, because it is not,
and cannot be, called on Windows.

With this patch the env member of struct child_process is used to set
the environment variable, which also works on Windows.

Noticed by Alexey Borzenkov.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agostart_command: do not clobber cmd->env on Windows code path
Johannes Sixt [Fri, 11 Sep 2009 17:40:08 +0000 (19:40 +0200)] 
start_command: do not clobber cmd->env on Windows code path

Previously, it would not be possible to call start_command twice for the
same struct child_process that has env set.

The fix is achieved by moving the loop that modifies the environment block
into a helper function. This also allows us to make two other helper
functions static.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohttp.c: remove verification of remote packs
Tay Ray Chuan [Wed, 9 Sep 2009 12:33:50 +0000 (20:33 +0800)] 
http.c: remove verification of remote packs

Make http.c::fetch_pack_index() no longer check for the remote pack
with a HEAD request before fetching the corresponding pack index file.

Not only does sending a HEAD request before we do a GET incur a
performance penalty, it does not offer any significant error-
prevention advantages (pack fetching in the *_http_pack_request()
methods is capable of handling any errors on its own).

This addresses an issue raised elsewhere:

  http://code.google.com/p/msysgit/issues/detail?id=323
  http://support.github.com/discussions/repos/957-cant-clone-over-http-or-git

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jc/merge-saner-messages' into next
Junio C Hamano [Fri, 11 Sep 2009 08:00:04 +0000 (01:00 -0700)] 
Merge branch 'jc/merge-saner-messages' into next

* jc/merge-saner-messages:
  merge-recursive: give less scary messages when merge did not start

14 years agoMerge branch 'jt/pushinsteadof' into next
Junio C Hamano [Fri, 11 Sep 2009 08:00:04 +0000 (01:00 -0700)] 
Merge branch 'jt/pushinsteadof' into next

* jt/pushinsteadof:
  Add url.<base>.pushInsteadOf: URL rewriting for push only
  Wrap rewrite globals in a struct in preparation for adding another set

14 years agoMerge branch 'db/vcs-helper' (early part) into next
Junio C Hamano [Fri, 11 Sep 2009 08:00:03 +0000 (01:00 -0700)] 
Merge branch 'db/vcs-helper' (early part) into next

* 'db/vcs-helper' (early part):
  Use a clearer style to issue commands to remote helpers
  Make the "traditionally-supported" URLs a special case

14 years agoMerge branch 'master' into next
Junio C Hamano [Fri, 11 Sep 2009 07:59:59 +0000 (00:59 -0700)] 
Merge branch 'master' into next

* master:
  add documentation for mailinfo.scissors and '--no-scissors'
  mailinfo: add '--scissors' to usage message
  INSTALL: Describe dependency knobs from Makefile
  INSTALL: Reorder dependencies, split shell and Perl
  git-p4: Avoid modules deprecated in Python 2.6.
  Makefile: Add NEEDS_CRYPTO_WITH_SSL
  git.el: Use git-add-file for unmerged files, remove git-resolve-file
  INSTALL: Update description of our SHA-1 code

14 years agoadd documentation for mailinfo.scissors and '--no-scissors'
Nicolas Sebrecht [Fri, 11 Sep 2009 00:29:58 +0000 (02:29 +0200)] 
add documentation for mailinfo.scissors and '--no-scissors'

Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomailinfo: add '--scissors' to usage message
Nicolas Sebrecht [Fri, 11 Sep 2009 00:09:20 +0000 (02:09 +0200)] 
mailinfo: add '--scissors' to usage message

Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoINSTALL: Describe dependency knobs from Makefile
Brian Gernhardt [Thu, 10 Sep 2009 20:28:19 +0000 (16:28 -0400)] 
INSTALL: Describe dependency knobs from Makefile

We said that some of our dependencies were optional, but didn't say
how to turn them off.  Add information for that and mention where to
save the options close to the top of the file.

Also, standardize on both using quotes for the names of the dependencies
and tabs for indentation of the list.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoINSTALL: Reorder dependencies, split shell and Perl
Brian Gernhardt [Wed, 9 Sep 2009 01:51:00 +0000 (21:51 -0400)] 
INSTALL: Reorder dependencies, split shell and Perl

The most important and non-optional dependencies should go first, so put
them there.  While we're moving them, the descriptions for shell and perl
were archaic, referring to "bare-bones Porcelainish scripts" that have
become powerful and essential.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-p4: Avoid modules deprecated in Python 2.6.
Reilly Grant [Thu, 10 Sep 2009 07:02:38 +0000 (00:02 -0700)] 
git-p4: Avoid modules deprecated in Python 2.6.

The popen2, sha and sets modules are deprecated in Python 2.6 (sha in
Python 2.5).  Both popen2 and sha are not actually used in git-p4.
Replace usage of sets.Set with the builtin set object.

The built-in set object was added in Python 2.4 and is already used in
other parts of this script, so this dependency is nothing new.

Signed-off-by: Reilly Grant <reillyeon@qotw.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: Add NEEDS_CRYPTO_WITH_SSL
Brian Gernhardt [Tue, 8 Sep 2009 13:54:38 +0000 (09:54 -0400)] 
Makefile: Add NEEDS_CRYPTO_WITH_SSL

The Makefile comment for NEEDS_SSL_WITH_CRYPTO says to define it "if
you need -lcrypto with -lssl (Darwin)."  However, what it actually
does is add -lssl when you use -lcrypto and not the other way around.
However, libcrypto contains a majority of the ERR_* functions from
OpenSSL (at least on OS X) so we need it both ways.

So, add NEEDS_CRYPTO_WITH_SSL which adds -lcrypto to the OpenSSL link
flags and clarify the difference between it and NEEDS_SSL_WITH_CRYPTO.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitk: Show diff of commits at end of compare-commits output
Paul Mackerras [Mon, 7 Sep 2009 00:08:21 +0000 (10:08 +1000)] 
gitk: Show diff of commits at end of compare-commits output

When comparing a string of commits, when we find two non-merge commits
that differ, we now write the two commits to files and diff the files.
This pulls out the logic for creating a temporary directory from
external_diff into a separate procedure so that the new diffcommits
procedure can use it.

Because the diff command returns an exit status of 1 when the files
differ, and Tcl treats that as an error, this adds catch {} around the
close statements in getblobdiffline.

At present this only removes the temporary files when gitk exits.  It
should remove them when the diff is done.

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogit.el: Use git-add-file for unmerged files, remove git-resolve-file
Martin Nordholts [Thu, 3 Sep 2009 20:27:24 +0000 (22:27 +0200)] 
git.el: Use git-add-file for unmerged files, remove git-resolve-file

Use `git-add-file' to mark unmerged files as resolved in the
*git-status* buffer to be consistent with git's CLI instructions. Also
remove `git-resolve-file' to make it clear that that "R" is a now a
free keybinding.

Signed-off-by: Martin Nordholts <martinn@src.gnome.org>
Acked-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoINSTALL: Update description of our SHA-1 code
Brian Gernhardt [Wed, 9 Sep 2009 01:50:59 +0000 (21:50 -0400)] 
INSTALL: Update description of our SHA-1 code

We haven't had Mozilla's code or an ARM optimized algorithm since
30ae47b.  Reword the paragraph to give credit but not authorship to
Mozilla.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge-recursive: give less scary messages when merge did not start
Junio C Hamano [Tue, 8 Sep 2009 05:43:11 +0000 (22:43 -0700)] 
merge-recursive: give less scary messages when merge did not start

When unpack_trees() three-way merge logic is called from merge-recursive
and finds that local changes are going to be clobbered, its plumbing level
messages were given as errors first, and then the merge driver added even
more scary message "fatal: merging of trees <a long object name> and
<another long object name> failed".

This is most often encountered by new CVS/SVN migrants who are used to
start a merge from a dirty work tree.  The saddest part is that the merge
refused to run to prevent _any_ damage from being done to your work tree
when these messages are given, but the messages look a lot more scarier
than the conflicted case where the user needs to resolve them.

Replace the plumbing level messages so that they talk about what it is
protecting the user from, and end the messages with "Aborting." so that it
becomes clear that the command did not do any harm.

The final "merging of trees failed" message is superfluous, unless you are
interested in debugging the merge-recursive itself.  Squelch the current
die() message by default, but allow it to help people who debug git with
verbosity level 4 or greater.

Unless there is some bug, an inner merge that does not touch working tree
should not trigger any such error, so emit the current die() message when
we see an error return from it while running the inner merge, too.  It
would also help people who debug git.

We could later add instructions on how to recover (i.e. "stash changes
away or commit on a side branch and retry") instead of the silent
exit(128) I have in this patch, and then use Peff's advice.* mechanism to
squelch it (e.g. "advice.mergeindirtytree"), but they are separate topics.

Tested-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd url.<base>.pushInsteadOf: URL rewriting for push only
Josh Triplett [Mon, 7 Sep 2009 08:56:33 +0000 (01:56 -0700)] 
Add url.<base>.pushInsteadOf: URL rewriting for push only

This configuration option allows systematically rewriting fetch-only URLs
to push-capable URLs when used with push.  For instance:

[url "ssh://example.org/"]
    pushInsteadOf = "git://example.org/"

This will allow clones of "git://example.org/path/to/repo" to subsequently
push to "ssh://example.org/path/to/repo", without manually configuring
pushurl for that remote.

Includes documentation for the new option, bash completion updates, and
test cases (both that pushInsteadOf applies to push, that it does not
apply to fetch, and that it is ignored when pushURL is already defined).

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'sr/gfi-options' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:20 +0000 (17:21 -0700)] 
Merge branch 'sr/gfi-options' into next

* sr/gfi-options:
  fast-import: test the new option command
  fast-import: add option command
  fast-import: test the new feature command
  fast-import: add feature command
  fast-import: put marks reading in it's own function
  fast-import: put option parsing code in separate functions

14 years agoMerge branch 'jn/gitweb-blame' (early part) into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:20 +0000 (17:21 -0700)] 
Merge branch 'jn/gitweb-blame' (early part) into next

* 'jn/gitweb-blame' (early part):
  gitweb: Colorize 'blame_incremental' view during processing
  gitweb: Incremental blame (using JavaScript)
  gitweb: Add optional "time to generate page" info in footer

14 years agoMerge branch 'pk/fast-import-dirs' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'pk/fast-import-dirs' into next

* pk/fast-import-dirs:
  Add script for importing bits-and-pieces to Git.

14 years agoMerge branch 'jc/maint-1.6.0-blank-at-eof' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'jc/maint-1.6.0-blank-at-eof' into next

* jc/maint-1.6.0-blank-at-eof:
  core.whitespace: split trailing-space into blank-at-{eol,eof}
  diff --color: color blank-at-eof
  diff --whitespace=warn/error: fix blank-at-eof check
  diff --whitespace=warn/error: obey blank-at-eof
  diff.c: the builtin_diff() deals with only two-file comparison
  apply --whitespace: warn blank but not necessarily empty lines at EOF
  apply --whitespace=warn/error: diagnose blank at EOF
  apply.c: split check_whitespace() into two
  apply --whitespace=fix: detect new blank lines at eof correctly
  apply --whitespace=fix: fix handling of blank lines at the eof

Conflicts:
diff.c
t/t4124-apply-ws-rule.sh
ws.c

14 years agoMerge branch 'pk/fast-import-tars' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'pk/fast-import-tars' into next

* pk/fast-import-tars:
  import-tars: Allow per-tar author and commit message.

14 years agoMerge branch 'jk/1.7.0-status' (early part) into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'jk/1.7.0-status' (early part) into next

* 'jk/1.7.0-status' (early part):
  commit: support alternate status formats
  status: add --porcelain output format
  status: refactor format option parsing
  status: refactor short-mode printing to its own function

14 years agoMerge branch 'cb/maint-1.6.3-grep-relative-up' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'cb/maint-1.6.3-grep-relative-up' into next

* cb/maint-1.6.3-grep-relative-up:
  grep: accept relative paths outside current working directory
  grep: fix exit status if external_grep() punts

Conflicts:
t/t7002-grep.sh

14 years agoMerge branch 'master' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:18 +0000 (17:21 -0700)] 
Merge branch 'master' into next

* master:
  GIT 1.6.5-rc0
  git-pull: do not mention --quiet and --verbose twice
  githooks.txt: put hooks into subsections

14 years agoGIT 1.6.5-rc0 v1.6.5-rc0
Junio C Hamano [Tue, 8 Sep 2009 00:20:02 +0000 (17:20 -0700)] 
GIT 1.6.5-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Mon, 7 Sep 2009 22:45:48 +0000 (15:45 -0700)] 
Merge branch 'maint'

* maint:
  git-pull: do not mention --quiet and --verbose twice
  githooks.txt: put hooks into subsections

14 years agogit-pull: do not mention --quiet and --verbose twice
Emmanuel Trillaud [Mon, 7 Sep 2009 12:34:35 +0000 (14:34 +0200)] 
git-pull: do not mention --quiet and --verbose twice

git-pull.txt includes fetch-options.txt and merge-options.txt, both of
which document the --quiet and --verbose.

Supress the ones from fetch-options.txt.

Signed-off-by: Emmanuel Trillaud <etrillaud@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogithooks.txt: put hooks into subsections
Bert Wesarg [Sun, 6 Sep 2009 10:22:58 +0000 (12:22 +0200)] 
githooks.txt: put hooks into subsections

All hooks are currently in its own section. Which may confuse users,
because the section name serves as the hook file name and sections are
all caps for man pages. Putting them into a new HOOKS section and each
hook into a subsection keeps the case to lower case.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jc/mailinfo-scissors'
Junio C Hamano [Mon, 7 Sep 2009 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'jc/mailinfo-scissors'

* jc/mailinfo-scissors:
  mailinfo.scissors: new configuration
  am/mailinfo: Disable scissors processing by default
  Documentation: describe the scissors mark support of "git am"
  Teach mailinfo to ignore everything before -- >8 -- mark
  builtin-mailinfo.c: fix confusing internal API to mailinfo()

14 years agoMerge branch 'jk/clone-b'
Junio C Hamano [Mon, 7 Sep 2009 22:24:53 +0000 (15:24 -0700)] 
Merge branch 'jk/clone-b'

* jk/clone-b:
  clone: add --branch option to select a different HEAD

14 years agoMerge branch 'jc/upload-pack-hook'
Junio C Hamano [Mon, 7 Sep 2009 22:24:47 +0000 (15:24 -0700)] 
Merge branch 'jc/upload-pack-hook'

* jc/upload-pack-hook:
  upload-pack: feed "kind [clone|fetch]" to post-upload-pack hook
  upload-pack: add a trigger for post-upload-pack hook

14 years agoMerge branch 'tr/reset-checkout-patch'
Junio C Hamano [Mon, 7 Sep 2009 22:24:38 +0000 (15:24 -0700)] 
Merge branch 'tr/reset-checkout-patch'

* tr/reset-checkout-patch:
  stash: simplify defaulting to "save" and reject unknown options
  Make test case number unique
  tests: disable interactive hunk selection tests if perl is not available
  DWIM 'git stash save -p' for 'git stash -p'
  Implement 'git stash save --patch'
  Implement 'git checkout --patch'
  Implement 'git reset --patch'
  builtin-add: refactor the meat of interactive_add()
  Add a small patch-mode testing library
  git-apply--interactive: Refactor patch mode code
  Make 'git stash -k' a short form for 'git stash save --keep-index'

14 years agoMerge branch 'np/maint-1.6.3-deepen'
Junio C Hamano [Mon, 7 Sep 2009 22:23:50 +0000 (15:23 -0700)] 
Merge branch 'np/maint-1.6.3-deepen'

* np/maint-1.6.3-deepen:
  pack-objects: free preferred base memory after usage
  make shallow repository deepening more network efficient

14 years agogrep: accept relative paths outside current working directory
Clemens Buchacher [Sat, 5 Sep 2009 12:31:17 +0000 (14:31 +0200)] 
grep: accept relative paths outside current working directory

"git grep" would barf at relative paths pointing outside the current
working directory (or subdirectories thereof). Use quote_path_relative(),
which can handle such cases just fine.

[jc: added tests.]

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogrep: fix exit status if external_grep() punts
Clemens Buchacher [Mon, 7 Sep 2009 08:48:01 +0000 (10:48 +0200)] 
grep: fix exit status if external_grep() punts

If external_grep() is called and punts, grep_cache() mistakenly reported a
hit, even if there were none.  The bug can be triggered by calling "git
grep --no-color" from a subdirectory.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoWrap rewrite globals in a struct in preparation for adding another set
Josh Triplett [Mon, 7 Sep 2009 08:56:00 +0000 (01:56 -0700)] 
Wrap rewrite globals in a struct in preparation for adding another set

remote.c has a global set of URL rewrites, accessed by alias_url and
make_rewrite.  Wrap them in a new "struct rewrites", passed to alias_url
and make_rewrite.  This allows adding other sets of rewrites.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: test the new option command
Sverre Rabbelier [Sun, 6 Sep 2009 14:35:48 +0000 (16:35 +0200)] 
fast-import: test the new option command

Test three options (quiet and import/export-marks) and verify that the
commandline options override these.

Also make sure that a option command without a preceeding feature
git-options command is rejected and that non-git options are ignored.

Lastly, make sure that git options that we do not recognise are
ignored as well, but that they are rejected when parsed on the
commandline.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>