Code

git.git
13 years agoGit 1.6.6.3 v1.6.6.3
Junio C Hamano [Wed, 15 Dec 2010 19:32:57 +0000 (11:32 -0800)]
Git 1.6.6.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.6.5.9 v1.6.5.9
Junio C Hamano [Wed, 15 Dec 2010 19:27:41 +0000 (11:27 -0800)]
Git 1.6.5.9

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.6.4.5 v1.6.4.5
Junio C Hamano [Wed, 15 Dec 2010 19:19:11 +0000 (11:19 -0800)]
Git 1.6.4.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb: Introduce esc_attr to escape attributes of HTML elements
Jakub Narebski [Tue, 14 Dec 2010 23:34:01 +0000 (00:34 +0100)]
gitweb: Introduce esc_attr to escape attributes of HTML elements

It is needed only to escape attributes of handcrafted HTML elements,
and not those generated using CGI.pm subroutines / methods for HTML
generation.

While at it, add esc_url and esc_html where needed, and prefer to use
CGI.pm HTML generating methods than handcrafted HTML code.  Most of
those are probably unnecessary (could be exploited only by person with
write access to gitweb config, or at least access to the repository).

This fixes CVE-2010-3906

Reported-by: Emanuele Gentili <e.gentili@tigersecurity.it>
Helped-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.6.5' into maint-1.6.6
Junio C Hamano [Mon, 26 Jul 2010 04:52:29 +0000 (21:52 -0700)]
Merge branch 'maint-1.6.5' into maint-1.6.6

* maint-1.6.5:
  request-pull.txt: Document -p option
  Check size of path buffer before writing into it
  rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option

14 years agorequest-pull.txt: Document -p option
Stephen Boyd [Fri, 23 Jul 2010 16:31:27 +0000 (09:31 -0700)]
request-pull.txt: Document -p option

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.6.4' into maint-1.6.5
Junio C Hamano [Mon, 26 Jul 2010 04:51:58 +0000 (21:51 -0700)]
Merge branch 'maint-1.6.4' into maint-1.6.5

* maint-1.6.4:
  Check size of path buffer before writing into it
  rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option

14 years agoCheck size of path buffer before writing into it
Greg Brockman [Tue, 20 Jul 2010 04:46:21 +0000 (00:46 -0400)]
Check size of path buffer before writing into it

This prevents a buffer overrun that could otherwise be triggered by
creating a file called '.git' with contents

  gitdir: (something really long)

Signed-off-by: Greg Brockman <gdb@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
Uwe Kleine-König [Tue, 6 Jul 2010 14:46:05 +0000 (16:46 +0200)]
rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option

The ?: operator has a lower priority than |, so the implicit associativity
made the 6th argument of parse_options be PARSE_OPT_KEEP_DASHDASH if
keep_dashdash was true discarding PARSE_OPT_STOP_AT_NON_OPTION and
PARSE_OPT_SHELL_EVAL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMSVC: Fix build by adding missing termios.h dummy
Johannes Sixt [Mon, 19 Apr 2010 07:37:20 +0000 (09:37 +0200)]
MSVC: Fix build by adding missing termios.h dummy

A use of this header file was introduced in eb80042 (Add missing #include
to support TIOCGWINSZ on Solaris, 2010-01-11).

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-clone: Transform description list into item list
Michael J Gruber [Sun, 21 Mar 2010 17:30:19 +0000 (18:30 +0100)]
Documentation/git-clone: Transform description list into item list

so that the list of examples is formatted in the same way as for
git-fetch, and, more importantly, the different identation for the
code blocks in the examples (compared to the immediately preceding code
blocks from url.txt) doesn't look like misformatted, but is clarified by
the items' bullets.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/urls: Remove spurious example markers
Michael J Gruber [Sun, 21 Mar 2010 17:30:18 +0000 (18:30 +0100)]
Documentation/urls: Remove spurious example markers

In urls.txt (which is included from git-{clone,fetch,push}.txt)
several item lists are surrounded by example block markers. This is
problematic for two reasons:

- None of these lists are example lists, so they should not be marked as
  such semantically.
- The html output looks weird (bulleted list with left sidebar).

Therefore, remove the example block markers. Output by the man backend
is unaffected.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/gitdiffcore: Remove misleading date in heading
Michael J Gruber [Sun, 21 Mar 2010 17:30:17 +0000 (18:30 +0100)]
Documentation/gitdiffcore: Remove misleading date in heading

Ever since the automatic conversion into man form, the heading
contained a misidentified subheading reading "June 2005".
Remove this since the documentation is more recent, and the correct
date is in the footer.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-reflog: Fix formatting of command lists
Michael J Gruber [Sun, 21 Mar 2010 17:30:16 +0000 (18:30 +0100)]
Documentation/git-reflog: Fix formatting of command lists

A misplaced list continuation mark appears literally in the
rendered doc. Fix this by removing it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jc/maint-fix-test-perm' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:54:05 +0000 (14:54 -0800)]
Merge branch 'jc/maint-fix-test-perm' into maint-1.6.6

* jc/maint-fix-test-perm:
  lib-patch-mode.sh: Fix permission
  t6000lib: Fix permission

14 years agoMerge branch 'sp/maint-push-sideband' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:54:01 +0000 (14:54 -0800)]
Merge branch 'sp/maint-push-sideband' into maint-1.6.6

