Code

git.git
15 years agoconfigure: reorganize flow of argument checks
Ben Walton [Thu, 12 Mar 2009 19:20:07 +0000 (15:20 -0400)]
configure: reorganize flow of argument checks

Move the argument tests from the 'site overrides' so that they are
ahead of any library tests.  This allows for library tests to take
user specified paths into account.  The intent here is to avoid things
like NO_DEFLATE_BOUND being set due to finding old zlib when the user
has specified an alternate location for zlib.  (Ignore the fact that
properly set *FLAGS can avoid solve this issue.)

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconfigure: ensure settings from user are also usable in the script
Ben Walton [Thu, 12 Mar 2009 19:20:06 +0000 (15:20 -0400)]
configure: ensure settings from user are also usable in the script

Allow things set by the user (--with-lib, --with-iconv, etc) to set
variables for use by other parts of the script.  Display values as
they're set.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 11 Mar 2009 21:37:26 +0000 (14:37 -0700)]
Merge branch 'maint'

* maint:
  Update draft release notes for 1.6.2.1

15 years agoUpdate draft release notes for 1.6.2.1
Junio C Hamano [Wed, 11 Mar 2009 21:37:15 +0000 (14:37 -0700)]
Update draft release notes for 1.6.2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'js/maint-send-email' into maint
Junio C Hamano [Wed, 11 Mar 2009 21:01:24 +0000 (14:01 -0700)]
Merge branch 'js/maint-send-email' into maint

* js/maint-send-email:
  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 'jk/sane-relative-time' into maint
Junio C Hamano [Wed, 11 Mar 2009 20:59:38 +0000 (13:59 -0700)]
Merge branch 'jk/sane-relative-time' into maint

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

15 years agoMerge branch 'jc/maint-add-p-unquote' into maint
Junio C Hamano [Wed, 11 Mar 2009 20:55:49 +0000 (13:55 -0700)]
Merge branch 'jc/maint-add-p-unquote' into maint

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

15 years agoMerge branch 'fg/maint-exclude-bq' into maint
Junio C Hamano [Wed, 11 Mar 2009 20:53:53 +0000 (13:53 -0700)]
Merge branch 'fg/maint-exclude-bq' into maint

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

15 years agoMerge branch 'en/maint-hash-object' into maint
Junio C Hamano [Wed, 11 Mar 2009 20:51:59 +0000 (13:51 -0700)]
Merge branch 'en/maint-hash-object' into maint

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

Conflicts:
hash-object.c

15 years agoMerge branch 'mg/maint-submodule-normalize-path'
Junio C Hamano [Wed, 11 Mar 2009 20:50:29 +0000 (13:50 -0700)]
Merge branch 'mg/maint-submodule-normalize-path'

* mg/maint-submodule-normalize-path:
  git submodule: Fix adding of submodules at paths with ./, .. and //
  git submodule: Add test cases for git submodule add

15 years agoMerge branch 'jc/maint-1.6.0-keep-pack'
Junio C Hamano [Wed, 11 Mar 2009 20:49:56 +0000 (13:49 -0700)]
Merge branch 'jc/maint-1.6.0-keep-pack'

* jc/maint-1.6.0-keep-pack:
  is_kept_pack(): final clean-up
  Simplify is_kept_pack()
  Consolidate ignore_packed logic more
  has_sha1_kept_pack(): take "struct rev_info"
  has_sha1_pack(): refactor "pretend these packs do not exist" interface
  git-repack: resist stray environment variable

15 years agoMerge branch 'rs/memmem'
Junio C Hamano [Wed, 11 Mar 2009 20:49:42 +0000 (13:49 -0700)]
Merge branch 'rs/memmem'

* rs/memmem:
  optimize compat/ memmem()
  diffcore-pickaxe: use memmem()

15 years agoMerge branch 'tv/rebase-stat'
Junio C Hamano [Wed, 11 Mar 2009 20:49:11 +0000 (13:49 -0700)]
Merge branch 'tv/rebase-stat'

