Commit graph

13902 commits

Author SHA1 Message Date
Junio C Hamano 4698ef555a Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: initial Italian translation
  gitk: Default to using po2msg.sh if msgfmt doesn't grok --tcl, -l and -d
  gitk: Avoid Tcl error when switching views
  [PATCH] gitk: Don't show local changes when we there is no work tree
  [PATCH] gitk: Add horizontal scrollbar to the diff view
  [PATCH] gitk: make autoselect optional
  [PATCH] gitk: Mark another string for translation
  [PATCH] Add an --argscmd flag to get the list of refs to show
  gitk: Only restore window size from ~/.gitk, not position
2008-03-14 17:49:40 -07:00
Michele Ballabio 2708d9df59 gitk: initial Italian translation
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-03-14 20:26:47 +11:00
Paul Mackerras 8719f1286e gitk: Default to using po2msg.sh if msgfmt doesn't grok --tcl, -l and -d
This is a similar change to that submitted by Junio C Hamano for
git-gui.  It tests whether the msgfmt command can be run successfully
with --tcl, -l and -d, and if not, falls back to using po/po2msg.sh.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-03-14 20:24:31 +11:00
Christian Couder 1658c6149a Documention: web--browse: add info about "browser.<tool>.cmd" config var
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-14 00:31:06 -07:00
Christian Couder 77e21533a9 web--browse: use custom commands defined at config time
Currently "git web--browse" is restricted to a set of commands defined
in the script. You can subvert the "browser.<tool>.path" to force "git
web--browse" to use a different command, but if you have a command
whose invocation syntax does not match one of the current tools then
you would have to write a wrapper script for it.

This patch adds a git config variable "browser.<tool>.cmd" which
allows a more flexible browser choice.

If you run "git web--browse" with -t/--tool, -b/--browser or the
"web.browser" config variable set to an unrecognized tool then "git
web--browse" will query the "browser.<tool>.cmd" config variable. If
this variable exists, then "git web--browse" will treat the specified
tool as a custom command and will use a shell eval to run the command
with the URLs added as extra parameters.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-14 00:31:06 -07:00
Junio C Hamano 5ad9db3d04 Merge branch 'mr/autoconf-fread'
* mr/autoconf-fread:
  autoconf: Test FREAD_READS_DIRECTORIES
2008-03-14 00:27:59 -07:00
Junio C Hamano 16007f3916 Merge branch 'maint'
* maint:
  merge-file: handle empty files gracefully
  merge-recursive: handle file mode changes
  Minor wording changes in the keyboard descriptions in git-add --interactive.
  git fetch: Take '-n' to mean '--no-tags'
  quiltimport: fix misquoting of parsed -p<num> parameter
  git-quiltimport: better parser to grok "enhanced" series files.
2008-03-14 00:16:42 -07:00
Junio C Hamano 1b56bc9a15 Merge branch 'ph/maint-quiltimport' into maint
* ph/maint-quiltimport:
  quiltimport: fix misquoting of parsed -p<num> parameter
  git-quiltimport: better parser to grok "enhanced" series files.
2008-03-14 00:16:26 -07:00
Junio C Hamano ca885a4fe6 read-tree() and unpack_trees(): use consistent limit
read-tree -m can read up to MAX_TREES, which was arbitrarily set to 8 since
August 2007 (4 is needed to deal with 2 merge-base case).

However, the updated unpack_trees() code had an advertised limit of 4
(which it enforced).  In reality the code was prepared to take only 3
trees and giving 4 caused it to stomp on its stack.  Rename the MAX_TREES
constant to MAX_UNPACK_TREES, move it to the unpack-trees.h common header
file, and use it from both places to avoid future confusion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 23:56:36 -07:00
Johannes Schindelin 381b851c9b merge-file: handle empty files gracefully
Earlier, it would error out while trying to read and/or writing them.
Now, calling merge-file with empty files is neither interesting nor
useful, but it is a bug that needed fixing.