* sp/maint-push-sideband:
  receive-pack: Send internal errors over side-band #2
  t5401: Use a bare repository for the remote peer
  receive-pack: Send hook output over side band #2
  receive-pack: Wrap status reports inside side-band-64k
  receive-pack: Refactor how capabilities are shown to the client
  send-pack: demultiplex a sideband stream with status data
  run-command: support custom fd-set in async
  run-command: Allow stderr to be a caller supplied pipe

14 years agoMerge branch 'hm/maint-imap-send-crlf' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:57 +0000 (14:53 -0800)]
Merge branch 'hm/maint-imap-send-crlf' into maint-1.6.6

* hm/maint-imap-send-crlf:
  git-imap-send: Convert LF to CRLF before storing patch to draft box

14 years agoMerge branch 'gf/maint-sh-setup-nongit-ok' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:53 +0000 (14:53 -0800)]
Merge branch 'gf/maint-sh-setup-nongit-ok' into maint-1.6.6

* gf/maint-sh-setup-nongit-ok:
  require_work_tree broken with NONGIT_OK

14 years agoMerge branch 'jk/maint-rmdir-fix' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:50 +0000 (14:53 -0800)]
Merge branch 'jk/maint-rmdir-fix' into maint-1.6.6

* jk/maint-rmdir-fix:
  rm: fix bug in recursive subdirectory removal

14 years agoMerge branch 'rs/optim-text-wrap' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:45 +0000 (14:53 -0800)]
Merge branch 'rs/optim-text-wrap' into maint-1.6.6

* rs/optim-text-wrap:
  utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
  utf8.c: remove strbuf_write()
  utf8.c: remove print_spaces()
  utf8.c: remove print_wrapped_text()

14 years agoMerge branch 'tr/maint-cherry-pick-list' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:40 +0000 (14:53 -0800)]
Merge branch 'tr/maint-cherry-pick-list' into maint-1.6.6

* tr/maint-cherry-pick-list:
  cherry_pick_list: quit early if one side is empty

14 years agoMerge branch 'cc/maint-bisect-paths' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:35 +0000 (14:53 -0800)]
Merge branch 'cc/maint-bisect-paths' into maint-1.6.6

* cc/maint-bisect-paths:
  bisect: error out when passing bad path parameters

14 years agoMerge branch 'maint-1.6.5' into maint-1.6.6
Junio C Hamano [Fri, 5 Mar 2010 06:24:19 +0000 (22:24 -0800)]
Merge branch 'maint-1.6.5' into maint-1.6.6

* maint-1.6.5:
  Remove extra '-' from git-am(1)

14 years agoRemove extra '-' from git-am(1)
Michal Sojka [Thu, 4 Mar 2010 12:08:28 +0000 (13:08 +0100)]
Remove extra '-' from git-am(1)

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobisect: error out when passing bad path parameters
Christian Couder [Sun, 28 Feb 2010 22:19:09 +0000 (23:19 +0100)]
bisect: error out when passing bad path parameters

As reported by Mark Lodato, "git bisect", when it was started with
path parameters that match no commit was kind of working without
taking account of path parameters and was reporting something like:

Bisecting: -1 revisions left to test after this (roughly 0 steps)

It is more correct and safer to just error out in this case, before
displaying the revisions left, so this patch does just that.

Note that this bug is very old, it exists at least since v1.5.5.
And it is possible to detect that case earlier in the bisect
algorithm, but it is not clear that it would be an improvement to
error out earlier, on the contrary it may change the behavior of
"git rev-list --bisect-all" for example, which is currently correct.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot3301-notes: insert a shbang line in ./fake_editor.sh
Johannes Sixt [Thu, 25 Feb 2010 10:39:50 +0000 (11:39 +0100)]
t3301-notes: insert a shbang line in ./fake_editor.sh

This is required on Windows because git-notes is now a built-in
rather than a shell script.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocherry_pick_list: quit early if one side is empty
Thomas Rast [Sat, 20 Feb 2010 11:42:04 +0000 (12:42 +0100)]
cherry_pick_list: quit early if one side is empty

The --cherry-pick logic starts by counting the commits on each side,
so that it can filter away commits on the bigger one.  However, so
far it missed an opportunity for optimization: it doesn't need to do
any work if either side is empty.

This in particular helps the common use-case 'git rebase -i HEAD~$n':
it internally uses --cherry-pick, but since HEAD~$n is a direct
ancestor the left side is always empty.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoutf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
René Scharfe [Fri, 19 Feb 2010 22:20:44 +0000 (23:20 +0100)]
utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()

is_utf8() works by calling utf8_width() for each character at the
supplied location.  In strbuf_add_wrapped_text(), we do that anyway
while wrapping the lines.  So instead of checking the encoding
beforehand, optimistically assume that it's utf-8 and wrap along
until an invalid character is hit, and when that happens start over.

This pays off if the text consists only of valid utf-8 characters.
The following command was run against the Linux kernel repo with
git 1.7.0:

$ time git log --format='%b' v2.6.32 >/dev/null

real 0m2.679s
user 0m2.580s
sys 0m0.100s

$ time git log --format='%w(60,4,8)%b' >/dev/null

real 0m4.342s
user 0m4.230s
sys 0m0.110s

And with this patch series:

$ time git log --format='%w(60,4,8)%b' >/dev/null