* tv/rebase-stat:
  git-pull: Allow --stat and --no-stat to be used with --rebase
  git-rebase: Add --stat and --no-stat for producing diffstat on rebase

15 years agoMerge branch 'jk/clone-post-checkout'
Junio C Hamano [Wed, 11 Mar 2009 20:48:31 +0000 (13:48 -0700)]
Merge branch 'jk/clone-post-checkout'

* jk/clone-post-checkout:
  clone: run post-checkout hook when checking out

15 years agoMerge branch 'tr/format-patch-thread'
Junio C Hamano [Wed, 11 Mar 2009 20:48:07 +0000 (13:48 -0700)]
Merge branch 'tr/format-patch-thread'

* tr/format-patch-thread:
  format-patch: support deep threading
  format-patch: thread as reply to cover letter even with in-reply-to
  format-patch: track several references
  format-patch: threading test reactivation

Conflicts:
builtin-log.c

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 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 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 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 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 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 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 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 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 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 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>
15 years agogit-pull: Allow --stat and --no-stat to be used with --rebase
Tor Arne Vestbø [Sun, 1 Mar 2009 21:28:28 +0000 (22:28 +0100)]
git-pull: Allow --stat and --no-stat to be used with --rebase

Forwards the --stat, --no-stat, and --summary options on to git-rebase.

Signed-off-by: Tor Arne Vestbø <torarnv@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-rebase: Add --stat and --no-stat for producing diffstat on rebase
Tor Arne Vestbø [Sun, 1 Mar 2009 22:11:38 +0000 (23:11 +0100)]
git-rebase: Add --stat and --no-stat for producing diffstat on rebase

The behavior of --verbose is unchanged, but uses a different state
variable internally, so that the meaning of verbose output may be
expanded without affecting the diffstat. This is also reflected in
the documentation.

The configuration option rebase.stat works the same was as merg.stat,
but the default is currently false.

Signed-off-by: Tor Arne Vestbø <torarnv@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agooptimize compat/ memmem()
René Scharfe [Mon, 2 Mar 2009 23:19:30 +0000 (00:19 +0100)]
optimize compat/ memmem()

When memmem() was imported from glibc 2.2 into compat/, an optimization
was dropped in the process, in order to make the code smaller and simpler.
It was OK because memmem() wasn't used in performance-critical code.  Now
the situation has changed and we can benefit from this optimization.

The trick is to avoid calling memcmp() if the first character of the needle
already doesn't match.  Checking one character directly is much cheaper
than the function call overhead.  We keep the first character of the needle
in the variable named point and the rest in the one named tail.

The following commands were run in a Linux kernel repository and timed, the
best of five results is shown:

  $ STRING='Ensure that the real time constraints are schedulable.'
  $ git log -S"$STRING" HEAD -- kernel/sched.c >/dev/null

On Windows Vista x64, before:

  real    0m8.470s
  user    0m0.000s
  sys     0m0.000s

And after the patch:

  real    0m1.887s
  user    0m0.000s
  sys     0m0.000s

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiffcore-pickaxe: use memmem()
René Scharfe [Mon, 2 Mar 2009 23:00:55 +0000 (00:00 +0100)]
diffcore-pickaxe: use memmem()

Use memmem() instead of open-coding it.  The system libraries usually have a
much faster version than the memcmp()-loop here.  Even our own fall-back in
compat/, which is used on Windows, is slightly faster.

The following commands were run in a Linux kernel repository and timed, the
best of five results is shown:

  $ STRING='Ensure that the real time constraints are schedulable.'
  $ git log -S"$STRING" HEAD -- kernel/sched.c >/dev/null

On Ubuntu 8.10 x64, before (v1.6.2-rc2):

  8.09user 0.04system 0:08.14elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+30952minor)pagefaults 0swaps

And with the patch:

  1.50user 0.04system 0:01.54elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+30645minor)pagefaults 0swaps