Noticed by Clemens Buchacher.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2008-03-13 23:43:56 -07:00
Clemens Buchacher 1affea4f62 merge-recursive: handle file mode changes
File mode changes should be handled similarly to changes of content.
That is, if the file mode changed in only one branch, keep the changed
version, and if both branch changed to different mode, mark it as a
conflict.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 23:41:16 -07:00
Nicolas Pitre f746bae84e pack-objects: proper pack time stamping with --max-pack-size
Runtime pack access is done in the pack file mtime order since recent
packs are more likely to contain frequently used objects than old packs.
However the --max-pack-size option can produce multiple packs with mtime
in the reversed order as newer objects are always written first.

Let's modify mtime of later pack files (when any) so they appear older
than preceding ones when a repack creates multiple packs.

Signed-off-by: Nicolas Pitre <nico@cam.org>
2008-03-13 22:51:30 -07:00
Vineet Kumar bb12ac5120 Minor wording changes in the keyboard descriptions in git-add --interactive.
The wording of the interactive help text from git-add--interactive.perl is
clearer.  Just duplicate that text here.

Signed-off-by: Vineet Kumar <vineet@doorstop.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 22:46:56 -07:00
Johannes Schindelin e7951290f6 git fetch: Take '-n' to mean '--no-tags'
Prior to commit 8320199 (Rewrite builtin-fetch option parsing to use
parse_options().), we understood '-n' as a short option to mean "don't
fetch tags from the remote". This patch reinstates behaviour similar,
but not identical to the pre commit 8320199 times.

Back then, -n always overrode --tags, so if both --tags and -n was
given on command-line, no tags were fetched regardless of argument
ordering. Now we use a "last entry wins" strategy, so '-n --tags'
means "fetch tags".

Since it's patently absurd to say both --tags and --no-tags, this
shouldn't matter in practice.

Spotted-by: Artem Zolochevskiy <azol@altlinux.org>
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Tested-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13 00:31:18 -07:00
Junio C Hamano b75aaa546e Merge branch 'maint'
* maint:
  git-cvsimport: fix merging with remote parent branch
  gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form
2008-03-12 23:47:31 -07:00
Johannes Schindelin 25ee9731c1 gc: call "prune --expire 2.weeks.ago" by default
The only reason we did not call "prune" in git-gc was that it is an
inherently dangerous operation: if there is a commit going on, you will
prune loose objects that were just created, and are, in fact, needed by the
commit object just about to be created.

Since it is dangerous, we told users so.  That led to many users not even
daring to run it when it was actually safe. Besides, they are users, and
should not have to remember such details as when to call git-gc with
--prune, or to call git-prune directly.

Of course, the consequence was that "git gc --auto" gets triggered much
more often than we would like, since unreferenced loose objects (such as
left-overs from a rebase or a reset --hard) were never pruned.

Alas, git-prune recently learnt the option --expire <minimum-age>, which
makes it a much safer operation.  This allows us to call prune from git-gc,
with a grace period of 2 weeks for the unreferenced loose objects (this
value was determined in a discussion on the git list as a safe one).

If you want to override this grace period, just set the config variable
gc.pruneExpire to a different value; an example would be

	[gc]
		pruneExpire = 6.months.ago

or even "never", if you feel really paranoid.

Note that this new behaviour makes "--prune" be a no-op.

While adding a test to t5304-prune.sh (since it really tests the implicit
call to "prune"), also the original test for "prune --expire" was moved
there from t1410-reflog.sh, where it did not belong.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2008-03-12 23:47:01 -07:00
Junio C Hamano dbdbfec441 Documentation/config: typofix
Each heading of enumerated list should end with double-colon, not single.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 23:44:42 -07:00
Junio C Hamano 18d077c1bf quiltimport: fix misquoting of parsed -p<num> parameter
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 21:07:19 -07:00
Marc-Andre Lureau c36c5b845e git-cvsimport: fix merging with remote parent branch
commit-tree fails when specifying a remote name (via -r option) and
one of the parent branch has a name. Prefixing with "$remote/" fix it.

Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 21:03:39 -07:00
Jakub Narebski 7863c612f4 gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form
URLs generated by href(..., -replay=>1) (which includes 'next page'
links and alternate view links) didn't set project info correctly
when current page URL is in pathinfo form.