real 0m3.741s
user 0m3.630s
sys 0m0.110s

So the cost of wrapping is reduced to 70% in this case.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoutf8.c: remove strbuf_write()
René Scharfe [Fri, 19 Feb 2010 22:16:45 +0000 (23:16 +0100)]
utf8.c: remove strbuf_write()

The patch before the previous one made sure that all callers of
strbuf_add_wrapped_text() supply a strbuf.  Replace all calls of
strbuf_write() with regular strbuf functions and remove it.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoutf8.c: remove print_spaces()
René Scharfe [Fri, 19 Feb 2010 22:15:55 +0000 (23:15 +0100)]
utf8.c: remove print_spaces()

The previous patch made sure that strbuf_add_wrapped_text() (and thus
strbuf_add_indented_text(), too) always get a strbuf.  Make use of
this fact by adding strbuf_addchars(), a small helper that adds a
char the specified number of times to a strbuf, and use it to replace
print_spaces().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoutf8.c: remove print_wrapped_text()
René Scharfe [Fri, 19 Feb 2010 22:15:01 +0000 (23:15 +0100)]
utf8.c: remove print_wrapped_text()

strbuf_add_wrapped_text() is called only from print_wrapped_text()
without a strbuf (in which case it writes its results to stdout).

At its only callsite, supply a strbuf, call strbuf_add_wrapped_text()
directly and remove the wrapper function.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorm: fix bug in recursive subdirectory removal
Jeff King [Fri, 19 Feb 2010 05:57:21 +0000 (00:57 -0500)]
rm: fix bug in recursive subdirectory removal

If we remove a path in a/deep/subdirectory, we should try to
remove as many trailing components as possible (i.e.,
subdirectory, then deep, then a). However, the test for the
return value of rmdir was reversed, so we only ever deleted
at most one level.

The fix is in remove_path, so "apply" and "merge-recursive"
also are fixed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorequire_work_tree broken with NONGIT_OK
Gabriel Filion [Wed, 17 Feb 2010 04:18:50 +0000 (23:18 -0500)]
require_work_tree broken with NONGIT_OK

With NONGIT_OK set, require_work_tree function outside a git repository
gives a syntax error.  This is caused by an incorrect use of "test" that
didn't anticipate $(git rev-parse --is-inside-work-tree) may return an
empty string.

Properly quote the argument to "test", and send the standard error stream
to /dev/null to avoid giving duplicate error messages.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.6.5' into maint-1.6.6
Junio C Hamano [Tue, 16 Feb 2010 23:04:55 +0000 (15:04 -0800)]
Merge branch 'maint-1.6.5' into maint-1.6.6

* maint-1.6.5:
  dwim_ref: fix dangling symref warning
  stash pop: remove 'apply' options during 'drop' invocation
  diff: make sure --output=/bad/path is caught

14 years agodwim_ref: fix dangling symref warning
Jeff King [Tue, 16 Feb 2010 07:03:16 +0000 (02:03 -0500)]
dwim_ref: fix dangling symref warning

If we encounter a symref that is dangling, in most cases we will warn
about it. The one exception is a dangling HEAD, as that indicates a
branch yet to be born.

