]> asedeno.scripts.mit.edu Git - git.git/log
git.git
15 years agoMerge branch 'maint-1.6.1' into maint-1.6.2
Junio C Hamano [Sun, 24 May 2009 22:29:23 +0000 (15:29 -0700)]
Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:
  http-push.c::remove_locks(): fix use after free

15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Sun, 24 May 2009 22:29:13 +0000 (15:29 -0700)]
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  http-push.c::remove_locks(): fix use after free

15 years agoapply: handle filenames with double slashes better
Michal Marek [Thu, 21 May 2009 12:25:11 +0000 (14:25 +0200)]
apply: handle filenames with double slashes better

When there are duplicated slashes in pathnames, like this:

--- a/perl//Git.pm
+++ b/perl//Git.pm
@@ -1358,3 +1358,4 @@

 1; # Famous last words
+# test

the paths gleaned from the patch header won't be found in the index and
cause "apply --index" and "apply --cached" to fail.

Fix this by squashing the duplicated slashes upon input.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agohttp-push.c::remove_locks(): fix use after free
Alex Riesen [Sun, 24 May 2009 13:16:49 +0000 (15:16 +0200)]
http-push.c::remove_locks(): fix use after free

Noticed and reported by Serhat Şevki Dinçer.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot/t3400-rebase.sh: add more tests to help migrating git-rebase.sh to C
Nguyễn Thái Ngọc Duy [Sat, 23 May 2009 15:31:02 +0000 (01:31 +1000)]
t/t3400-rebase.sh: add more tests to help migrating git-rebase.sh to C

These new tests make sure I don't miss any check being performed before
rebase is proceeded (which is well tested by other tests)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: fix word-regexp at the beginning of lines
René Scharfe [Sat, 23 May 2009 11:45:26 +0000 (13:45 +0200)]
grep: fix word-regexp at the beginning of lines

After bol is forwarded, it doesn't represent the beginning of the line
any more.  This means that the beginning-of-line marker (^) mustn't match,
i.e. the regex flag REG_NOTBOL needs to be set.

This bug was introduced by fb62eb7fab97cea880ea7fe4f341a4dfad14ab48
("grep -w: forward to next possible position after rejected match").

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapply, fmt-merge-msg: use relative filenames
Stephen Boyd [Sat, 23 May 2009 18:53:11 +0000 (11:53 -0700)]
apply, fmt-merge-msg: use relative filenames

Commit dbd0f5c7 (Files given on the command line are relative to $cwd,
2008-08-06) only fixed git-commit and git-tag. But, git-apply and
git-fmt-merge-msg didn't get the update and exhibit the same behavior.

Fix them and add tests for "apply --build-fake-ancestor" and
"fmt-merge-msg -F".

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocommit: -F overrides -t
Stephen Boyd [Sat, 23 May 2009 18:53:10 +0000 (11:53 -0700)]
commit: -F overrides -t

Commit dbd0f5c7 (Files given on the command line are relative to $cwd,
2008-08-06) introduced parse_options_fix_filename() as a quick fix for
filename arguments used in the parse options API.

git-commit was still broken. This means

    git commit -F log -t temp

in a subdirectory would make git think the log message should be taken
from temp instead of log.

This is because parse_options_fix_filename() calls prefix_filename()
which uses a single static char buffer to do its work. Making two calls
with two char pointers causes the pointers to alias. To prevent
aliasing, we duplicate the string returned by
parse_options_fix_filename().

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopost-receive-email: hooks.showrev: show how to include both web link and patch
Jim Meyering [Sat, 23 May 2009 12:26:44 +0000 (14:26 +0200)]
post-receive-email: hooks.showrev: show how to include both web link and patch

Add a comment showing how to include a web link (i.e. gitweb/cgit)
and a patch in the email that is sent for each pushed commit.

The quoting was tricky enough that it's worth documenting.  To add
two blank lines (i.e. put \n\n in the printf), you would need to
say \\\\n\\\\n, and in the end, the pair of "echo" statements seemed
better.  This is used in glibc.git repository:

  http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=summary

push-triggered messages have been sent to this list since May 21:

  http://sourceware.org/ml/glibc-cvs/2009-q2/

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: Fix compiler warning in merge-recursive
Johannes Schindelin [Sat, 23 May 2009 08:04:51 +0000 (10:04 +0200)]
MinGW: Fix compiler warning in merge-recursive

GCC 4.4.0 on Windows does not like the format %zu.  It is quite unlikely,
though, that we need more merge bases than a %d can display, so replace
the %zu by a %d.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: Add a simple getpass()
Johannes Schindelin [Sat, 23 May 2009 08:04:50 +0000 (10:04 +0200)]
MinGW: Add a simple getpass()

We need getpass() to activate curl on MinGW.  Although the default
Makefile currently has 'NO_CURL = YesPlease', msysgit releases do
provide curl support, so getpass() is used.

[spr: - edited commit message.
      - squashed commit that provides getpass() declaration.]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: use POSIX signature of waitpid()
Johannes Schindelin [Sat, 23 May 2009 08:04:49 +0000 (10:04 +0200)]
MinGW: use POSIX signature of waitpid()

Git's source code expects waitpid() to return a signed int status.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: the path separator to split GITPERLLIB is ';' on Win32
Johannes Schindelin [Sat, 23 May 2009 08:04:48 +0000 (10:04 +0200)]
MinGW: the path separator to split GITPERLLIB is ';' on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: Scan for \r in addition to \n when reading shbang lines
Peter Harris [Sat, 23 May 2009 08:04:47 +0000 (10:04 +0200)]
MinGW: Scan for \r in addition to \n when reading shbang lines