This resulted in broken links such like:

  http://www.example.com/w/ARRAY(0x85a5318)?a=shortlog;pg=1

if the 'pathinfo' feature was used, or

  http://www.example.com/w/?a=shortlog;pg=1

if it wasn't, instead of correct:

  http://www.example.com/w/project.git?a=shortlog;pg=1

This was caused by the fact that href() always replays params in the
arrayref form, were they multivalued or singlevalued, and the code
dealing with 'pathinfo' feature couldn't deal with $params{'project'}
being arrayref.

Setting $params{'project'} is moved before replaying params; this
ensures that 'project' parameter is processed correctly.

Noticed-by: Peter Oberndorfer <kumbayo84@arcor.de>
Noticed-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-12 09:43:08 -07:00
Junio C Hamano a6828f5361 Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
  git-gui: Simplify MSGFMT setting in Makefile
  git-gui: Add option for changing the width of the commit message text box
  git-gui: if a background colour is set, set foreground colour as well
  git-gui: translate the remaining messages in zh_cn.po to chinese
2008-03-11 22:59:35 -07:00
Junio C Hamano 7276607886 git-gui: Simplify MSGFMT setting in Makefile
To prepare msg files for Tcl scripts, the command that is set to MSGFMT
make variable needs to be able to grok "--tcl -l <lang> -d <here>" options
correctly.  This patch simplifies the tests done in git-gui's Makefile to
directly test this condition.  If the test run does not exit properly with
zero status (either because you do not have "msgfmt" itself, or your
"msgfmt" is too old to grok --tcl option --- the reason does not matter),
have it fall back to po/po2msg.sh

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-12 01:48:32 -04:00
Junio C Hamano ae90e16a3a Merge branch 'js/remote'
* js/remote:
  "remote update": print remote name being fetched from
  builtin remote rm: remove symbolic refs, too
  remote: fix "update [group...]"
  remote show: Clean up connection correctly if object fetch wasn't done
  builtin-remote: prune remotes correctly that were added with --mirror
  Make git-remote a builtin
  Test "git remote show" and "git remote prune"
  parseopt: add flag to stop on first non option
  path-list: add functions to work with unsorted lists

Conflicts:

	parse-options.c
2008-03-11 22:33:51 -07:00
Junio C Hamano b85997d14d Merge branch 'lt/unpack-trees'
* lt/unpack-trees:
  unpack_trees(): fix diff-index regression.
  traverse_trees_recursive(): propagate merge errors up
  unpack_trees(): minor memory leak fix in unused destination index
  Make 'unpack_trees()' have a separate source and destination index
  Make 'unpack_trees()' take the index to work on as an argument
  Add 'const' where appropriate to index handling functions
  Fix tree-walking compare_entry() in the presense of --prefix
  Move 'unpack_trees()' over to 'traverse_trees()' interface
  Make 'traverse_trees()' traverse conflicting DF entries in parallel
  Add return value to 'traverse_tree()' callback
  Make 'traverse_tree()' use linked structure rather than 'const char *base'
  Add 'df_name_compare()' helper function
2008-03-11 22:13:44 -07:00
Samuel Tardieu 3000658f7c "remote update": print remote name being fetched from
When the other end has dangling symref, "git fetch" issues an error
message but that is not grave enough to cause the fetch process to fail.
As the result, the user will see something like this:

    $ git remote update
    error: refs/heads/2.0-uobjects points nowhere!

"remote update" used to report which remote it is fetching from, like
this:

    $ git remote update
    Updating core
    Updating matthieu
    error: refs/heads/2.0-uobjects points nowhere!
    Updating origin

This reinstates the message "Updating <name>" in "git remote update".

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 22:13:16 -07:00
Junio C Hamano b81a7b5887 Merge branch 'maint'
* maint:
  git-svn: fix find-rev error message when missing arg
  t0021: tr portability fix for Solaris
  launch_editor(): allow spaces in the filename
  git rebase --abort: always restore the right commit