However, the check in dwim_ref was not quite right. If we were fed
something like "HEAD^0" we would try to resolve "HEAD", see that it is
dangling, and then check whether the _original_ string we got was
"HEAD" (which it wasn't in this case). And that makes no sense; the
dangling thing we found was not "HEAD^0" but rather "HEAD".

Fixing this squelches a scary warning from "submodule summary HEAD" (and
consequently "git status" with status.submodulesummary set) in an empty
repo, as the submodule script calls "git rev-parse -q --verify HEAD^0".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agostash pop: remove 'apply' options during 'drop' invocation
Thomas Rast [Mon, 15 Feb 2010 16:05:46 +0000 (17:05 +0100)]
stash pop: remove 'apply' options during 'drop' invocation

The 'git stash pop' option parsing used to remove the first argument
in --index mode.  At the time this was implemented, this first
argument was always --index.  However, since the invention of the -q
option in fcdd0e9 (stash: teach quiet option, 2009-06-17) you can
cause an internal invocation of

  git stash drop --index

by running

  git stash pop -q --index

which then of course fails because drop doesn't know --index.

To handle this, instead let 'git stash apply' decide what the future
argument to 'drop' should be.

Warning: this means that 'git stash apply' must parse all options that
'drop' can take, and deal with them in the same way.  This is
currently true for its only option -q.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff: make sure --output=/bad/path is caught
Larry D'Anna [Tue, 16 Feb 2010 04:10:45 +0000 (23:10 -0500)]
diff: make sure --output=/bad/path is caught

The return value from fopen wasn't being checked.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoRemove hyphen from "git-command" in two error messages
Pete Harlan [Mon, 15 Feb 2010 23:33:18 +0000 (15:33 -0800)]
Remove hyphen from "git-command" in two error messages

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofix minor memory leak in get_tree_entry()
René Scharfe [Sun, 14 Feb 2010 09:56:46 +0000 (10:56 +0100)]
fix minor memory leak in get_tree_entry()

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix typo in 1.6.6.2 release notes
Junio C Hamano [Fri, 12 Feb 2010 23:40:01 +0000 (15:40 -0800)]
Fix typo in 1.6.6.2 release notes

Of course, these are changes since 1.6.6.1; changes since 1.6.6.2
would have been nil.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoRe-fix check-ref-format documentation mark-up
Junio C Hamano [Fri, 12 Feb 2010 23:39:03 +0000 (15:39 -0800)]
Re-fix check-ref-format documentation mark-up

It is not double-backslash we forbid; backslashes are forbidden since
a4c2e699 (Disallow '\' in ref names, 2009-05-08)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-imap-send: Convert LF to CRLF before storing patch to draft box
Hitoshi Mitake [Fri, 12 Feb 2010 11:36:12 +0000 (20:36 +0900)]
git-imap-send: Convert LF to CRLF before storing patch to draft box

When storing a message over IMAP (RFC 3501 6.3.11), the message should be
in the format of an RFC 2822 message; most notably, CRLF must be used as
a line terminator.

Convert "\n" line endings in the payload to CRLF before feeding it to
IMAP APPEND command.

Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofilter-branch: Fix error message for --prune-empty --commit-filter
Jacob Helwig [Fri, 12 Feb 2010 02:46:22 +0000 (18:46 -0800)]
filter-branch: Fix error message for --prune-empty --commit-filter

Running filter-branch with --prune-empty and --commit-filter reports:

  "Cannot set --prune-empty and --filter-commit at the same time".

Change it to use the correct option name: --commit-filter

Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGit 1.6.6.2 v1.6.6.2
Junio C Hamano [Wed, 10 Feb 2010 21:44:11 +0000 (13:44 -0800)]
Git 1.6.6.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.6.5' into maint
Junio C Hamano [Wed, 10 Feb 2010 21:42:48 +0000 (13:42 -0800)]
Merge branch 'maint-1.6.5' into maint

* maint-1.6.5:
  t8003: check exit code of command and error message separately

14 years agot8003: check exit code of command and error message separately
Junio C Hamano [Tue, 9 Feb 2010 18:06:33 +0000 (10:06 -0800)]
t8003: check exit code of command and error message separately

Shell reports exit status only from the most downstream command
in a pipeline.  In these tests, we want to make sure that the
command fails in a controlled way, and produces a correct error
message.

This issue was known by Jay who submitted the patch, and also was
pointed out by Hannes during the review process, but I forgot to
fix it up before applying.  Sorry about that.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'sp/maint-fast-import-large-blob' into maint
Junio C Hamano [Wed, 10 Feb 2010 21:32:20 +0000 (13:32 -0800)]
Merge branch 'sp/maint-fast-import-large-blob' into maint

* sp/maint-fast-import-large-blob:
  fast-import: Stream very large blobs directly to pack

14 years agoMerge branch 'gp/maint-cvsserver' into maint
Junio C Hamano [Wed, 10 Feb 2010 21:02:52 +0000 (13:02 -0800)]
Merge branch 'gp/maint-cvsserver' into maint

* gp/maint-cvsserver:
  git-cvsserver: allow regex metacharacters in CVSROOT

14 years agoMerge branch 'jc/maint-reflog-bad-timestamp' into maint
Junio C Hamano [Wed, 10 Feb 2010 21:02:43 +0000 (13:02 -0800)]
Merge branch 'jc/maint-reflog-bad-timestamp' into maint

* jc/maint-reflog-bad-timestamp:
  t0101: use a fixed timestamp when searching in the reflog
  Update @{bogus.timestamp} fix not to die()
  approxidate_careful() reports errorneous date string

14 years agoMerge branch 'il/maint-xmallocz' into maint
Junio C Hamano [Wed, 10 Feb 2010 21:02:16 +0000 (13:02 -0800)]
Merge branch 'il/maint-xmallocz' into maint

* il/maint-xmallocz:
  Fix integer overflow in unpack_compressed_entry()
  Fix integer overflow in unpack_sha1_rest()
  Fix integer overflow in patch_delta()
  Add xmallocz()

14 years agoMerge branch 'jh/maint-config-file-prefix' into maint
Junio C Hamano [Wed, 10 Feb 2010 21:02:05 +0000 (13:02 -0800)]
Merge branch 'jh/maint-config-file-prefix' into maint

* jh/maint-config-file-prefix:
  builtin-config: Fix crash when using "-f <relative path>" from non-root dir

14 years agoMerge branch 'nd/include-termios-for-osol' into maint
Junio C Hamano [Wed, 10 Feb 2010 21:01:55 +0000 (13:01 -0800)]
Merge branch 'nd/include-termios-for-osol' into maint

* nd/include-termios-for-osol:
  Add missing #include to support TIOCGWINSZ on Solaris

14 years agoMerge branch 'jc/maint-1.6.1-checkout-m-custom-merge' into maint
Junio C Hamano [Wed, 10 Feb 2010 20:54:15 +0000 (12:54 -0800)]
Merge branch 'jc/maint-1.6.1-checkout-m-custom-merge' into maint

* jc/maint-1.6.1-checkout-m-custom-merge:
  checkout -m path: fix recreating conflicts

Conflicts:
t/t7201-co.sh

14 years agoMerge branch 'rs/maint-archive-match-pathspec' into maint
Junio C Hamano [Wed, 10 Feb 2010 20:52:39 +0000 (12:52 -0800)]
Merge branch 'rs/maint-archive-match-pathspec' into maint

* rs/maint-archive-match-pathspec:
  archive: complain about path specs that don't match anything

14 years agocheck-ref-format documentation: fix enumeration mark-up
Junio C Hamano [Wed, 10 Feb 2010 18:18:55 +0000 (10:18 -0800)]
check-ref-format documentation: fix enumeration mark-up

The last item in the enumerated refname rule was mistakenly made into
a sub-item of the 7th one.  It should be the 8th one in the list on its
own.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoreceive-pack: Send internal errors over side-band #2
Shawn O. Pearce [Wed, 10 Feb 2010 17:34:12 +0000 (09:34 -0800)]
receive-pack: Send internal errors over side-band #2

If the client has requested side-band-64k capability, send any
of the internal error or warning messages in the muxed side-band
stream using the same band as our hook output, band #2.  By putting
everything in one stream we ensure all messages are processed by
the side-band demuxer, avoiding interleaving between our own stderr
and the side-band demuxer's stderr buffers.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot5401: Use a bare repository for the remote peer
Shawn O. Pearce [Wed, 10 Feb 2010 02:01:29 +0000 (18:01 -0800)]
t5401: Use a bare repository for the remote peer

We want to avoid the warnings (or later, test failures) about
updating the current branch.  It was never my intention to have
this test deal with a repository with a working directory, and it
is a very old bug that the test even used a non-bare repository
for the remote side of the push operations.

This fixes the interleaved output error we were seeing as a test
failure by avoiding the giant warning message we were getting back
about updating the current branch being risky.

Its not a real fix, but is something we should do no matter what,
because the behavior will change in the future to reject, and the
test would break at that time.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.6.5' into maint
Junio C Hamano [Tue, 9 Feb 2010 05:53:54 +0000 (21:53 -0800)]
Merge branch 'maint-1.6.5' into maint

* maint-1.6.5:
  blame: prevent a segv when -L given start > EOF

14 years agoblame: prevent a segv when -L given start > EOF
Jay Soffian [Tue, 9 Feb 2010 03:48:13 +0000 (22:48 -0500)]
blame: prevent a segv when -L given start > EOF

blame would segv if given -L <lineno> with <lineno> past the end of the file.
While we're fixing the bug, add test cases for an invalid <start> when called
as -L <start>,<end> or -L<start>.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jc/maint-push-doc-status' into maint
Junio C Hamano [Tue, 9 Feb 2010 00:49:22 +0000 (16:49 -0800)]
Merge branch 'jc/maint-push-doc-status' into maint

* jc/maint-push-doc-status:
  git-push: document all the status flags used in the output

14 years agogit-push: document all the status flags used in the output
Junio C Hamano [Tue, 9 Feb 2010 00:45:21 +0000 (16:45 -0800)]
git-push: document all the status flags used in the output

We didn't talk about '-' (deletion), '*' (addition), nor '+' (forced).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jc/maint-imap-config-parse' into maint
Junio C Hamano [Mon, 8 Feb 2010 23:09:19 +0000 (15:09 -0800)]
Merge branch 'jc/maint-imap-config-parse' into maint

* jc/maint-imap-config-parse:
  Fix parsing of imap.preformattedHTML and imap.sslverify

14 years agoFix parsing of imap.preformattedHTML and imap.sslverify
Junio C Hamano [Sat, 6 Feb 2010 19:26:35 +0000 (11:26 -0800)]
Fix parsing of imap.preformattedHTML and imap.sslverify

These two variables are boolean and can lack "= value" in the
configuration file.  Do not reject such input early in the
parser callback function.

Also the key are downcased before being given to the callback,
so we should run strcmp() with keyword spelled in all-lowercase.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jc/maint-doc-git-add-example' into maint
Junio C Hamano [Mon, 8 Feb 2010 20:13:56 +0000 (12:13 -0800)]
Merge branch 'jc/maint-doc-git-add-example' into maint

* jc/maint-doc-git-add-example:
  git-add documentation: Fix shell quoting example

14 years agogit-add documentation: Fix shell quoting example
Junio C Hamano [Mon, 8 Feb 2010 20:12:41 +0000 (12:12 -0800)]
git-add documentation: Fix shell quoting example

When 921177f (Documentation: improve "add", "pull" and "format-patch"
examples, 2008-05-07) converted this from enumeration header to displayed
text, it failed to adjust for the AsciiDoc's rule to quote backslashes.
In displayed text, backslash is shown verbatim, while in enumeration
header, we need to double it.

We have a similar construct in git-rm.txt documentation, and need to be
careful when somebody wants to update it to match the style of the "git
add" example.

Noticed by: Greg Bacon <gbacon@dbresearch.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoarchive: simplify archive format guessing
René Scharfe [Sun, 7 Feb 2010 23:30:20 +0000 (00:30 +0100)]
archive: simplify archive format guessing

The code to guess an output archive's format consumed any --format
options and built a new one.  Jonathan noticed that it does so in an
unsafe way, risking to overflow the static buffer fmt_opt.

Change the code to keep the existing --format options intact and to only
add a new one if a format could be guessed based on the output file name.
The new option is added as the first one, allowing the existing ones to
overrule it, i.e. explicit --format options given on the command line win
over format guesses, as before.

To simplify the code further, format_from_name() is changed to return the
full --format option, thus no potentially dangerous sprintf() calls are
needed any more.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoreceive-pack: Send hook output over side band #2
Shawn O. Pearce [Fri, 5 Feb 2010 20:57:42 +0000 (12:57 -0800)]
receive-pack: Send hook output over side band #2

If the client requests to enable side-band-64k capability we can
safely send any hook stdout or stderr data down side band #2,
so the client can present it to the user.

If side-band-64k isn't enabled, hooks continue to inherit stderr
from the parent receive-pack process.

When the side band channel is being used the push client will wind up
prefixing all server messages with "remote: ", just like fetch does,
so our test vector has to be updated with the new expected output.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoreceive-pack: Wrap status reports inside side-band-64k
Shawn O. Pearce [Fri, 5 Feb 2010 20:57:41 +0000 (12:57 -0800)]
receive-pack: Wrap status reports inside side-band-64k

If the client requests the side-band-64k protocol capability we
now wrap the status report data inside of packets sent to band #1.
This permits us to later send additional progress or informational
messages down band #2.

If side-band-64k was enabled, we always send a final flush packet
to let the client know we are done transmitting.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoreceive-pack: Refactor how capabilities are shown to the client
Shawn O. Pearce [Fri, 5 Feb 2010 20:57:40 +0000 (12:57 -0800)]
receive-pack: Refactor how capabilities are shown to the client

Moving capability advertisement into the packet_write call itself
makes it easier to add additional capabilities to the list, be
it optional by configuration, or always present in the protocol.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agosend-pack: demultiplex a sideband stream with status data
Shawn O. Pearce [Fri, 5 Feb 2010 20:57:39 +0000 (12:57 -0800)]
send-pack: demultiplex a sideband stream with status data

If the server advertises side-band-64k capability, we request
it and pull the status report data out of side band #1, and let
side band #2 go to our stderr.  The latter channel be used by the
remote side to send our user messages.  This basically mirrors the
side-band-64k capability in upload-pack.

Servers may choose to use side band #2 to send error messages from
hook scripts that are meant for the push end user.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorun-command: support custom fd-set in async
Erik Faye-Lund [Fri, 5 Feb 2010 20:57:38 +0000 (12:57 -0800)]
run-command: support custom fd-set in async

This patch adds the possibility to supply a set of non-0 file
descriptors for async process communication instead of the
default-created pipe.

Additionally, we now support bi-directional communiction with the
async procedure, by giving the async function both read and write
file descriptors.

To retain compatiblity and similar "API feel" with start_command,
we require start_async callers to set .out = -1 to get a readable
file descriptor.  If either of .in or .out is 0, we supply no file
descriptor to the async process.

[sp: Note: Erik started this patch, and a huge bulk of it is
     his work.  All bugs were introduced later by Shawn.]

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorun-command: Allow stderr to be a caller supplied pipe
Shawn O. Pearce [Fri, 5 Feb 2010 20:57:37 +0000 (12:57 -0800)]
run-command: Allow stderr to be a caller supplied pipe

Like .out, .err may now be set to a file descriptor > 0, which
is a writable pipe/socket/file that the child's stderr will be
redirected into.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUpdate git fsck --full short description to mention packs
Wesley J. Landaker [Fri, 5 Feb 2010 19:58:50 +0000 (12:58 -0700)]
Update git fsck --full short description to mention packs

The '--full' option to git fsck does two things:

  1) Check objects in packs
  2) Check alternate objects

