Code

git.git
15 years agoMerge branch 'el/blame-date'
Junio C Hamano [Wed, 11 Mar 2009 20:47:12 +0000 (13:47 -0700)]
Merge branch 'el/blame-date'

* el/blame-date:
  Make git blame's date output format configurable, like git log

15 years agoMerge branch 'tr/gcov'
Junio C Hamano [Wed, 11 Mar 2009 20:47:01 +0000 (13:47 -0700)]
Merge branch 'tr/gcov'

* tr/gcov:
  Test git-patch-id
  Test rev-list --parents/--children
  Test log --decorate
  Test fsck a bit harder
  Test log --graph
  Test diff --dirstat functionality
  Test that diff can read from stdin
  Support coverage testing with GCC/gcov

15 years agotest: do not LoadModule log_config_module unconditionally
Johannes Schindelin [Wed, 11 Mar 2009 11:47:06 +0000 (12:47 +0100)]
test: do not LoadModule log_config_module unconditionally

LoadModule directive for log_config_module will not work if the module is
built-in.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agowinansi: support ESC [ K (erase in line)
Johannes Schindelin [Tue, 10 Mar 2009 21:58:09 +0000 (22:58 +0100)]
winansi: support ESC [ K (erase in line)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorecv_sideband: Bands #2 and #3 always go to stderr
Johannes Sixt [Tue, 10 Mar 2009 21:54:17 +0000 (22:54 +0100)]
recv_sideband: Bands #2 and #3 always go to stderr

This removes the last parameter of recv_sideband, by which the callers
told which channel bands #2 and #3 should be written to.

Sayeth Shawn Pearce:

   The definition of the streams in the current sideband protocol
   are rather well defined for the one protocol that uses it,
   fetch-pack/receive-pack:

     stream #1:  pack data
     stream #2:  stderr messages, progress, meant for tty
     stream #3:  abort message, remote is dead, goodbye!

Since both callers of the function passed 2 for the parameter, we hereby
remove it and send bands #2 and #3 to stderr explicitly using fprintf.

This has the nice side-effect that these two streams pass through our
ANSI emulation layer on Windows.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorsync transport: allow local paths, and fix tests
Johannes Schindelin [Mon, 9 Mar 2009 18:44:55 +0000 (19:44 +0100)]
rsync transport: allow local paths, and fix tests

Earlier, the rsync tests were disabled by default, as they needed a
running rsyncd daemon.  This was only due to the limitation that our
rsync transport only allowed full URLs of the form

rsync://<host>/<path>

Relaxing the URLs to allow

rsync:<path>

permitted the change in the tests to run whenever rsync is available,
without requiring a fully configured and running rsyncd.

While at it, the tests were fixed so that they run in directories with a
space in their name.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-instaweb: fix lighttpd configuration on cygwin
Ramsay Jones [Mon, 9 Mar 2009 18:31:55 +0000 (18:31 +0000)]
git-instaweb: fix lighttpd configuration on cygwin

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Tested-by: Pascal Obry <pascal@obry.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGive error when no remote is configured
Daniel Barkalow [Wed, 11 Mar 2009 05:47:20 +0000 (01:47 -0400)]
Give error when no remote is configured

When there's no explicitly-named remote, we use the remote specified
for the current branch, which in turn defaults to "origin". But it
this case should require the remote to actually be configured, and not
fall back to the path "origin".

Possibly, the config file's "remote = something" should require the
something to be a configured remote instead of a bare repository URL,
but we actually test with a bare repository URL.

In fetch, we were giving the sensible error message when coming up
with a URL failed, but this wasn't actually reachable, so move that
error up and use it when appropriate.

In push, we need a new error message, because the old one (formerly
unreachable without a lot of help) used the repo name, which was NULL.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoInclude log_config module in apache.conf
Daniel Barkalow [Wed, 11 Mar 2009 03:23:45 +0000 (23:23 -0400)]
Include log_config module in apache.conf

The log_config module is needed for at least some versions of apache to
support the LogFormat directive.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTypo and language fixes for git-checkout.txt
Michael J Gruber [Tue, 10 Mar 2009 15:06:30 +0000 (16:06 +0100)]
Typo and language fixes for git-checkout.txt

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoImprove "git branch --tracking" output
Junio C Hamano [Tue, 10 Mar 2009 08:20:42 +0000 (01:20 -0700)]
Improve "git branch --tracking" output

An earlier patch always spelled the full name of the ref that we track
(e.g. "refs/heads/frotz" instead of just "frotz" when we mean the branch
whose name is "frotz").  Worse yet, because we now use the true name of
the ref at the original repository when talk about a tracking branch that
copies from a remote, such a full name alone still does not give enough
information.

This reorganizes the verbose codepath to:

 - differentiate "refs/heads/something" and everything else; we say that
   the branch tracks "branch <something>" if it begins with "refs/heads/",
   and otherwise the branch tracks "ref refs/<someother>/<something>";

 - report the name of the remote when we talk about a tracking branch, by
   saying "branch frotz from origin";

 - not say "by merging" at the end; it is the default and is not worth
   reporting.

Signed-off-by: Junio C Hamano <junio@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconnect.c: remove a few globals by using git_config callback data
Erik Faye-Lund [Wed, 11 Mar 2009 02:38:12 +0000 (02:38 +0000)]
connect.c: remove a few globals by using git_config callback data

Since ef90d6d (Provide git_config with a callback-data parameter,
2008-05-14), git_config() takes a callback data pointer that can be
used to pass extra parameters to the parsing function.  The codepath
to parse configuration variables related to git proxy predates this
facility and used a pair of file scope static variables instead.

This patch removes the need for these global variables by passing the
name of the host we are trying to access as the callback data.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Tue, 10 Mar 2009 01:38:18 +0000 (18:38 -0700)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: support intermediate paths when matching tags/branches

15 years agoparseopt: prevent KEEP_UNKNOWN and STOP_AT_NON_OPTION from being used together
René Scharfe [Mon, 9 Mar 2009 20:57:38 +0000 (21:57 +0100)]
parseopt: prevent KEEP_UNKNOWN and STOP_AT_NON_OPTION from being used together

As suggested by Junio, disallow the flags PARSE_OPT_KEEP_UNKNOWN and
PARSE_OPT_STOP_AT_NON_OPTION to be turned on at the same time, as a
value of an unknown option could be mistakenly classified as a
non-option, stopping the parser early.  E.g.:

git cmd --known --unknown value arg0 arg1

The parser should have stopped at "arg0", but it already stops at
"value".

This patch makes parse_options() die if the two flags are used in
combination.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoparseopt: document KEEP_ARGV0, KEEP_UNKNOWN, NO_INTERNAL_HELP
René Scharfe [Mon, 9 Mar 2009 20:26:56 +0000 (21:26 +0100)]
parseopt: document KEEP_ARGV0, KEEP_UNKNOWN, NO_INTERNAL_HELP

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: support intermediate paths when matching tags/branches
Michael Lai [Mon, 9 Mar 2009 18:45:47 +0000 (11:45 -0700)]
git-svn: support intermediate paths when matching tags/branches

For repositories laid out like the following:

[svn-remote "svn"]
      url = http://foo.com/svn/repos/bar
      fetch = myproject/trunk:refs/remotes/trunk
      branches = bar/myproject/branches/*:refs/remotes/*
      tags = bar/myproject/tags/*:refs/remotes/tags/*

The "bar" component above is considered the intermediate path
and was not handled correctly.

Signed-off-by: Michael Lai <myllai@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogrep: cast printf %.*s "precision" argument explicitly to int
Junio C Hamano [Mon, 9 Mar 2009 01:22:44 +0000 (18:22 -0700)]
grep: cast printf %.*s "precision" argument explicitly to int

On some systems, regoff_t that is the type of rm_so/rm_eo members are
wider than int; %.*s precision specifier expects an int, so use an explicit
cast.

A breakage reported on Darwin by Brian Gernhardt should be fixed with
this patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: Set compiler switch for USE_NSEC
Brian Gernhardt [Sun, 8 Mar 2009 21:22:51 +0000 (17:22 -0400)]
Makefile: Set compiler switch for USE_NSEC

The comments indicated that setting a Makefile variable USE_NSEC would
enable the code for sub-second [cm]times.  However, the Makefile
variable was never turned into a compiler switch so the code was never
enabled.  This patch allows USE_NSEC to be noticed by the compiler.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoCreate USE_ST_TIMESPEC and turn it on for Darwin
Brian Gernhardt [Sun, 8 Mar 2009 20:04:28 +0000 (16:04 -0400)]
Create USE_ST_TIMESPEC and turn it on for Darwin

Not all OSes use st_ctim and st_mtim in their struct stat.  In
particular, it appears that OS X uses st_*timespec instead.  So add a
Makefile variable and #define called USE_ST_TIMESPEC to switch the
USE_NSEC defines to use st_*timespec.

This also turns it on by default for OS X (Darwin) machines.  Likely
this is a sane default for other BSD kernels as well, but I don't have
any to test that assumption on.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoNot all systems use st_[cm]tim field for ns resolution file timestamp
Junio C Hamano [Sun, 8 Mar 2009 20:51:33 +0000 (13:51 -0700)]
Not all systems use st_[cm]tim field for ns resolution file timestamp

Some codepaths do not still use the ST_[CM]TIME_NSEC() pair of macros
introduced by the previous commit but assumes all systems use st_mtim
and st_ctim fields in "struct stat" to record nanosecond resolution part
of the file timestamps.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoarchive: use parseopt for local-only options
René Scharfe [Sun, 8 Mar 2009 18:21:53 +0000 (19:21 +0100)]
archive: use parseopt for local-only options

Replace the hand-rolled parsers that find and remove --remote and --exec
by a parseopt parser that also handles --output.

All three options only have a meaning if no remote server is used or on
the local side.  They must be rejected by upload-archive and should not
be sent to the server by archive.

We can't use a single parser for both remote and local side because the
remote end possibly understands a different set of options than the
local side.  A local parser would then wrongly accuse options valid on
the other side as being incorrect.

This patch implements a very forgiving parser that understands only the
three options mentioned above.  All others are passed to the normal,
complete parser in archive.c (running either locally in archive, or
remotely in upload-archive).  This normal parser definition contains
dummy entries for the three options, in order for them to appear in the
help screen.

The parseopt parser allows multiple occurrences of --remote and --exec
unlike the previous one; the one specified last wins.  This looseness
is acceptable, I think.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoparseopt: make usage optional
René Scharfe [Sun, 8 Mar 2009 18:16:58 +0000 (19:16 +0100)]
parseopt: make usage optional

Allow usagestr to be NULL and don't display any help screen in
this case.  This is useful to implement incremental parsers.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoparseopt: add PARSE_OPT_NO_INTERNAL_HELP
René Scharfe [Sun, 8 Mar 2009 18:15:08 +0000 (19:15 +0100)]
parseopt: add PARSE_OPT_NO_INTERNAL_HELP

Add a parseopt flag, PARSE_OPT_NO_INTERNAL_HELP, that turns off internal
handling of -h, --help and --help-all.  This allows the implementation
of custom help option handlers or incremental parsers.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoparseopt: add PARSE_OPT_KEEP_UNKNOWN
René Scharfe [Sun, 8 Mar 2009 18:12:47 +0000 (19:12 +0100)]
parseopt: add PARSE_OPT_KEEP_UNKNOWN

Add a parseopt flag, PARSE_OPT_KEEP_UNKNOWN, that can be used to keep
unknown options in argv, similar to the existing KEEP flags.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdjust js/remote-improvements and db/refspec-wildcard-in-the-middle
Junio C Hamano [Sun, 8 Mar 2009 08:12:33 +0000 (00:12 -0800)]
Adjust js/remote-improvements and db/refspec-wildcard-in-the-middle

The latter topic changes the definition of how refspec's src and dst side
is stored in-core; it used to be that the asterisk for pattern was
omitted, but now it is included.  The former topic handcrafts an old style
refspec to feed the refspec matching machinery that lacks the asterisk and
triggers an error.

This resolves the semantic clash between the two topics early before they
need to be merged to integration branches.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-remote.c: no "commented out" code, please
Junio C Hamano [Sun, 8 Mar 2009 08:10:33 +0000 (00:10 -0800)]
builtin-remote.c: no "commented out" code, please

And especially do not use // comment.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 8 Mar 2009 06:34:13 +0000 (22:34 -0800)]
Merge branch 'maint'

* maint:
  builtin-revert.c: release index lock when cherry-picking an empty commit
  document config --bool-or-int
  t1300: use test_must_fail as appropriate
  cleanup: add isascii()
  Documentation: fix badly indented paragraphs in "--bisect-all" description

15 years agoMerge branch 'maint-1.6.1' into maint
Junio C Hamano [Sun, 8 Mar 2009 05:00:27 +0000 (21:00 -0800)]
Merge branch 'maint-1.6.1' into maint

* maint-1.6.1:
  builtin-revert.c: release index lock when cherry-picking an empty commit

15 years agohttp.c: use strbuf API in quote_ref_url
Tay Ray Chuan [Sat, 7 Mar 2009 16:47:21 +0000 (00:47 +0800)]
http.c: use strbuf API in quote_ref_url

In addition, ''quote_ref_url'' inserts a slash between the base URL and
remote ref path only if needed. Previously, this insertion wasn't
contingent on the lack of a separating slash.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMove local variables to narrower scopes
Benjamin Kramer [Sat, 7 Mar 2009 20:02:26 +0000 (21:02 +0100)]
Move local variables to narrower scopes

These weren't used outside and can be safely moved

Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRemove unused function scope local variables
Benjamin Kramer [Sat, 7 Mar 2009 20:02:10 +0000 (21:02 +0100)]
Remove unused function scope local variables

These variables were unused and can be removed safely:

  builtin-clone.c::cmd_clone(): use_local_hardlinks, use_separate_remote
  builtin-fetch-pack.c::find_common(): len
  builtin-remote.c::mv(): symref
  diff.c::show_stats():show_stats(): total
  diffcore-break.c::should_break(): base_size
  fast-import.c::validate_raw_date(): date, sign
  fsck.c::fsck_tree(): o_sha1, sha1
  xdiff-interface.c::parse_num(): read_some

Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: fix diff --no-index /dev/null ...
Johannes Schindelin [Sat, 7 Mar 2009 15:51:33 +0000 (16:51 +0100)]
MinGW: fix diff --no-index /dev/null ...

When launching "diff --no-index" with a parameter "/dev/null", the MSys
bash converts the "/dev/null" to a "nul", which usually makes sense.  But

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-p4: remove tabs from usermap file
Pete Wyckoff [Fri, 27 Feb 2009 18:53:59 +0000 (10:53 -0800)]
git-p4: remove tabs from usermap file

Some users have tabs in their names, oddly enough.  This
causes problems when loading the usercache from disk,
as split separates the fields on the wrong tabs.  When
fast-import's parse_ident() tries to parse the committer
field, it is unhappy about the unbalanced <..> angle brackets.

It is easy enough to convert the tabs to single spaces.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd an (optional, since expensive) test for >2gb clones
Johannes Schindelin [Fri, 6 Mar 2009 09:48:53 +0000 (10:48 +0100)]
Add an (optional, since expensive) test for >2gb clones

Define GIT_TEST_CLONE_2GB=t if you want the test not to be skipped.

The test works by constructing a repository larger than 2gb, and then
cloning it.

The repository is forced larger than 2gb by setting compression and
delta depth to zero, and then adding just enough unique objects of
a given size.

The objects consist of a running decimal number in ASCII, padded by
spaces.  Should that break in the future, e.g. when pack v4 becomes
default, there is a commented-out call to test-genrandom which can be
substituted, but that uses more cycles than the current method.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRecord ns-timestamps if possible, but do not use it without USE_NSEC
Kjetil Barvik [Wed, 4 Mar 2009 17:47:40 +0000 (18:47 +0100)]
Record ns-timestamps if possible, but do not use it without USE_NSEC

Traditionally, the lack of USE_NSEC meant "do not record nor use the
nanosecond resolution part of the file timestamps".  To avoid problems on
filesystems that lose the ns part when the metadata is flushed to the disk
and then later read back in, disabling USE_NSEC has been a good idea in
general.

If you are on a filesystem without such an issue, it does not hurt to read
and store them in the cached stat data in the index entries even if your
git is compiled without USE_NSEC.  The index left with such a version of
git can be read by git compiled with USE_NSEC and it can make use of the
nanosecond part to optimize the check to see if the path on the filesystem
hsa been modified since we last looked at.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: teach fetch, pull, and push to complete their options
Jay Soffian [Fri, 6 Mar 2009 04:39:33 +0000 (23:39 -0500)]
bash completion: teach fetch, pull, and push to complete their options

fetch, pull, and push didn't know their options. They do now. merge's
options are factored into a variable so they can be shared between
_git_merge and _git_pull

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: refactor --strategy completion
Jay Soffian [Fri, 6 Mar 2009 16:30:44 +0000 (11:30 -0500)]
bash completion: refactor --strategy completion

The code to complete --strategy was duplicated between _git_rebase and
_git_merge, and is about to gain a third caller (_git_pull). This patch
factors it into its own function.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: fix completion issues with fetch, pull, and push
Jay Soffian [Fri, 6 Mar 2009 04:39:31 +0000 (23:39 -0500)]
bash completion: fix completion issues with fetch, pull, and push

Sverre Rabbelier noticed a completion issue with push:

 $ git push ori<tab>
 git push origin

 $ git push -f ori<tab>
 git push -f origin/

Markus Heidelberg pointed out that the issue extends to fetch and pull.

The reason is that the current code naively assumes that if
COMP_CWORD=2, it should complete a remote name, otherwise it should
complete a refspec. This assumption fails if there are any --options.

This patch fixes that issue by instead scanning COMP_CWORDS to see if
the remote has been completed yet (we now assume the first non-dashed
argument is the remote). The new logic is factored into a function,
shared by fetch, pull, and push.

The new function also properly handles '.' as the remote.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoBrown paper bag fix for MinGW 64-bit stat
Johannes Schindelin [Sat, 7 Mar 2009 14:37:18 +0000 (15:37 +0100)]
Brown paper bag fix for MinGW 64-bit stat

When overriding the identifier "stat" so that "struct stat" will be
substituted with "struct _stati64" everywhere, I tried to fix the calls
to the _function_ stat(), too, but I forgot to change the earlier
attempt "stat64" to "_stati64" there.

So, the stat() calls were overridden by calls to _stati64() instead.

Unfortunately, there is a function _stati64() so that I missed that
calls to stat() were not actually overridden by calls to mingw_lstat(),
but t4200-rerere.sh showed the error.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-revert.c: release index lock when cherry-picking an empty commit
Chris Johnsen [Sat, 7 Mar 2009 09:30:51 +0000 (03:30 -0600)]
builtin-revert.c: release index lock when cherry-picking an empty commit

When a cherry-pick of an empty commit is done, release the lock
held on the index.

The fix is the same as was applied to similar code in 4271666046.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoSupport '*' in the middle of a refspec
Daniel Barkalow [Sat, 7 Mar 2009 06:11:39 +0000 (01:11 -0500)]
Support '*' in the middle of a refspec

In order to keep the requirements strict, each * has to be a full path
component, and there may only be one * per side. This requirement is
enforced entirely by check_ref_format(); the matching implementation
will substitute the whatever matches the * in the lhs for the * in the
rhs.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoKeep '*' in pattern refspecs
Daniel Barkalow [Sat, 7 Mar 2009 06:11:36 +0000 (01:11 -0500)]
Keep '*' in pattern refspecs

In order to do anything more capable with refspecs, the first step is
to keep the entire input. Additionally, validate patterns by checking
for the ref matching the rules for a pattern as given by
check_ref_format(). This requires a slight change to
check_ref_format() to make it enforce the requirement that the '*'
immediately follow a '/'.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse the matching function to generate the match results
Daniel Barkalow [Sat, 7 Mar 2009 06:11:34 +0000 (01:11 -0500)]
Use the matching function to generate the match results

This puts all of the interpretation of the pattern representation in a
single function for easy manipulation.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse a single function to match names against patterns
Daniel Barkalow [Sat, 7 Mar 2009 06:11:29 +0000 (01:11 -0500)]
Use a single function to match names against patterns

This will help when the matching changes.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake clone parse the default refspec with the normal code
Daniel Barkalow [Fri, 6 Mar 2009 04:56:16 +0000 (23:56 -0500)]
Make clone parse the default refspec with the normal code

Instead of creating a refspec by hand, go through the refspec parsing
code, so that changes in the refspec storage will be accounted for.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: add support for coloring with external greps
René Scharfe [Sat, 7 Mar 2009 12:34:46 +0000 (13:34 +0100)]
grep: add support for coloring with external greps

Add the config variable color.grep.external, which can be used to
switch on coloring of external greps.  To enable auto coloring with
GNU grep, one needs to set color.grep.external to --color=always to
defeat the pager started by git grep.  The value of the config
variable will be passed to the external grep only if it would
colorize internal grep's output, so automatic terminal detected
works.  The default is to not pass any option, because the external
grep command could be a program without color support.

Also set the environment variables GREP_COLOR and GREP_COLORS to
pass the configured color for matches to the external grep.  This
works with GNU grep; other variables could be added as needed.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: color patterns in output
René Scharfe [Sat, 7 Mar 2009 12:32:32 +0000 (13:32 +0100)]
grep: color patterns in output

Coloring matches makes them easier to spot in the output.

Add two options and two parameters: color.grep (to turn coloring on
or off), color.grep.match (to set the color of matches), --color
and --no-color (to turn coloring on or off, respectively).

The output of external greps is not changed.

This patch is based on earlier ones by Nguyễn Thái Ngọc Duy and
Thiago Alves.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: add pmatch and eflags arguments to match_one_pattern()
René Scharfe [Sat, 7 Mar 2009 12:30:27 +0000 (13:30 +0100)]
grep: add pmatch and eflags arguments to match_one_pattern()

Push pmatch and eflags to the callers of match_one_pattern(), which
allows them to specify regex execution flags and to get the location
of a match.

Since we only use the first element of the matches array and aren't
interested in submatches, no provision is made for callers to
provide a larger array.

eflags are ignored for fixed patterns, but that's OK, since they
only have a meaning in connection with regular expressions
containing ^ or $.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: remove grep_opt argument from match_expr_eval()
René Scharfe [Sat, 7 Mar 2009 12:28:40 +0000 (13:28 +0100)]
grep: remove grep_opt argument from match_expr_eval()

The only use of the struct grep_opt argument of match_expr_eval()
is to pass the option word_regexp to match_one_pattern().  By adding
a pattern flag for it we can reduce the number of function arguments
of these two functions, as a cleanup and preparation for adding more
in the next patch.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: micro-optimize hit collection for AND nodes
René Scharfe [Sat, 7 Mar 2009 12:27:15 +0000 (13:27 +0100)]
grep: micro-optimize hit collection for AND nodes

In addition to returning if an expression matches a line,
match_expr_eval() updates the expression's hit flag if the parameter
collect_hits is set.  It never sets collect_hits for children of AND
nodes, though, so their hit flag will never be updated.  Because of
that we can return early if the first child didn't match, no matter
if collect_hits is set or not.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodocument config --bool-or-int
Jeff King [Sat, 7 Mar 2009 17:14:06 +0000 (12:14 -0500)]
document config --bool-or-int

The documentation is just a pointer to the --bool and --int
options, but it makes sense to at least mention that it
exists.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconfig: set help text for --bool-or-int
Jeff King [Sat, 7 Mar 2009 17:14:05 +0000 (12:14 -0500)]
config: set help text for --bool-or-int

The conversion to parse_opt left this as NULL; on glibc
systems, the usage message prints

   --bool-or-int   (null)

and on other ones, segfaults.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot1300: use test_must_fail as appropriate
Jeff King [Sat, 7 Mar 2009 17:14:04 +0000 (12:14 -0500)]
t1300: use test_must_fail as appropriate

Some of the tests checked the exit code manually, even going
so far as to run git outside of the test_expect harness.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocleanup: add isascii()
René Scharfe [Sat, 7 Mar 2009 13:06:49 +0000 (14:06 +0100)]
cleanup: add isascii()

Add a standard definition of isascii() and use it to replace an open
coded high-bit test in pretty.c.  While we're there, write the ESC
char as the more commonly used '\033' instead of as 0x1b to enhance
its grepability.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix badly indented paragraphs in "--bisect-all" description
Christian Couder [Sat, 7 Mar 2009 12:37:24 +0000 (13:37 +0100)]
Documentation: fix badly indented paragraphs in "--bisect-all" description

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes to 1.6.3
Junio C Hamano [Fri, 6 Mar 2009 09:37:22 +0000 (01:37 -0800)]
Update draft release notes to 1.6.3

15 years agoMake git blame's date output format configurable, like git log
Eugene Letuchy [Fri, 20 Feb 2009 22:51:11 +0000 (14:51 -0800)]
Make git blame's date output format configurable, like git log

Add the following:

 - git config value blame.date that expects one of the git log date
   formats (e.g. relative,local,default,iso,...);

 - git blame command line option --date expects one of the git
   log date formats;

 - documentation in blame-options.txt;

 - git blame uses the appropriate date.c functions and enums to
   make sense of the date format and provide appropriate data;

git blame continues to line up the output columns by padding the date
column up to the max width of the chosen date format.

The date format for git blame without both blame.date and --date continues
to be ISO for backwards compatibility.

git annotate ignores the date format specifiers and continues to uses the
ISO format, as before.

Signed-off-by: Eugene Letuchy <eugene@facebook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'en/maint-hash-object'
Junio C Hamano [Thu, 5 Mar 2009 23:58:42 +0000 (15:58 -0800)]
Merge branch 'en/maint-hash-object'

* en/maint-hash-object:
  Ensure proper setup of git_dir for git-hash-object

Conflicts:
hash-object.c

15 years agoMerge branch 'jc/blame'
Junio C Hamano [Thu, 5 Mar 2009 23:41:43 +0000 (15:41 -0800)]
Merge branch 'jc/blame'

* jc/blame:
  blame: show "previous" information in --porcelain/--incremental format
  git-blame: refactor code to emit "porcelain format" output

15 years agoMerge branch 'ns/pretty-format'
Junio C Hamano [Thu, 5 Mar 2009 23:41:43 +0000 (15:41 -0800)]
Merge branch 'ns/pretty-format'

* ns/pretty-format:
  bash completion: add --format= and --oneline options for "git log"
  Add tests for git log --pretty, --format and --oneline.
  Add --oneline that is a synonym to "--pretty=oneline --abbrev-commit"
  Give short-hands to --pretty=tformat:%formatstring
  Add --format that is a synonym to --pretty

15 years agoMerge branch 'jk/sane-relative-time'
Junio C Hamano [Thu, 5 Mar 2009 23:41:43 +0000 (15:41 -0800)]
Merge branch 'jk/sane-relative-time'

* jk/sane-relative-time:
  never fallback relative times to absolute

15 years agoMerge branch 'fc/config-editor'
Junio C Hamano [Thu, 5 Mar 2009 23:41:42 +0000 (15:41 -0800)]
Merge branch 'fc/config-editor'

* fc/config-editor:
  git config: trivial cleanup for editor action
  git config: codestyle cleanups
  config: Add new option to open an editor.

15 years agoMerge branch 'js/send-email'
Junio C Hamano [Thu, 5 Mar 2009 23:41:42 +0000 (15:41 -0800)]
Merge branch 'js/send-email'

* js/send-email:
  send-email: add --confirm option and configuration setting
  send-email: don't create temporary compose file until it is needed
  send-email: --suppress-cc improvements
  send-email: handle multiple Cc addresses when reading mbox message
  send-email: allow send-email to run outside a repo

15 years agoMerge branch 'sg/rerere-cleanup'
Junio C Hamano [Thu, 5 Mar 2009 23:41:42 +0000 (15:41 -0800)]
Merge branch 'sg/rerere-cleanup'

* sg/rerere-cleanup:
  rerere: remove duplicated functions

15 years agoMerge branch 'jc/add-p-unquote'
Junio C Hamano [Thu, 5 Mar 2009 23:41:41 +0000 (15:41 -0800)]
Merge branch 'jc/add-p-unquote'

* jc/add-p-unquote:
  git-add -i/-p: learn to unwrap C-quoted paths

15 years agoMerge branch 'jw/imap-preformatted-html'
Junio C Hamano [Thu, 5 Mar 2009 23:41:41 +0000 (15:41 -0800)]
Merge branch 'jw/imap-preformatted-html'

* jw/imap-preformatted-html:
  imap.preformattedHTML to tell Thunderbird to send non-flowed text

15 years agoMerge branch 'jw/format-patch-attach'
Junio C Hamano [Thu, 5 Mar 2009 23:41:41 +0000 (15:41 -0800)]
Merge branch 'jw/format-patch-attach'

* jw/format-patch-attach:
  Enable setting attach as the default in .gitconfig for git-format-patch.

15 years agoMerge branch 'sr/force-rebase'
Junio C Hamano [Thu, 5 Mar 2009 23:41:40 +0000 (15:41 -0800)]
Merge branch 'sr/force-rebase'

* sr/force-rebase:
  Teach rebase to rebase even if upstream is up to date

15 years agoMerge branch 'fg/exclude-bq'
Junio C Hamano [Thu, 5 Mar 2009 23:41:39 +0000 (15:41 -0800)]
Merge branch 'fg/exclude-bq'

* fg/exclude-bq:
  Support "\" in non-wildcard exclusion entries

15 years agoMerge branch 'dm/add-i-edit-abort'
Junio C Hamano [Thu, 5 Mar 2009 23:41:39 +0000 (15:41 -0800)]
Merge branch 'dm/add-i-edit-abort'

* dm/add-i-edit-abort:
  add -i: revisit hunk on editor failure

15 years agoMerge branch 'tp/completion'
Junio C Hamano [Thu, 5 Mar 2009 23:41:39 +0000 (15:41 -0800)]
Merge branch 'tp/completion'

* tp/completion:
  Fixup: Add bare repository indicator for __git_ps1
  Add bare repository indicator for __git_ps1
  completion: More fixes to prevent unbound variable errors
  completion: Better __git_ps1 support when not in working directory
  completion: Use consistent if [...] convention, not "test"
  completion: For consistency, change "git rev-parse" to __gitdir calls

15 years agoMerge branch 'js/branch-symref'
Junio C Hamano [Thu, 5 Mar 2009 23:41:35 +0000 (15:41 -0800)]
Merge branch 'js/branch-symref'

* js/branch-symref:
  add basic branch display tests
  branch: clean up repeated strlen
  Avoid segfault with 'git branch' when the HEAD is detached
  builtin-branch: improve output when displaying remote branches

Conflicts:
builtin-branch.c

15 years agoMerge branch 'al/ansi-color'
Junio C Hamano [Thu, 5 Mar 2009 23:41:19 +0000 (15:41 -0800)]
Merge branch 'al/ansi-color'

* al/ansi-color:
  builtin-branch.c: Rename branch category color names
  Clean up use of ANSI color sequences

15 years agoMerge branch 'js/valgrind'
Junio C Hamano [Thu, 5 Mar 2009 23:41:18 +0000 (15:41 -0800)]
Merge branch 'js/valgrind'

* js/valgrind:
  valgrind: do not require valgrind 3.4.0 or newer
  test-lib: avoid assuming that templates/ are in the GIT_EXEC_PATH
  Tests: let --valgrind imply --verbose and --tee
  Add a script to coalesce the valgrind outputs
  t/Makefile: provide a 'valgrind' target
  test-lib.sh: optionally output to test-results/$TEST.out, too
  Valgrind support: check for more than just programming errors
  valgrind: ignore ldso and more libz errors
  Add valgrind support in test scripts

15 years agoMinGW: 64-bit file offsets
Johannes Schindelin [Thu, 5 Mar 2009 16:05:12 +0000 (17:05 +0100)]
MinGW: 64-bit file offsets

The type 'off_t' should be used everywhere so that the bit-depth of that
type can be adjusted in the standard C library, and you just need to
recompile your program to benefit from the extended precision.

Only that it was not done that way in the MS runtime library.

This patch reroutes off_t to off64_t and provides the other necessary
changes so that finally, clones larger than 2 gigabyte work on Windows
(provided you are on a file system that allows files larger than 2gb).

Initial patch by Sickboy <sb@dev-heaven.net>.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation - More examples for git bisect
John Tapsell [Thu, 5 Mar 2009 12:36:14 +0000 (12:36 +0000)]
Documentation - More examples for git bisect

Including passing parameters to the programs, and running more
complicated checks without requiring a seperate shell script.

Signed-off-by: John Tapsell <johnflux@gmail.com>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDraft release notes: Carry forward the warning for behaviour changes
Junio C Hamano [Thu, 5 Mar 2009 22:50:00 +0000 (14:50 -0800)]
Draft release notes: Carry forward the warning for behaviour changes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 5 Mar 2009 07:43:23 +0000 (23:43 -0800)]
Merge branch 'maint'

* maint:
  Make the 'lock file' exists error more informative

15 years agoimprove missing repository error message
Jeff King [Wed, 4 Mar 2009 08:32:29 +0000 (03:32 -0500)]
improve missing repository error message

Certain remote commands, when asked to do something in a
particular directory that was not actually a git repository,
would say "unable to chdir or not a git archive". The
"chdir" bit is an unnecessary detail, and the term "git
archive" is much less common these days than "git repository".

So let's switch them all to:

  fatal: '%s' does not appear to be a git repository

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake the 'lock file' exists error more informative
John Tapsell [Wed, 4 Mar 2009 15:00:44 +0000 (15:00 +0000)]
Make the 'lock file' exists error more informative

It looks like someone did 90% of the work, then forgot to actually use
the function in one place.

Also the helper function did not use the correct variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-archive: add --output=<file> to send output to a file
Carlos Manuel Duclos Vergara [Mon, 16 Feb 2009 17:20:25 +0000 (18:20 +0100)]
git-archive: add --output=<file> to send output to a file

When archiving a repository there is no way to specify a file as output.
This patch adds a new option "--output" that redirects the output to a
file instead of stdout.

Signed-off-by: Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoImprove error message for git-filter-branch
John Tapsell [Thu, 19 Feb 2009 07:36:35 +0000 (07:36 +0000)]
Improve error message for git-filter-branch

Tell the user that a backup (original) already exists, and how to solve
this problem (with -f option)

Signed-off-by: John Tapsell <johnflux@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGoogle has renamed the imap folder
John Tapsell [Thu, 19 Feb 2009 07:36:11 +0000 (07:36 +0000)]
Google has renamed the imap folder

Also add a comment that the web interface wraps the lines

Signed-off-by: John Tapsell <johnflux@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoModify description file to say what this file is
John Tapsell [Thu, 19 Feb 2009 07:36:00 +0000 (07:36 +0000)]
Modify description file to say what this file is

A lot of people see this message for the first time on the gitweb
interface, where there is no clue as to what 'this file' means.

Signed-off-by: John Tapsell <johnflux@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorev-list: estimate number of bisection step left
Christian Couder [Sat, 21 Feb 2009 08:26:01 +0000 (09:26 +0100)]
rev-list: estimate number of bisection step left

This patch teaches "git rev-list --bisect-vars" to output an estimate
of the number of bisection step left _after the current one_ along with
the other variables it already outputs.

This patch also makes "git-bisect.sh" display this number of steps left
_after the current one_, along with the estimate of the number of
revisions left to test (after the current one).

Here is a table to help analyse what should be the best estimate for
the number of bisect steps left.

N : linear case                    --> probabilities --> best
-------------------------------------------------------------
1 : G-B                            --> 0             --> 0
2 : G-U1-B                         --> 0             --> 0
3 : G-U1-U2-B                      --> 0(1/3) 1(2/3) --> 1
4 : G-U1-U2-U3-B                   --> 1             --> 1
5 : G-U1-U2-U3-U4-B                --> 1(3/5) 2(2/5) --> 1
6 : G-U1-U2-U3-U4-U5-B             --> 1(2/6) 2(4/6) --> 2
7 : G-U1-U2-U3-U4-U5-U6-B          --> 1(1/7) 2(6/7) --> 2
8 : G-U1-U2-U3-U4-U5-U6-U7-B       --> 2             --> 2
9 : G-U1-U2-U3-U4-U5-U6-U7-U8-B    --> 2(7/9) 3(2/9) --> 2
10: G-U1-U2-U3-U4-U5-U6-U7-U8-U9-B --> 2(6/10)3(4/10)--> 2

In the column "N", there is the number of revisions that could _now_
be the first bad commit we are looking for.

The "linear case" column describes the linear history corresponding to
the number in column N. G means good, B means bad, and Ux means
unknown. Note that the first bad revision we are looking for can be
any Ux or B.

In the "probabilities" column, there are the different outcomes in
number of steps with the odds of each outcome in parenthesis
corresponding to the linear case.

The "best" column gives the most accurate estimate among the different
outcomes in the "probabilities" column.

We have the following:

best(2^n) == n - 1

and for any x between 0 included and 2^n excluded, the probability for
n - 1 steps left looks like:

P(2^n + x) == (2^n - x) / (2^n + x)

and P(2^n + x) < 0.5 means 2^n < 3x

So the algorithm used in this patch calculates 2^n and x, and then
choose between returning n - 1 and n.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix neglect of diff_setup()/diff_setup_done() symmetry.
Keith Cascio [Tue, 17 Feb 2009 02:59:00 +0000 (18:59 -0800)]
Fix neglect of diff_setup()/diff_setup_done() symmetry.

Code that calls diff_setup(), including via init_revisions(), should later call
diff_setup_done(), possibly via setup_revisions(). Failure to do so could cause
errors, especially in the future when we add responsibilities to
diff_setup_done(). This instance causes no known errors with the present code.
But it resulted in an error with an experimental patch.

Signed-off-by: Keith Cascio <keith@cs.ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse DIFF_XDL_SET/DIFF_OPT_SET instead of raw bit-masking
Keith Cascio [Tue, 17 Feb 2009 03:26:49 +0000 (19:26 -0800)]
Use DIFF_XDL_SET/DIFF_OPT_SET instead of raw bit-masking

Signed-off-by: Keith Cascio <keith@cs.ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoBeginning of 1.6.3 development track
Junio C Hamano [Wed, 4 Mar 2009 08:41:01 +0000 (00:41 -0800)]
Beginning of 1.6.3 development track

15 years agoBeginning of 1.6.2 maintenance track
Junio C Hamano [Wed, 4 Mar 2009 08:37:50 +0000 (00:37 -0800)]
Beginning of 1.6.2 maintenance track

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.6.2 v1.6.2
Junio C Hamano [Wed, 4 Mar 2009 07:02:16 +0000 (23:02 -0800)]
GIT 1.6.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake git-clone respect branch.autosetuprebase
Junio C Hamano [Wed, 4 Mar 2009 06:29:55 +0000 (22:29 -0800)]
Make git-clone respect branch.autosetuprebase

When git-clone creates an initial branch it was not checking the
branch.autosetuprebase configuration option (which may exist in
~/.gitconfig).  Refactor the code used by "git branch" to create
a new branch, and use it instead of the insufficiently duplicated code
in builtin-clone.

Changes are partly, and the test is mostly, based on the previous work by
Pat Notz.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit submodule: Fix adding of submodules at paths with ./, .. and //
Michael J Gruber [Tue, 3 Mar 2009 15:08:21 +0000 (16:08 +0100)]
git submodule: Fix adding of submodules at paths with ./, .. and //

Make 'git submodule add' normalize the submodule path in the
same way as 'git ls-files' does, so that 'git submodule init' looks up
the information in .gitmodules with the same key under which 'git
submodule add' stores it.

This fixes 4 known breakages.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit submodule: Add test cases for git submodule add
Michael J Gruber [Tue, 3 Mar 2009 15:08:20 +0000 (16:08 +0100)]
git submodule: Add test cases for git submodule add

Add simple test cases for adding and initialising submodules. The
init step is necessary in order to verify the added information.

The second test exposes a known breakage due to './' in the path: git
ls-files simplifies the path but git add does not, which leads to git
init looking for different lines in .gitmodules than git add adds.

The other tests add test cases for '//' and '..' in the path which
currently fail for the same reason.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: Typo / spelling / formatting fixes
Mike Ralphson [Tue, 3 Mar 2009 19:29:22 +0000 (19:29 +0000)]
Documentation: Typo / spelling / formatting fixes

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: Expand a couple of abbreviations
Mike Ralphson [Tue, 3 Mar 2009 19:29:21 +0000 (19:29 +0000)]
Documentation: Expand a couple of abbreviations

These may not be obvious to non-native English speakers

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: Typos / spelling fixes in RelNotes
Mike Ralphson [Tue, 3 Mar 2009 19:29:20 +0000 (19:29 +0000)]
Documentation: Typos / spelling fixes in RelNotes

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation/git-archive.txt: Note attributes
Roy Lee [Tue, 3 Mar 2009 16:49:29 +0000 (00:49 +0800)]
Documentation/git-archive.txt: Note attributes

Signed-off-by: Roy Lee <roylee17@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorebase -i: avoid 'git reset' when possible
Johannes Schindelin [Tue, 3 Mar 2009 09:55:31 +0000 (10:55 +0100)]
rebase -i: avoid 'git reset' when possible

When picking commits whose parents have not changed, we do not need to
rewrite the commit.  We do not need to reset the working directory to
the parent's state, either.

Requested by Sverre Rabbelier.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoclone: run post-checkout hook when checking out
Jeff King [Tue, 3 Mar 2009 05:37:51 +0000 (00:37 -0500)]
clone: run post-checkout hook when checking out

The mental model for clone is that the branch is "checked
out" (and it even says this in Documentation/git-clone.txt:
"...creates and checks out an initial branch"). Therefore it
is reasonable for users to expect that any post-checkout
hook would be run.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosend-email: add --confirm option and configuration setting
Jay Soffian [Tue, 3 Mar 2009 04:52:18 +0000 (23:52 -0500)]
send-email: add --confirm option and configuration setting

send-email violates the principle of least surprise by automatically
cc'ing additional recipients without confirming this with the user.

This patch teaches send-email a --confirm option. It takes the
following values:

 --confirm=always   always confirm before sending
 --confirm=never    never confirm before sending
 --confirm=cc       confirm before sending when send-email has
                    automatically added addresses from the patch to
                    the Cc list
 --confirm=compose  confirm before sending the first message when
                    using --compose. (Needed to maintain backwards
                    compatibility with existing behavior.)
 --confirm=auto     'cc' + 'compose'

If sendemail.confirm is unconfigured, the option defaults to 'compose'
if any suppress-Cc related options have been used, otherwise it defaults
to 'auto'.

Unfortunately, it is impossible to introduce this patch such that it
helps new users without potentially annoying some existing users. We
attempt to mitigate the latter by:

 * Allowing the user to set 'git config sendemail.confirm never'
 * Allowing the user to say 'all' after the first prompt to not be
   prompted on remaining emails during the same invocation.
 * Telling the user about the 'sendemail.confirm' setting if it is
   unconfigured whenever we prompt due to Cc before sending.
 * Only prompting if no --suppress related options have been passed, as
   using such an option is likely to indicate an experienced send-email
   user.

There is a slight fib in message informing the user of the
sendemail.confirm setting and this is intentional. Setting 'auto'
differs from leaving sendemail.confirm unset in two ways: 1) 'auto'
obviously squelches the informational message; 2) 'auto' prompts when
the Cc list has been expanded even in the presence of a --suppress
related option, where leaving sendemail.confirm unset does not. This is
intentional to keep the message simple, and to avoid adding another
sendemail.confirm value ('auto-except-suppress'?).

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