\r is common on Windows, so we should handle it gracefully.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jn/gitweb-cleanup'
Junio C Hamano [Sat, 23 May 2009 08:44:06 +0000 (01:44 -0700)]
Merge branch 'jn/gitweb-cleanup'

* jn/gitweb-cleanup:
  gitweb: Remove unused $hash_base parameter from normalize_link_target
  gitweb: Simplify snapshot format detection logic in evaluate_path_info
  gitweb: Use capturing parentheses only when you intend to capture
  gitweb: Replace wrongly added tabs with spaces
  gitweb: Use block form of map/grep in a few cases more
  gitweb: Always use three argument form of open
  gitweb: Always use three argument form of open
  gitweb: Do not use bareword filehandles

15 years agoMerge branch 'mg/track'
Junio C Hamano [Sat, 23 May 2009 08:44:00 +0000 (01:44 -0700)]
Merge branch 'mg/track'

* mg/track:
  Fix behavior with non-commit upstream references
  Test tracking of non-commit upstreams

15 years agoMerge branch 'fc/decorate-tag'
Junio C Hamano [Sat, 23 May 2009 08:43:50 +0000 (01:43 -0700)]
Merge branch 'fc/decorate-tag'

* fc/decorate-tag:
  Prettify log decorations even more
  Change prettify_ref to prettify_refname

15 years agoMerge branch 'tp/send-email-from-config'
Junio C Hamano [Sat, 23 May 2009 08:43:26 +0000 (01:43 -0700)]
Merge branch 'tp/send-email-from-config'

* tp/send-email-from-config:
  send-email: Add config option for sender address

15 years agoMerge branch 'js/maint-no-ln-across-libexec-and-bin'
Junio C Hamano [Sat, 23 May 2009 08:43:08 +0000 (01:43 -0700)]
Merge branch 'js/maint-no-ln-across-libexec-and-bin'

* js/maint-no-ln-across-libexec-and-bin:
  Add NO_CROSS_DIRECTORY_HARDLINKS support to the Makefile

Conflicts:
Makefile

15 years agoMerge branch 'da/mergetool-lib'
Junio C Hamano [Sat, 23 May 2009 08:41:51 +0000 (01:41 -0700)]
Merge branch 'da/mergetool-lib'

* da/mergetool-lib:
  mergetool--lib: specialize diff options for emerge and ecmerge

15 years agoMerge branch 'cc/bisect' (early part)
Junio C Hamano [Sat, 23 May 2009 08:41:27 +0000 (01:41 -0700)]
Merge branch 'cc/bisect' (early part)

* 'cc/bisect' (early part):
  bisect: make "git bisect" use new "--next-all" bisect-helper function
  bisect: add "check_good_are_ancestors_of_bad" function
  bisect: implement the "check_merge_bases" function
  bisect: automatically sort sha1_array if needed when looking it up
  bisect: make skipped array functions more generic
  bisect: remove too much function nesting
  bisect: use new "struct argv_array" to prepare argv for "setup_revisions"
  bisect: store good revisions in a "sha1_array"
  bisect: implement "rev_argv_push" to fill an argv with revs
  bisect: use "sha1_array" to store skipped revisions
  am: simplify "sq" function by using "git rev-parse --sq-quote"
  bisect: use "git rev-parse --sq-quote" instead of a custom "sq" function
  rev-parse: add --sq-quote to shell quote arguments
  rev-list: remove stringed output flag from "show_bisect_vars"
  bisect--helper: remove "--next-vars" option as it is now useless
  bisect: use "git bisect--helper --next-exit" in "git-bisect.sh"
  bisect--helper: add "--next-exit" to output bisect results
  bisect: move common bisect functionality to "bisect_common"
  rev-list: refactor printing bisect vars
  rev-list: make "estimate_bisect_steps" non static

15 years agoMerge branch 'lt/maint-diff-reduce-lstat'
Junio C Hamano [Sat, 23 May 2009 08:40:33 +0000 (01:40 -0700)]
Merge branch 'lt/maint-diff-reduce-lstat'

* lt/maint-diff-reduce-lstat:
  Teach 'git checkout' to preload the index contents
  Avoid unnecessary 'lstat()' calls in 'get_stat_data()'

15 years agoMerge branch 'jm/format-patch-no-auto-n-when-k-is-given'
Junio C Hamano [Sat, 23 May 2009 08:40:22 +0000 (01:40 -0700)]
Merge branch 'jm/format-patch-no-auto-n-when-k-is-given'

* jm/format-patch-no-auto-n-when-k-is-given:
  format-patch let -k override a config-specified format.numbered

15 years agoMerge branch 'do/maint-merge-recursive-fix'
Junio C Hamano [Sat, 23 May 2009 08:39:50 +0000 (01:39 -0700)]
Merge branch 'do/maint-merge-recursive-fix'

* do/maint-merge-recursive-fix:
  merge-recursive: never leave index unmerged while recursing

15 years agoMerge branch 'rr/forbid-bs-in-ref'
Junio C Hamano [Sat, 23 May 2009 08:39:45 +0000 (01:39 -0700)]
Merge branch 'rr/forbid-bs-in-ref'

* rr/forbid-bs-in-ref:
  Disallow '\' in ref names