This is documented in the git fsck manual; this patch reflects that in
the short git fsck option help message as well.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jc/maint-limit-note-output' into maint
Junio C Hamano [Fri, 5 Feb 2010 18:59:05 +0000 (10:59 -0800)]
Merge branch 'jc/maint-limit-note-output' into maint

* jc/maint-limit-note-output:
  Fix "log --oneline" not to show notes
  Fix "log" family not to be too agressive about showing notes

14 years agofast-import: Stream very large blobs directly to pack
Shawn O. Pearce [Mon, 1 Feb 2010 17:27:35 +0000 (09:27 -0800)]
fast-import: Stream very large blobs directly to pack

If a blob is larger than the configured big-file-threshold, instead
of reading it into a single buffer obtained from malloc, stream it
onto the end of the current pack file.  Streaming the larger objects
into the pack avoids the 4+ GiB memory footprint that occurs when
fast-import is processing 2+ GiB blobs.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'sb/maint-octopus' into maint-1.6.5
Junio C Hamano [Mon, 1 Feb 2010 08:06:11 +0000 (00:06 -0800)]
Merge branch 'sb/maint-octopus' into maint-1.6.5

* sb/maint-octopus:
  octopus: remove dead code
  octopus: reenable fast-forward merges
  octopus: make merge process simpler to follow