2008-03-11 21:40:47 -07:00
Marc-Andre Lureau ea14e6c554 git-svn: fix find-rev error message when missing arg
Just let the user know that a revision argument is missing instead of
a perl error. This error message mimic the "init" error message, but
could be improved.

Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 21:20:50 -07:00
Jeff King 7339eb0823 t0021: tr portability fix for Solaris
Solaris' /usr/bin/tr doesn't seem to like multiple character
ranges in brackets (it simply prints "Bad string").

Instead, let's just enumerate the transformation we want.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 21:14:59 -07:00
Johannes Schindelin fc99469a2b launch_editor(): allow spaces in the filename
The construct

	sh -c "$0 \"$@\"" <editor> <file>

does not pick up quotes in <editor>, so you cannot give path to the
editor that has a shell IFS whitespace in it, and also give it initial
set of parameters and flags.  Replace $0 with <editor> to fix this issue.

This fixes

	git config core.editor '"c:/Program Files/What/Ever.exe"'

In other words, you can specify an editor with spaces in its path using a
config containing something like this:

	[core]
		editor = \"c:/Program Files/Darn/Spaces.exe\"

NOTE: we cannot just replace the $0 with \"$0\", because we still want
this to work:

	[core]
		editor = emacs -nw

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 19:57:56 -07:00
Mike Hommey 4201bb5f7e git rebase --abort: always restore the right commit
Previously, --abort would end by git resetting to ORIG_HEAD, but some
commands, such as git reset --hard (which happened in git rebase --skip,
but could just as well be typed by the user), would have already modified
ORIG_HEAD.

Just use the orig-head we store in $dotest instead.