15 years agoMerge branch 'hv/sample-update'
Junio C Hamano [Sat, 23 May 2009 08:39:15 +0000 (01:39 -0700)]
Merge branch 'hv/sample-update'

* hv/sample-update:
  Extend sample update hook, disable modifying of existing tags

15 years agoMerge branch 'jk/maint-1.6.0-trace-argv'
Junio C Hamano [Sat, 23 May 2009 08:39:08 +0000 (01:39 -0700)]
Merge branch 'jk/maint-1.6.0-trace-argv'

* jk/maint-1.6.0-trace-argv:
  fix GIT_TRACE segfault with shell-quoted aliases

Conflicts:
alias.c

15 years agoMerge branch 'jk/no-no-no-empty-directory'
Junio C Hamano [Sat, 23 May 2009 08:38:35 +0000 (01:38 -0700)]
Merge branch 'jk/no-no-no-empty-directory'

* jk/no-no-no-empty-directory:
  parseopt: add OPT_NEGBIT

15 years agoMerge branch 'rs/grep-parseopt'
Junio C Hamano [Sat, 23 May 2009 08:38:32 +0000 (01:38 -0700)]
Merge branch 'rs/grep-parseopt'

* rs/grep-parseopt:
  grep: make callback functions static
  grep: use parseopt
  grep: remove global variable builtin_grep
  parseopt: add PARSE_OPT_NODASH
  parseopt: add OPT_NUMBER_CALLBACK
  parseopt: add OPT_NEGBIT

15 years agoMerge branch 'fl/git-pm'
Junio C Hamano [Sat, 23 May 2009 08:38:28 +0000 (01:38 -0700)]
Merge branch 'fl/git-pm'

* fl/git-pm:
  Git.pm: Always set Repository to absolute path if autodetecting
  Git.pm: Set GIT_WORK_TREE if we set GIT_DIR

15 years agoMerge branch 'mt/submodule-reference'
Junio C Hamano [Sat, 23 May 2009 08:38:24 +0000 (01:38 -0700)]
Merge branch 'mt/submodule-reference'

* mt/submodule-reference:
  Add --reference option to git submodule.

15 years agoOpenSolaris 200811 (SunOS 5.11) does not want OLD_ICONV
Junio C Hamano [Sat, 23 May 2009 05:55:31 +0000 (22:55 -0700)]
OpenSolaris 200811 (SunOS 5.11) does not want OLD_ICONV

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTeach Solaris that _XOPEN_SOURCE=600 really menas XPG6
Junio C Hamano [Sat, 23 May 2009 01:06:06 +0000 (18:06 -0700)]
Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6

In git-compat-util.h, we do

    #define _XOPEN_SOURCE 600
    #define _XOPEN_SOURCE_EXTENDED 1

unless we are on BSD or SCO.

On OpenSolaris (200811), /usr/include/sys/feature_tests.h has this nice
table:

    Feature Test Macro      Specification
    ------------------------------------------------  -------------
    _XOPEN_SOURCE                                         XPG3
    _XOPEN_SOURCE && _XOPEN_VERSION = 4                   XPG4
    _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1           XPG4v2
    _XOPEN_SOURCE = 500                                   XPG5
    _XOPEN_SOURCE = 600  (or POSIX_C_SOURCE=200112L)      XPG6

Later in the same header, compilation with -c99 is made to fail if _XPG6 is
not set, like this:

    #if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
    #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
            and pre-2001 POSIX applications"
    #elif ...

The problem is that they check things in an order that is inconvenient for
us.  When they see _XOPEN_SOURCE_EXTENDED, they declare that we are XPG4v2,
regardless of the value of _XOPEN_SOURCE.

To work around this problem, do not define _XOPEN_SOURCE_EXTENDED on
Sun's.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoshow-branch: migrate to parse-options API
Stephen Boyd [Thu, 21 May 2009 07:33:18 +0000 (00:33 -0700)]
show-branch: migrate to parse-options API

Note that "-g" no longer uses an equals '=' sign for its optional
arguments, but "--reflog" still does. This is normal behavior for parse
options, as arguments to "-g" are put immediately after the option with
no space.

For example

    git show-branch -g=4

is now

    git show-branch -g4

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'mh/show-branch-color' into sb/show-branch-parse-options
Junio C Hamano [Thu, 21 May 2009 15:55:02 +0000 (08:55 -0700)]
Merge branch 'mh/show-branch-color' into sb/show-branch-parse-options

* branch 'mh/show-branch-color':
  bash completion: show-branch color support
  show-branch: color the commit status signs

15 years agoparse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's
Stephen Boyd [Thu, 21 May 2009 07:33:17 +0000 (00:33 -0700)]
parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's

Usually, the argh element in struct option points at a placeholder value
(e.g. "val"), and is shown in the usage message as

    --option=<val>

by enclosing the string inside of angle brackets.

When the option is more complex (e.g. optional arguments separated by a
comma), you would want to produce a usage message that looks like

    --option=<val1>[,<val2>]

In such a case, the caller can pass a string to argh with placeholders
already enclosed in necessary angle brackets (e.g.  "<val1>[,<val2>]")
and set this flag.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot8005: convert CP1251 character set to ISO8859-5
Brandon Casey [Fri, 22 May 2009 23:47:06 +0000 (18:47 -0500)]
t8005: convert CP1251 character set to ISO8859-5