14 years agoMerge branch 'bg/maint-add-all-doc' into maint-1.6.5
Junio C Hamano [Mon, 1 Feb 2010 08:04:12 +0000 (00:04 -0800)]
Merge branch 'bg/maint-add-all-doc' into maint-1.6.5

* bg/maint-add-all-doc:
  git-rm doc: Describe how to sync index & work tree
  git-add/rm doc: Consistently back-quote
  Documentation: 'git add -A' can remove files

14 years agolib-patch-mode.sh: Fix permission
Junio C Hamano [Sun, 31 Jan 2010 00:04:25 +0000 (16:04 -0800)]
lib-patch-mode.sh: Fix permission

In the same sprit as 4848509 (Fix permissions on test scripts,
2007-04-13), t/lib-patch-mode.sh should not be executable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge commit 'b319ef7' into jc/maint-fix-test-perm
Junio C Hamano [Sun, 31 Jan 2010 00:03:10 +0000 (16:03 -0800)]
Merge commit 'b319ef7' into jc/maint-fix-test-perm

* commit 'b319ef7': (8132 commits)
  Add a small patch-mode testing library
  git-apply--interactive: Refactor patch mode code
  t8005: Nobody writes Russian in shift_jis
  Fix severe breakage in "git-apply --whitespace=fix"
  Update release notes for 1.6.4
  After renaming a section, print any trailing variable definitions
  Make section_name_match start on '[', and return the length on success
  send-email: detect cycles in alias expansion
  Show the presence of untracked files in the bash prompt.
  SunOS grep does not understand -C<n> nor -e
  Fix export_marks() error handling.
  git repack: keep commits hidden by a graft
  Add a test showing that 'git repack' throws away grafted-away parents
  git branch: clean up detached branch handling
  git branch: avoid unnecessary object lookups
  git branch: fix performance problem
  git svn: fix shallow clone when upstream revision is too new
  do_one_ref(): null_sha1 check is not about broken ref
  configure.ac: properly unset NEEDS_SSL_WITH_CRYPTO when sha1 func is missing
  janitor: useless checks before free
  ...