[jc: cherry-picked from 48411d and 4947cf9 on 'master']

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 19:30:33 -07:00
Paul Mackerras 494d3b8a6c gitk: Avoid Tcl error when switching views
Michele Ballabio <barra_cuda@katamail.com> pointed out that gitk
sometimes throws a Tcl error (can't read "yscreen") when switching
views, and proposed a patch.  This is a different way of fixing it
which is a bit neater.  Basically, in showview we only set yscreen if
the selected commit is on screen to start with, and then we only
scroll the canvas to bring it onscreen if yscreen is set and the
same commit exists in the new view.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-03-11 22:11:19 +11:00
David Aguilar cb8329aa9a [PATCH] gitk: Don't show local changes when we there is no work tree
Launching gitk on a bare repository or a .git directory
would previously show the work tree as having removed all
files.  We now inhibit showing local changes when gitk
is not launched from within a work tree.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-03-11 20:22:39 +11:00
Michal Rokos 8ce1f243e5 autoconf: Test FREAD_READS_DIRECTORIES
Add test for FREAD_READS_DIRECTORIES to detect when fread() reads fopen'ed
directory.

Tested on these platforms:

  AIX 5.3 - FREAD_READS_DIRECTORIES=UnfortunatelyYes
  HP-UX B.11.11 - FREAD_READS_DIRECTORIES=UnfortunatelyYes
  HP-UX B.11.23 - FREAD_READS_DIRECTORIES=UnfortunatelyYes
  Linux 2.6.25-rc4 - FREAD_READS_DIRECTORIES=
  Tru64 V5.1 - FREAD_READS_DIRECTORIES=UnfortunatelyYes
  Windows - FREAD_READS_DIRECTORIES=

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Tested-by: Mike Ralphson <mike@abacus.co.uk>
Tested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-11 02:10:43 -07:00
Junio C Hamano 5d921e2931 Merge branch 'jc/cherry-pick' (early part)
* 'jc/cherry-pick' (early part):
  expose a helper function peel_to_type().
  merge-recursive: split low-level merge functions out.

Conflicts:

	Makefile
	builtin-merge-recursive.c
	sha1_name.c
2008-03-11 02:05:12 -07:00
Junio C Hamano 1c53606978 Merge branch 'maint'
* maint:
  git-pull documentation: warn about the option order
2008-03-11 01:54:46 -07:00
Junio C Hamano 92aeb994d3 Merge branch 'kb/maint-filter-branch-disappear' into maint
* kb/maint-filter-branch-disappear:
  filter-branch: handle "disappearing tree" case correctly in subdir filter
2008-03-11 00:38:29 -07:00
Junio C Hamano b50396d16c Merge branch 'aw/maint-shortlog-blank-lines' into maint
* aw/maint-shortlog-blank-lines:
  shortlog: take the first populated line of the description
2008-03-11 00:37:38 -07:00
Linus Torvalds 20a16eb33e unpack_trees(): fix diff-index regression.
When skip_unmerged option is not given, unpack_trees() should not just
skip unmerged cache entries but keep them in the result for the caller to
sort them out.

For callers other than diff-index, the incoming index should never be
unmerged, but diff-index is a special case caller.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-10 23:51:13 -07:00
SZEDER Gábor 702088afc6 update 'git rebase' documentation
Being in the project's top directory when starting or continuing a rebase
is not necessary since 533b703 (Allow whole-tree operations to be started
from a subdirectory, 2007-01-12).

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-10 17:38:03 -07:00
SZEDER Gábor 5447aac755 bash: fix long option with argument double completion
Pressing TAB right after 'git command --long-option=' results in
'git command --long-option=--long-option=' when the long option requires
an argument, but we don't provide completion for its arguments (e.g.
commit --author=, apply --exclude=).  This patch detects these long
options and provides empty completion array for them.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 20:02:15 -04:00
Teemu Likonen ce5a2c956f bash: Add more long options to be completed with "git --<TAB>"
Add the following long options to be completed with command "git":

	--paginate
	--work-tree=
	--help

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 20:00:40 -04:00
SZEDER Gábor 51fe120903 bash: use __gitdir when completing 'git rebase' options
When doing completion of rebase options in a subdirectory of the work
tree during an ongoing rebase, wrong options were offered because of the
hardcoded .git/.dotest-merge path.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:55:07 -04:00
Shawn O. Pearce 6753f2aa55 bash: Remove completion of core.legacyheaders option
This option is no longer recognized by git.  Completing it is
not worthwhile.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:49:28 -04:00
SZEDER Gábor 47f6ee2838 bash: add 'git svn' subcommands and options
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:45:40 -04:00
SZEDER Gábor 88b302f5e2 bash: add new 'git stash' subcommands
Namely 'save', 'drop', 'pop' and 'create'

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:45:20 -04:00
SZEDER Gábor 3ff1320d4b bash: refactor searching for subcommands on the command line
This patch adds the __git_find_subcommand function, which takes one
argument: a string containing all subcommands separated by spaces.  The
function searches through the command line whether a subcommand is
already present.  The first found subcommand will be printed to standard
output.

This enables us to remove code duplications from completion functions
for commands having subcommands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:45:20 -04:00
SZEDER Gábor 1d17b22ebf bash: remove unnecessary conditions when checking for subcommands
Checking emptyness of $command is sufficient.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:45:20 -04:00
Kevin Ballard a5c4f85b16 bash: Properly quote the GIT_DIR at all times to fix subdirectory paths with spaces
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:44:40 -04:00
Junio C Hamano 542c264b01 traverse_trees_recursive(): propagate merge errors up
There were few places where merge errors detected deeper in the call chain
were ignored and not propagated up the callchain to the caller.

Most notably, this caused switching branches with "git checkout" to ignore
a path modified in a work tree are different between the HEAD version and
the commit being switched to, which it internally notices but ignores it,
resulting in an incorrect two-way merge and loss of the change in the work
tree.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-10 01:26:23 -07:00
Junio C Hamano 5b10a3c124 git-pull documentation: warn about the option order
We might eventually be loosening this rule, but there is a longstanding
restriction that the users currently need to be aware of.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-10 01:22:03 -07:00