On Fedora 10 x64, before:

  8.34user 0.05system 0:08.39elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+29268minor)pagefaults 0swaps

And with the patch:

  1.15user 0.05system 0:01.20elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+32253minor)pagefaults 0swaps

On Windows Vista x64, before:

  real    0m9.204s
  user    0m0.000s
  sys     0m0.000s

And with the patch:

  real    0m8.470s
  user    0m0.000s
  sys     0m0.000s

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: minor grammatical fixes.
David J. Mellor [Mon, 2 Mar 2009 06:42:44 +0000 (22:42 -0800)]
Documentation: minor grammatical fixes.

The final hunk in this patch corrects what appears to be a typo:

of --> or

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: minor grammatical fixes.
David J. Mellor [Mon, 2 Mar 2009 06:38:36 +0000 (22:38 -0800)]
Documentation: minor grammatical fixes.

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: minor grammatical fixes.
David J. Mellor [Mon, 2 Mar 2009 06:37:41 +0000 (22:37 -0800)]
Documentation: minor grammatical fixes.

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3400-rebase: Move detached HEAD check earlier
Johannes Sixt [Sun, 1 Mar 2009 10:20:03 +0000 (11:20 +0100)]
t3400-rebase: Move detached HEAD check earlier

Short story: There is a section in t3400 that tests fundamental rebase
properties.  3ec7371f (Add two extra tests for git rebase, 2009-02-09)
added a check that rebase works on a detached HEAD, but the test was put
near the end of the file.  This moves it to a more suitable place.

Long story: The test that preceded the one in question tests that a
rebased commit degrades from a content change with mode change to a
mere mode change.  But on Windows, where we have core.filemode=false,
the original commit did not record the mode change, and so the rebase
operation did not rebase anything.  This caused the subsequent detached
HEAD test to fail.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Mon, 2 Mar 2009 06:20:52 +0000 (22:20 -0800)]
Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix possible infinite loop and display corruption

15 years agogitk: Fix possible infinite loop and display corruption
Paul Mackerras [Sun, 1 Mar 2009 22:38:17 +0000 (09:38 +1100)]
gitk: Fix possible infinite loop and display corruption

This fixes an issue reported by Johannes Sixt on the git mailing list:

> This recipe sends gitk into an endless loop. In git.git do:
>
> cd t
> # remove chmod a+x A near the end of the file
> sed -i 's/chmod/: chmod/' t3400-rebase.sh
> sh t3400-rebase.sh --debug
> cd trash\ directory.t3400-rebase/
> gitk master modechange modechange@{1}
>
>
> I briefly see the history chart, but the dot that should be modechange@{1}
> is missing. One automatically selected commit is shown in the diff section
> below. But then the commit list is cleared and gitk goes into an infinite
> loop.
>
> Things work alright if either modechange@{1} is dropped, or the 'chmod'
> line is left unchanged, which is a bit strange.
>
> This is with git version 1.6.1.2.390.gba743

There were actually two problems.  This recipe created a situation where
git log would output a child commit after its parent.  This meant that
we called fix_reversal which called splitvarc, which should call modify_arc
to note the fact that it has modified the arc that it has just split.  It
wasn't, which meant that displayorder and other variables got into an
inconsistent state (a commit appearing twice in displayorder).

This then meant that the targetrow/targetid logic in drawvisible thought
it need to redraw each time.  That, together with the fact that drawvisible
called drawcommits which called drawvisible if a redraw was needed, led
to the infinite loop.

In fact drawvisible is now the only caller of drawcommits.  Thus, the
start and end row arguments to drawcommits always encompass the whole
visible area, so drawcommits doesn't need to call drawvisible to redraw;
it just needs to clear the screen and draw what it's been asked to.

This fixes these two problems by adding a call to modify_arc in
splitvarc and by taking out the call to drawvisible in drawcommits.
It also removes an unrelated left-over debugging puts in external_blame.

Signed-off-by: Paul Mackerras <paulus@samba.org>