14 years agot6000lib: Fix permission
Junio C Hamano [Sat, 30 Jan 2010 23:59:09 +0000 (15:59 -0800)]
t6000lib: Fix permission

4848509 (Fix permissions on test scripts, 2007-04-13) forgot to make
this included file non-executable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.6.5' into maint
Junio C Hamano [Sat, 30 Jan 2010 07:36:13 +0000 (23:36 -0800)]
Merge branch 'maint-1.6.5' into maint

* maint-1.6.5:
  fix memcpy of overlapping area

14 years agofix memcpy of overlapping area
Jeff King [Fri, 29 Jan 2010 10:28:44 +0000 (05:28 -0500)]
fix memcpy of overlapping area

Caught by valgrind in t5500, but it is pretty obvious from
reading the code that this is shifting elements of an array
to the left, which needs memmove.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobash: don't offer remote transport helpers as subcommands
SZEDER Gábor [Fri, 22 Jan 2010 10:54:51 +0000 (11:54 +0100)]
bash: don't offer remote transport helpers as subcommands

Since commits a2d725b7 (Use an external program to implement fetching
with curl, 2009-08-05) and c9e388bb (Make the
"traditionally-supported" URLs a special case, 2009-09-03) remote
transport helpers like 'remote-ftp' and 'remote-curl' are offered by the
completion script as available subcommands.  Not good, since they are
helpers, therefore should not be offered, so filter them out.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot0101: use a fixed timestamp when searching in the reflog
Junio C Hamano [Wed, 27 Jan 2010 18:54:22 +0000 (10:54 -0800)]
t0101: use a fixed timestamp when searching in the reflog

That will give us a better reproducibility during tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUpdate @{bogus.timestamp} fix not to die()
Junio C Hamano [Wed, 27 Jan 2010 18:53:09 +0000 (10:53 -0800)]
Update @{bogus.timestamp} fix not to die()

The caller will say "It is not a valid object name" if it wants to, and
some callers may even try to see if it names an object and otherwise try to
see if it is a path.

Pointed out by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapproxidate_careful() reports errorneous date string
Junio C Hamano [Tue, 26 Jan 2010 19:58:00 +0000 (11:58 -0800)]
approxidate_careful() reports errorneous date string

For a long time, the time based reflog syntax (e.g. master@{yesterday})
didn't complain when the "human readable" timestamp was misspelled, as
the underlying mechanism tried to be as lenient as possible.  The funny
thing was that parsing of "@{now}" even relied on the fact that anything
not recognized by the machinery returned the current timestamp.

Introduce approxidate_careful() that takes an optional pointer to an
integer, that gets assigned 1 when the input does not make sense as a
timestamp.

As I am too lazy to fix all the callers that use approxidate(), most of
the callers do not take advantage of the error checking, but convert the
code to parse reflog to use it as a demonstration.

Tests are mostly from Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix integer overflow in unpack_compressed_entry()
Ilari Liusvaara [Tue, 26 Jan 2010 18:24:15 +0000 (20:24 +0200)]
Fix integer overflow in unpack_compressed_entry()

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix integer overflow in unpack_sha1_rest()
Ilari Liusvaara [Tue, 26 Jan 2010 18:24:14 +0000 (20:24 +0200)]
Fix integer overflow in unpack_sha1_rest()

[jc: later NUL termination by the caller becomes unnecessary]

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix integer overflow in patch_delta()
Ilari Liusvaara [Tue, 26 Jan 2010 18:24:13 +0000 (20:24 +0200)]
Fix integer overflow in patch_delta()

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd xmallocz()
Ilari Liusvaara [Tue, 26 Jan 2010 18:24:12 +0000 (20:24 +0200)]
Add xmallocz()

Add routine for allocating NUL-terminated memory block without risking
integer overflow in addition of +1 for NUL byte.

[jc: with suggestion from Bill Lear]

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-cvsserver: allow regex metacharacters in CVSROOT
Gerrit Pape [Tue, 26 Jan 2010 14:47:16 +0000 (14:47 +0000)]
git-cvsserver: allow regex metacharacters in CVSROOT