On IRIX 6.5 CP1251 is unknown, but WIN1251 (which seems to be a
non-standard name) is known.  On Solaris 10, the opposite is true.  Solaris
also knows CP1251 as WINDOWS-1251, but this too is not recognized on IRIX.
I could not find a name that both platforms recognized for this character
set.

An alternative character set which covers the same alphabet seems to be the
ISO8859-5 character set.  Both platforms support this character set, so use
it instead.

This allows t8005.4 to pass on Solaris 7, and part of the test to pass on
IRIX. (My IRIX can't convert SJIS to UTF-8 :(

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot8005: use more portable character encoding names
Brandon Casey [Fri, 22 May 2009 23:47:05 +0000 (18:47 -0500)]
t8005: use more portable character encoding names

Some platforms do not have an extensive list of alternate names for
character encodings.

Solaris 7 does not know about shift-jis, but does know SJIS.  It also does
not know that utf-8 and UTF-8 refer to the same encoding.

With the above in mind, the following conversions were performed:

      utf-8 --> UTF-8
  shift-jis --> SJIS

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: Sanitize title attribute in format_subject_html
Jakub Narebski [Fri, 22 May 2009 15:35:46 +0000 (17:35 +0200)]
gitweb: Sanitize title attribute in format_subject_html

Replace control characters with question mark '?' (like in
chop_and_esc_str).

A little background: some web browsers turn on strict (and
unforgiving) XML validating mode for XHTML documents served using
application/xhtml+xml content type.  This means among others that
control characters are forbidden to appear in gitweb output.

CGI.pm does by default slight escaping (using simple_escape subroutine
from CGI::Util) of all _attribute_ values (depending on the value of
autoEscape, by default on).  This escaping, at least in CGI.pm version
3.10 (most current version at CPAN is 3.43), is minimal: only '"',
'&', '<' and '>' are escaped using named HTML entity references
(&quot;, &amp;, &lt; and &gt; respectively).  But simple_escape does
not do escaping of control characters such as ^X which are invalid in
XHTML (in strict mode).

If by some accident commit message do contain some control character
in first 50 characters (more or less) of first line of commit message,
and this line is longer than 50 characters (so gitweb shortens it for
display), then gitweb would put this control character in title
attribute (and CGI.pm would not remove them).  The tag _contents_ is
safe because it is escaped using esc_html() explicitly, and it
replaces control characters by their printable representation.

While at it: chop_and_escape_str doesn't need capturing group.

Noticed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTerminate argv with NULL before calling setup_revisions()
Nguyễn Thái Ngọc Duy [Thu, 21 May 2009 09:32:44 +0000 (19:32 +1000)]
Terminate argv with NULL before calling setup_revisions()

It is convention that argv should be terminated with NULL, even if
argc is used to specify the size of argv. setup_revisions() requires
this and may segfault otherwise.

This patch makes sure that all argv (that I can find) is NULL terminated.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodoc/git-rebase.txt: remove mention of multiple strategies
Nguyễn Thái Ngọc Duy [Thu, 21 May 2009 09:47:07 +0000 (19:47 +1000)]
doc/git-rebase.txt: remove mention of multiple strategies

git-rebase.sh does not seem to support this.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Thu, 21 May 2009 14:28:07 +0000 (07:28 -0700)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: add --authors-prog option
  git-svn: Set svn.authorsfile if it is passed to git svn clone
  git-svn: Correctly report max revision when following deleted paths
  git-svn: Fix for svn paths removed > log-window-size revisions ago
  git-svn testsuite: use standard configuration for Subversion tools

15 years agogit-send-email: Handle quotes when parsing .mailrc files
Eric W. Biederman [Thu, 21 May 2009 02:45:53 +0000 (19:45 -0700)]
git-send-email: Handle quotes when parsing .mailrc files

It is legal and not uncommon to use quotes in a .mailrc file so
you can include a persons fullname as well as their email alias.
Handle this by using quotewords instead of split when parsing
.mailrc files.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: add --authors-prog option
Mark Lodato [Fri, 15 May 2009 01:27:15 +0000 (21:27 -0400)]
git-svn: add --authors-prog option

Add a new option, --authors-prog, to git-svn that allows a more flexible
alternative (or supplement) to --authors-file.  This allows more
advanced username operations than the authors file will allow.  For
example, one may look up Subversion users via LDAP, or may generate the
name and email address from the Subversion username.

Notes:

* If both --authors-name and --authors-prog are given, the former is
  tried first, falling back to the later.

* The program is called once per unique SVN username, and the result is
  cached.

* The command-line argument must be the path to a program, not a generic
  shell command line.  The absolute path to this program is taken at
  startup since the git-svn script changes directory during operation.

* The option is not enabled for `git svn log'.

[ew: fixed case where neither --authors-(name|prog) were defined]
Signed-off-by: Mark Lodato <lodatom@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Set svn.authorsfile if it is passed to git svn clone
Alex Vandiver [Wed, 6 May 2009 20:19:45 +0000 (16:19 -0400)]
git-svn: Set svn.authorsfile if it is passed to git svn clone

Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Correctly report max revision when following deleted paths
Alex Vandiver [Wed, 6 May 2009 20:18:53 +0000 (16:18 -0400)]
git-svn: Correctly report max revision when following deleted paths

Report the maximum found revision in the range, instead of the minimum
changed revision.

Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Fix for svn paths removed > log-window-size revisions ago
Alex Vandiver [Wed, 6 May 2009 20:18:52 +0000 (16:18 -0400)]
git-svn: Fix for svn paths removed > log-window-size revisions ago

Instead of trying to find the end of the commit history only in the
last window, track if we have seen commits yet, and use that to judge
if we need to backtrack and look for a tail.  Otherwise, conversion
can silently lose up to 100 revisions of a branch if it was deleted
>100 revisions ago.

Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn testsuite: use standard configuration for Subversion tools
Eygene Ryabinkin [Fri, 8 May 2009 08:06:16 +0000 (12:06 +0400)]
git-svn testsuite: use standard configuration for Subversion tools

I have tweaked configuration in my ~/.subversion directory, namely I am
running auto-properties and automatically adding '$Id$' expansion to
every file.  This choke the last test named 'proplist' from
t9101-git-svn-props.sh, because one more property, svn:keywords is
automatically added.

I had just wrapped svn invocation with the svn_cmd that specifies empty
directory via --config-dir argument.  Since the latter is the global
option, it should be recognized by all svn subcommands, so no
regressions will be introduced.

Now svn_cmd is used everywhere, not just in the failed test module: this
should guard us from the future clashes with user-defined configuration
tweaks.

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 21 May 2009 01:59:09 +0000 (18:59 -0700)]
Merge branch 'maint'

* maint:
  grep: fix word-regexp colouring
  completion: use git rev-parse to detect bare repos
  Cope better with a _lot_ of packs
  for-each-ref: fix segfault in copy_email

15 years agogrep: fix word-regexp colouring
René Scharfe [Wed, 20 May 2009 21:31:53 +0000 (23:31 +0200)]
grep: fix word-regexp colouring

As noticed by Dmitry Gryazin: When a pattern is found but it doesn't
start and end at word boundaries, bol is forwarded to after the match and
the pattern is searched again.  When a pattern is finally found between
word boundaries, the match offsets are off by the number of characters
that have been skipped.

This patch corrects the offsets to be relative to the value of bol as
passed to match_one_pattern() by its caller.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: use git rev-parse to detect bare repos
Giuseppe Bilotta [Mon, 18 May 2009 16:24:30 +0000 (18:24 +0200)]
completion: use git rev-parse to detect bare repos

Its check is more robust than a config check for core.bare

Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoCope better with a _lot_ of packs
Johannes Schindelin [Fri, 15 May 2009 18:52:47 +0000 (20:52 +0200)]
Cope better with a _lot_ of packs

You might end up with a situation where you have tons of pack files, e.g.
when using hg2git.  In this situation, all kinds of operations may
end up with a "too many files open" error.  Let's recover gracefully from
that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Looks-right-to-me-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: make callback functions static
René Scharfe [Wed, 20 May 2009 22:05:22 +0000 (00:05 +0200)]
grep: make callback functions static

Suggested by Stephen Boyd: make the callback functions used for option
parsing static.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofor-each-ref: fix segfault in copy_email
Jeff King [Mon, 18 May 2009 17:58:11 +0000 (13:58 -0400)]
for-each-ref: fix segfault in copy_email

You can trigger a segfault in git.git by doing:

  git for-each-ref --format='%(taggeremail)' refs/tags/v0.99

The v0.99 tag is special in that it contains no "tagger"
header.

The bug is obvious in copy_email, which carefully checks to
make sure the result of a strchr is non-NULL, but only after
already having used it to perform other work. The fix is to
move the check up.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoExtend sample pre-commit hook to check for non ascii filenames
Heiko Voigt [Tue, 19 May 2009 20:01:54 +0000 (22:01 +0200)]
Extend sample pre-commit hook to check for non ascii filenames

At the moment non-ascii encodings of filenames are not portably
converted between different filesystems by git. This will most likely
change in the future but to allow repositories to be portable among
different file/operating systems this check is enabled by default.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUnify signedness in hashing calls
Dan McGee [Tue, 19 May 2009 04:34:02 +0000 (23:34 -0500)]
Unify signedness in hashing calls

Our hash_obj and hashtable_index calls and functions were doing a lot of
funny things with signedness. Unify all of it to 'unsigned int'.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot5100: use ancient encoding syntax for backwards compatibility
Brandon Casey [Mon, 18 May 2009 23:44:45 +0000 (18:44 -0500)]
t5100: use ancient encoding syntax for backwards compatibility

Some ancient platforms do not have an extensive list of alternate names for
character encodings.  For example, Solaris 7 does not know that ISO-8859-1
is the same as ISO8859-1.  Modern platforms do know this, so use the older
names.

The following conversions were performed:

    ISO-8859-1 --> ISO8859-1
    ISO-8859-2 --> ISO8859-2
    ISO-8859-8 --> ISO8859-8
    iso-2022-jp --> ISO-2022-JP

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot9301: use ISO8859-1 rather than ISO-8859-1
Brandon Casey [Mon, 18 May 2009 23:44:44 +0000 (18:44 -0500)]
t9301: use ISO8859-1 rather than ISO-8859-1

Some ancient platforms do not have an extensive list of alternate names for
character encodings.  For example, Solaris 7 does not know that ISO-8859-1
is the same as ISO8859-1.  Modern platforms do know this, so use the older
name.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility
Brandon Casey [Mon, 18 May 2009 23:44:43 +0000 (18:44 -0500)]
t3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility

Some ancient platforms do not have an extensive list of alternate names for
character encodings.  For example, Solaris 7 does not know that ISO-8859-1
is the same as ISO8859-1.  Modern platforms do know this, so use the older
name.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3901: avoid negation on right hand side of '|'
Brandon Casey [Mon, 18 May 2009 23:44:42 +0000 (18:44 -0500)]
t3901: avoid negation on right hand side of '|'

Some shells do not properly handle constructs of the form:

   spew_something | ! process_input

So rewrite this to be:

   spew_something | process_input; test $? != 0

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-mailinfo.c: use "ISO8859-1" instead of "latin1" as fallback encoding
Brandon Casey [Mon, 18 May 2009 23:44:41 +0000 (18:44 -0500)]
builtin-mailinfo.c: use "ISO8859-1" instead of "latin1" as fallback encoding

Some platforms do not understand the character encoding "latin1" which is
another name for "ISO8859-1".  So use "ISO8859-1" instead which all tested
platforms understand.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-mailinfo.c: compare character encodings case insensitively
Brandon Casey [Mon, 18 May 2009 23:44:40 +0000 (18:44 -0500)]
builtin-mailinfo.c: compare character encodings case insensitively

When converting between character encodings, git tests whether the "from"
encoding and the "to" encoding have the same name.  git should perform this
test case insensitively so that e.g. utf-8 is not seen as a different
encoding than UTF-8.

Additionally, it is not necessary to call tolower() anymore on the encodings
extracted from the mail message.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse 'UTF-8' rather than 'utf-8' everywhere for backward compatibility
Brandon Casey [Mon, 18 May 2009 23:44:39 +0000 (18:44 -0500)]
Use 'UTF-8' rather than 'utf-8' everywhere for backward compatibility

Some ancient platforms (Solaris 7, IRIX 6.5) do not understand 'utf-8', but
all tested implementations understand 'UTF-8'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3900: use ancient iconv names for backward compatibility
Brandon Casey [Mon, 18 May 2009 23:44:38 +0000 (18:44 -0500)]
t3900: use ancient iconv names for backward compatibility

Some old iconv implementations do not have many alternate names and/or
do not match character encoding names case insensitively.  These
implementations can not tell that utf-8 and UTF-8 are the same encoding
and fail when trying to do the conversion.  So use the old names, which
modern implementations still support.

The following conversions were performed:

         utf-8 --> UTF-8
    ISO-8859-1 --> ISO8859-1
         EUCJP --> eucJP

Also update t9129 and t9500 which make use of the test files in t/t3900.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'np/push-delta'
Junio C Hamano [Mon, 18 May 2009 16:01:16 +0000 (09:01 -0700)]
Merge branch 'np/push-delta'

* np/push-delta:
  allow OFS_DELTA objects during a push

15 years agoMerge branch 'ar/merge-one-file-diag'
Junio C Hamano [Mon, 18 May 2009 16:01:11 +0000 (09:01 -0700)]
Merge branch 'ar/merge-one-file-diag'

* ar/merge-one-file-diag:
  Clarify kind of conflict in merge-one-file helper

15 years agoMerge branch 'ar/unlink-err'
Junio C Hamano [Mon, 18 May 2009 16:01:06 +0000 (09:01 -0700)]
Merge branch 'ar/unlink-err'

* ar/unlink-err:
  print unlink(2) errno in copy_or_link_directory
  replace direct calls to unlink(2) with unlink_or_warn
  Introduce an unlink(2) wrapper which gives warning if unlink failed

15 years agoMerge branch 'jk/maint-add-empty'
Junio C Hamano [Mon, 18 May 2009 16:01:01 +0000 (09:01 -0700)]
Merge branch 'jk/maint-add-empty'

* jk/maint-add-empty:
  add: don't complain when adding empty project root

15 years agoMerge branch 'js/add-edit'
Junio C Hamano [Mon, 18 May 2009 16:00:06 +0000 (09:00 -0700)]
Merge branch 'js/add-edit'

* js/add-edit:
  t3702: fix reliance on SHELL_PATH being '/bin/sh'
  git-add: introduce --edit (to edit the diff vs. the index)

15 years agoMerge branch 'mh/diff-stat-color'
Junio C Hamano [Mon, 18 May 2009 15:59:54 +0000 (08:59 -0700)]
Merge branch 'mh/diff-stat-color'

* mh/diff-stat-color:
  diff: do not color --stat output like patch context

15 years agoMerge branch 'mh/show-branch-color'
Junio C Hamano [Mon, 18 May 2009 15:59:48 +0000 (08:59 -0700)]
Merge branch 'mh/show-branch-color'

* mh/show-branch-color:
  bash completion: show-branch color support
  show-branch: color the commit status signs

Conflicts:
contrib/completion/git-completion.bash

15 years agoMerge branch 'ac/graph-horizontal-line'
Junio C Hamano [Mon, 18 May 2009 15:59:30 +0000 (08:59 -0700)]
Merge branch 'ac/graph-horizontal-line'

* ac/graph-horizontal-line:
  graph API: Use horizontal lines for more compact graphs

15 years agoMerge branch 'ae/anon-fetch-info'
Junio C Hamano [Mon, 18 May 2009 15:59:27 +0000 (08:59 -0700)]
Merge branch 'ae/anon-fetch-info'

* ae/anon-fetch-info:
  fetch: Strip usernames from url's before storing them

15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 18 May 2009 15:59:20 +0000 (08:59 -0700)]
Merge branch 'maint'

* maint:
  show-branch: Fix die message in parse_reflog_param()

15 years agobisect: check ancestors without forking a "git rev-list" process
Christian Couder [Sun, 17 May 2009 15:36:46 +0000 (17:36 +0200)]
bisect: check ancestors without forking a "git rev-list" process

We must save the pending commits that will be used during revision
walking and unparse them after, because we want to leave a clean
state for the next revision walking that will try to find the best
bisection point.

As we don't fork a process anymore to call "git rev-list", we need
to remove the use of GIT_TRACE to check how "git rev-list" is
called from the t6030 test that uses it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocommit: add function to unparse a commit and its parents
Christian Couder [Sun, 17 May 2009 15:36:45 +0000 (17:36 +0200)]
commit: add function to unparse a commit and its parents

This patch adds the "unparse_commit" function that returns a commit
into an unparsed state by freeing its data and resetting its fields
to 0.

Its parents are recursively unparsed too, because they might have
been changed. But its tree is not unparsed as it should not have
been modifed.

Note that as the "flags" and "used" fields may be used even if the
object is not parsed, we have to reset them anyway.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobisect: rework some rev related functions to make them more reusable
Christian Couder [Sun, 17 May 2009 15:36:44 +0000 (17:36 +0200)]
bisect: rework some rev related functions to make them more reusable

This patches changes the "bisect_rev_setup" and "bisect_common"
functions to make it easier to reuse them in a later patch.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoformat-patch: migrate to parse-options API
Stephen Boyd [Sat, 16 May 2009 09:24:46 +0000 (02:24 -0700)]
format-patch: migrate to parse-options API

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoshow-branch: Fix die message in parse_reflog_param()
Stephen Boyd [Sun, 17 May 2009 10:47:02 +0000 (03:47 -0700)]
show-branch: Fix die message in parse_reflog_param()

Commit 76a44c5 (show-branch --reflog: show the reflog message at the
top, 2007-01-19) introduced parse_reflog_param(). The die() call was
incorrectly passed arg + 9, when it should have been passed arg.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 17 May 2009 06:08:49 +0000 (23:08 -0700)]
Merge branch 'maint'

* maint:
  completion: add missing options to show-branch and show
  dir.c: clean up handling of 'path' parameter in read_directory_recursive()
  Fix type-punning issues

15 years agocompletion: add missing options to show-branch and show
Stephen Boyd [Sun, 17 May 2009 03:42:43 +0000 (20:42 -0700)]
completion: add missing options to show-branch and show

Add --oneline and --abbrev-commit to show and --sparse to show-branch.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodir.c: clean up handling of 'path' parameter in read_directory_recursive()
Linus Torvalds [Thu, 14 May 2009 20:05:03 +0000 (13:05 -0700)]
dir.c: clean up handling of 'path' parameter in read_directory_recursive()

Right now we pass two different pathnames ('path' and 'base') down to
read_directory_recursive(), and the only real reason for that is that we
want to allow an empty 'base' parameter, but when we do so, we need the
pathname to "opendir()" to be "." rather than the empty string.

And rather than handle that confusion in the caller, we can just fix
read_directory_recursive() to handle the case of an empty path itself,
by just passing opendir() a "." ourselves if the path is empty.

This would allow us to then drop one of the pathnames entirely from the
calling convention, but rather than do that, we'll start separating them
out as a "filesystem pathname" (the one we use for filesystem accesses)
and a "git internal base name" (which is the name that we use for git
internally).

That will eventually allow us to do things like handle different
encodings (eg the filesystem pathnames might be Latin1, while git itself
would use UTF-8 for filename information).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix type-punning issues
Dan McGee [Tue, 12 May 2009 01:17:38 +0000 (20:17 -0500)]
Fix type-punning issues

In these two places we are casting part of our unsigned char sha1 array into
an unsigned int, which violates GCCs strict-aliasing rules (and probably
other compilers).

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 17 May 2009 02:49:42 +0000 (19:49 -0700)]
Merge branch 'maint'

* maint:
  test: checkout shouldn't say that HEAD has moved if it didn't
  completion: enhance "current branch" display
  completion: simplify "current branch" in __git_ps1()
  completion: fix PS1 display during a merge on detached HEAD
  builtin-checkout: Don't tell user that HEAD has moved before it has
  pre-commit.sample: don't print incidental SHA1
  tests: Add tests for missing format-patch long options
  api-parse-options.txt: use 'func' instead of 'funct'
  Turn on USE_ST_TIMESPEC for OpenBSD
  ls-tree manpage: output of ls-tree is compatible with update-index
  ls-tree manpage: use "unless" instead of "when ... is not"

15 years agotest: checkout shouldn't say that HEAD has moved if it didn't
Nanako Shiraishi [Sun, 17 May 2009 02:43:08 +0000 (11:43 +0900)]
test: checkout shouldn't say that HEAD has moved if it didn't

Signed-off-by: しらいしななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: enhance "current branch" display
Junio C Hamano [Sun, 10 May 2009 08:56:21 +0000 (01:56 -0700)]
completion: enhance "current branch" display

Introduce GIT_PS1_DESCRIBE option you can set to "contains", "branch", or
"describe" to tweak the way how a detached HEAD is described.

The default behaviour is to describe only exact match with some tag
(otherwise use the first 7 hexdigits) as before.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: simplify "current branch" in __git_ps1()
Junio C Hamano [Sun, 10 May 2009 08:53:19 +0000 (01:53 -0700)]
completion: simplify "current branch" in __git_ps1()

As I very often work on a detached HEAD, I found it pretty confusing
when __git_ps1() said 'some-name'.  Did I create a branch with that name
by mistake, or do I happen to be on a commit with that exact tag?

This patch fixes the issue by enclosing non branch names in a pair of
parentheses when used to substitute %s token in __git_ps1() argument.

It also fixes a small bug where the branch part is left empty when
.git/HEAD is unreadable for whatever reason.  The output now says
"(unknown)".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: fix PS1 display during a merge on detached HEAD
Junio C Hamano [Sat, 16 May 2009 18:46:22 +0000 (11:46 -0700)]
completion: fix PS1 display during a merge on detached HEAD

If your merge stops in a conflict while on a detached HEAD, recent
completion code fails to show anything.  This was because various cases
added to support the operation-in-progress markers (e.g. REBASE, MERGING)
forgot that they need to set the variable "b" to something for the result
they computed to be displayed at all.

Probably not many people make trial merges on a detached HEAD (which is
tremendously useful feature of git, by the way), and that may be why this
was not noticed for a long time.

Acked-By: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoImprove the naming of guessed target repository for git clone
Alex Riesen [Wed, 13 May 2009 16:32:06 +0000 (18:32 +0200)]
Improve the naming of guessed target repository for git clone

Strip leading and trailing spaces off guessed target directory, and
replace sequences of whitespace and 'control' characters with one
space character.

User still can have any name by specifying it explicitely after url.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse UTF-8 instead of utf8 for backward compatibility
Alex Riesen [Thu, 14 May 2009 12:55:54 +0000 (14:55 +0200)]
Use UTF-8 instead of utf8 for backward compatibility

An old iconv (GNU libiconv 1.11) does not know about utf8, it does know
UTF-8 though, which is also understood by all newer iconv implementations.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRevert "git-add--interactive: remove hunk coalescing"
Junio C Hamano [Sat, 16 May 2009 17:48:23 +0000 (10:48 -0700)]
Revert "git-add--interactive: remove hunk coalescing"

This reverts commit 0beee4c6dec15292415e3d56075c16a76a22af54 but with a
bit of twist, as we have added "edit hunk manually" hack and we cannot
rely on the original line numbers of the hunks that were manually edited.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoSplitting a hunk that adds a line at the top fails in "add -p"
Matt Graham [Sat, 16 May 2009 03:10:19 +0000 (23:10 -0400)]
Splitting a hunk that adds a line at the top fails in "add -p"

Splitting a hunk into two in add -p doesn't work for a diff that adds a
new line at the top of the file with other add in the same hunk.

Signed-off-by: Matthew Graham <mdg149@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-checkout: Don't tell user that HEAD has moved before it has
Daniel Cordero [Sat, 16 May 2009 17:54:45 +0000 (10:54 -0700)]
builtin-checkout: Don't tell user that HEAD has moved before it has

Previously, checkout would tell the user this message before moving HEAD,
without regard to whether the upcoming move will result in success.
If the move failed, this causes confusion.

Show the message after the move, unless the move failed.

Signed-off-by: Daniel Cordero <theappleman@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopre-commit.sample: don't print incidental SHA1
Jim Meyering [Sat, 16 May 2009 10:21:50 +0000 (12:21 +0200)]
pre-commit.sample: don't print incidental SHA1

Make the sample pre-commit hook script discard
all git-rev-parse output, not just stderr.
Otherwise, it would print an SHA1.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotests: Add tests for missing format-patch long options
Stephen Boyd [Sat, 16 May 2009 09:24:45 +0000 (02:24 -0700)]
tests: Add tests for missing format-patch long options

Exercise format-patch's --signoff, --in-reply-to and --start-number long
options.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapi-parse-options.txt: use 'func' instead of 'funct'
Stephen Boyd [Sat, 16 May 2009 09:24:44 +0000 (02:24 -0700)]
api-parse-options.txt: use 'func' instead of 'funct'

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomktree: validate entry type in input
Josh Micich [Thu, 14 May 2009 22:49:10 +0000 (15:49 -0700)]
mktree: validate entry type in input

Previously mktree would accept tree entries which had a mismatch between
the declared type and the actual type of object.  Check the actual type of
the object when it is available locally.

Signed-off-by: Josh Micich <josh.micich@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomktree --batch: build more than one tree object
Josh Micich [Thu, 14 May 2009 19:51:15 +0000 (12:51 -0700)]
mktree --batch: build more than one tree object

This option works in a similar way to the '--batch' option of 'git cat-file'.
It enables creation of many tree objects with a single process.

The change was motivated by performance considerations in applications that
need to create many tree objects. A non-rigorous test showed tree creation
times improved from (roughly) 200ms to 50ms.

Signed-off-by: Josh Micich <josh.micich@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomktree --missing: updated usage message and man page
Josh Micich [Thu, 14 May 2009 19:46:03 +0000 (12:46 -0700)]
mktree --missing: updated usage message and man page

Update usage message in builtin-mktree.c to include '--missing'.  Do the
same to man page and clarify that the input does not have to be sorted.

Signed-off-by: Josh Micich <josh.micich@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTurn on USE_ST_TIMESPEC for OpenBSD
Tony Kemp [Thu, 14 May 2009 06:47:41 +0000 (16:47 +1000)]
Turn on USE_ST_TIMESPEC for OpenBSD

Like Darwin, OpenBSD's stat struct uses st_ctimespec and st_mtimestruct
rather than st_ctim and st_mtim.

Signed-off-by: Tony Kemp <tony.kemp@newcastle.edu.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>