When run in a repository with a path name containing regex metacharacters
(e.g. +), git-cvsserver failed to split the client request into CVSROOT
and module.  Now metacharacters are disabled for the value of CVSROOT in
the perl regex so that directory names containing metacharacters are
handled properly.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuiltin-config: Fix crash when using "-f <relative path>" from non-root dir
Johan Herland [Tue, 26 Jan 2010 15:02:16 +0000 (16:02 +0100)]
builtin-config: Fix crash when using "-f <relative path>" from non-root dir

When your current directory is not at the root of the working tree, and you
use the "-f" option with a relative path, the current code tries to read
from a wrong file, since argv[2] is now beyond the end of the rearranged
argument list.

This patch replaces the incorrect argv[2] with the variable holding the
given config file name.

The bug was introduced by d64ec16 (git config: reorganize to use parseopt).

[jc: added test]

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint' of git://git.spearce.org/git-gui into maint
Junio C Hamano [Sun, 24 Jan 2010 19:16:26 +0000 (11:16 -0800)]
Merge branch 'maint' of git://git.spearce.org/git-gui into maint

* 'maint' of git://git.spearce.org/git-gui:
  git-gui: work from the .git dir
  git-gui: Fix applying a line when all following lines are deletions
  git-gui: Correct file_states when unstaging partly staged entry
  git-gui: Fix gitk for branch whose name matches local file
  git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync
  git-gui: handle really long error messages in updateindex.
  git-gui: Add hotkeys for "Unstage from commit" and "Revert changes"
  git-gui: Makefile: consolidate .FORCE-* targets

14 years agogit-gui: work from the .git dir
Giuseppe Bilotta [Sat, 23 Jan 2010 10:03:36 +0000 (11:03 +0100)]
git-gui: work from the .git dir

When git-gui is run from a .git dir, _gitdir would be set to "." by
rev-parse, something that confuses the worktree detection.

Fix by expanding the value of _gitdir to pwd in this special case.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Fix applying a line when all following lines are deletions
Jeff Epler [Tue, 8 Dec 2009 00:22:42 +0000 (18:22 -0600)]
git-gui: Fix applying a line when all following lines are deletions

If a diff looked like:

 @@
  context
 -del1
 -del2

and you wanted to stage the deletion 'del1', the generated patch
wouldn't apply because it was missing the line 'del2' converted to
context, but this line was counted in the @@-line

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Correct file_states when unstaging partly staged entry
Jens Lehmann [Mon, 7 Dec 2009 20:35:59 +0000 (21:35 +0100)]
git-gui: Correct file_states when unstaging partly staged entry

When unstaging a partly staged file or submodule, the file_states
list was not updated properly (unless unstaged linewise). Its
index_info part did not contain the former head_info as it should
have but kept its old value.

This seems not to have had any bad effects but diminishes the value
of the file_states list for future enhancements.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Fix gitk for branch whose name matches local file
Peter Krefting [Thu, 21 Jan 2010 12:15:17 +0000 (13:15 +0100)]
git-gui: Fix gitk for branch whose name matches local file

When trying to run gitk on a branch name whose name matches a local
file, it will toss an error saying that the name is ambiguous. Adding
a pair of dashes will make gitk parse the options to the left of
it as branch names. Since wish eats the first pair of dashes we
throw at it, we need to add a second one to ensure they get through.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync
Christopher Beelby [Sat, 23 Jan 2010 22:37:17 +0000 (14:37 -0800)]
git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync

When the number of recent repo's gets to ten there can be a
situation where an item is removed from the .gitconfig file via
a call to git config --unset, but the internal representation of
that file (repo_config(gui.recentrepo)) is not updated.  Then a
subsequent attempt to remove an item from the list fails because
git-gui attempts to call --unset on a value that has already
been removed.  This leads to duplicates in the .gitconfig file,
which then also cause errors if the git-gui tries to --unset them
(rather than using --unset-all. --unset-all is not used because it
is not expected that duplicates should ever be allowed to exist.)

When loading the list of recent repositories (proc _get_recentrepos)
if a repo in the list is not considered a valid git reposoitory
then we should go ahead and remove it so it doesn't take up a slot
in the list (since we limit to 10 items). This will prevent a bunch
of invalid entries in the list (which are not shown) from making
valid entries dissapear off the list even when there are less than
ten valid entries.

See: http://code.google.com/p/msysgit/issues/detail?id=362
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: handle really long error messages in updateindex.
Pat Thoyts [Sun, 20 Dec 2009 02:02:03 +0000 (02:02 +0000)]
git-gui: handle really long error messages in updateindex.

As reported to msysGit (bug #340) it is possible to get some very
long error messages when updating the index. The use of a label to
display this prevents scrolling the output. This patch replaces the
label with a scrollable text widget configured to look like a label.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoignore duplicated slashes in make_relative_path()
Junio C Hamano [Fri, 22 Jan 2010 03:05:19 +0000 (19:05 -0800)]
ignore duplicated slashes in make_relative_path()

The function takes two paths, an early part of abs is supposed to match
base; otherwise abs is not a path under base and the function returns the
full path of abs.  The caller can easily confuse the implementation by
giving duplicated and needless slashes in these path arguments.

Credit for test script, motivation and initial patch goes to Thomas Rast.
A follow-up fix (squashed) is by Hannes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>