Code

git.git
17 years agoRename git-rebase interactive buffer: todo => git-rebase-todo
Seth Falcon [Sat, 28 Jul 2007 23:44:40 +0000 (16:44 -0700)]
Rename git-rebase interactive buffer: todo => git-rebase-todo

When using emacsclient or similar, a temporary buffer (file) named
'todo' could cause confusion with a pre-existing buffer of the same
name.

Signed-off-by: Seth Falcon <sethfalcon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: Allow for multivalued parameters passed to href subroutine
Jakub Narebski [Sat, 28 Jul 2007 23:04:09 +0000 (01:04 +0200)]
gitweb: Allow for multivalued parameters passed to href subroutine

Make it possible to generate URLs with multivalued parameters in the
href() subroutine, via passing reference to array of values.

Example:
  href(action=>"log", extra_options=>["--no-merges", "--first-parent"])

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDon't rely on unspecified behavior
Thomas Schwinge [Sat, 28 Jul 2007 18:26:35 +0000 (20:26 +0200)]
Don't rely on unspecified behavior

Calling access(p, m) with p == NULL is not specified, so don't do that.  On
GNU/Hurd systems doing so will result in a SIGSEGV.

Signed-off-by: Thomas Schwinge <tschwinge@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: Simplify 'opt' parameter validation, add "no merges" feeds
Jakub Narebski [Sat, 28 Jul 2007 14:27:32 +0000 (16:27 +0200)]
gitweb: Simplify 'opt' parameter validation, add "no merges" feeds

Simplify and make more readable validation of 'opt' (extra options)
parameter, using exists($hash{key}) instead of grepping keys of a hash
for value.

Move 'opt' parameter to be the last (for now) in the URL.

Make use of '--no-merges' extra option ('opt') by adding "no merges"
RSS and Atom feeds to the HTML header.  Note that alternate format
links in the RSS and Atom views do not use '--no-merges' option yet!

Adds tests for the 'opt' parameter to t9500-gitweb-standalone-no-errors.sh

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: Show submodule entries in the 'tree' view
Jakub Narebski [Sat, 28 Jul 2007 14:27:31 +0000 (16:27 +0200)]
gitweb: Show submodule entries in the 'tree' view

Add S_ISGITLINK subroutine and S_IFGITLINK, S_IFINVALID constants.
Add support for "commit" (submodule) entries in the tree object to
mode_str ('m---------', following cgit), file_type and file_type_long
('submodule') subroutines.

There is only link to the history of submodule entry in the
supermodule (current repository) for now, because gitweb doesn't know
where to search for submodule repository objects.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocumentation/git-diff: remove -r from --name-status example
Jeff King [Sun, 29 Jul 2007 00:24:27 +0000 (20:24 -0400)]
Documentation/git-diff: remove -r from --name-status example

Calling 'git-diff --name-status' will recursively show any
changes already, and it has for quite some time (at least as
far back as v1.4.1).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-stash apply --index: optimize postprocessing
Junio C Hamano [Sat, 28 Jul 2007 06:51:45 +0000 (23:51 -0700)]
git-stash apply --index: optimize postprocessing

Originally, "apply --index" codepath was bolted on to the
"update working tree files and index, but then revert the
changes we make to the index except for added files so that we
do not forget about them" codepath, almost as an afterthought.
Because "apply --index" first prepares the final index state
upfront, "revert except the added paths" postprocessing does not
have to be done.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix git-stash apply --index
Junio C Hamano [Sat, 28 Jul 2007 06:41:31 +0000 (23:41 -0700)]
Fix git-stash apply --index

Two bugs that made the command practically unusable were fixed
with this.

 - A stash created with a clean index does not have any
   difference between the base tree and the index tree.
   Trying to apply the diff between them to the index would
   error out with "No changes".  Even when the user asked to
   unstash with --index, do not bother with --index action if
   the base tree and the index tree match.

 - After successfully performing the working tree merge, the
   index was reloaded from an earlier state of unstashed index
   with "read-tree"; this left all the paths cache dirty.  By
   moving the call to git-status after this read-tree, match the
   cached stat information in the index.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-stash: Make sure reflog is created for refs/stash
しらいしななこ [Sat, 28 Jul 2007 01:44:48 +0000 (10:44 +0900)]
git-stash: Make sure reflog is created for refs/stash

Earlier commit 7ab3cc70 fixed "stash clear" but broke save_stash,
because it forgot to make sure the reflog file exists before saving.

Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Sat, 28 Jul 2007 07:05:40 +0000 (00:05 -0700)]
Merge branch 'master' of git://git./gitk/gitk

* 'master' of git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix bugs in the Find function
  gitk: Wait for the window to become visible after creating it
  [PATCH] gitk: Bind keyboard actions to the command key on Mac OS
  [PATCH] gitk: Ignore ctrl-z as EOF on windows
  gitk: Make the fake commit for the index changes green rather than magenta
  gitk: Show changes in index and changes in working directory separately

17 years agorebase -i: fix interrupted squashing
Johannes Schindelin [Tue, 24 Jul 2007 20:43:09 +0000 (21:43 +0100)]
rebase -i: fix interrupted squashing

When a squashing merge failed, the first commit would not be replaced,
due to "git reset --soft" being called with an unmerged index.

Noticed by Uwe Kleine-König.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-stash: do not remove a ref by hand.
Junio C Hamano [Fri, 27 Jul 2007 06:24:28 +0000 (23:24 -0700)]
git-stash: do not remove a ref by hand.

Somebody on #git noticed that "git stash clear" left a packed
ref behind for ref/stash.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument commit.template configuration variable.
Brian Gernhardt [Thu, 26 Jul 2007 20:34:59 +0000 (16:34 -0400)]
Document commit.template configuration variable.

Add it to the list in config.txt and explicitly say that the
--template option to git-commit overrides the configuration variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitk: Fix bugs in the Find function
Paul Mackerras [Thu, 26 Jul 2007 12:36:39 +0000 (22:36 +1000)]
gitk: Fix bugs in the Find function

This fixes the problem reported by Brian Downing where searching for
a string that doesn't exist would give a Tcl error.  The basic problem
was that we weren't reading the data for the last commit since it
wasn't terminated with a null.  This effectively adds a null on the end
(if there isn't one already) to make sure we process the last commit.

This also makes the yellow background behind instances of the search
string appear more consistently, and fixes a bug where the "/" key
would just find the same commit again and again instead of advancing.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agoUpdate description of -z option.
Junio C Hamano [Thu, 26 Jul 2007 06:45:42 +0000 (23:45 -0700)]
Update description of -z option.

The NUL you see in "git log" (without diff) output are between records,
not at the end of each record.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: fix overzealous output redirection
Johannes Schindelin [Thu, 26 Jul 2007 06:35:51 +0000 (07:35 +0100)]
rebase -i: fix overzealous output redirection

When squashing, you no longer saw what the editor had to say to you
after commit 'Shut "git rebase -i" up when no --verbose was given'
(if you used a console based editor, at least).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-write-tree should not crash if prefix does not exist
Nguyễn Thái Ngọc Duy [Thu, 26 Jul 2007 03:14:54 +0000 (23:14 -0400)]
git-write-tree should not crash if prefix does not exist

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit_mkstemp(): be careful not to overflow the path buffer.
Junio C Hamano [Thu, 26 Jul 2007 04:34:53 +0000 (21:34 -0700)]
git_mkstemp(): be careful not to overflow the path buffer.

If user's TMPDIR is insanely long, return negative after
setting errno to ENAMETOOLONG, pretending that the underlying
mkstemp() choked on a temporary file path that is too long.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoWhen locking in a symlinked repository, try to lock the original.
Junio C Hamano [Wed, 25 Jul 2007 23:22:55 +0000 (16:22 -0700)]
When locking in a symlinked repository, try to lock the original.

In a working tree prepared in new-workdir (in contrib/), some files in .git/
directory are symbolic links to the original repository.  The usual sequence of
lock-write-rename would break the symbolic link.

Ideally we should resolve relative symbolic link with maxdepth, but I do not
want to risk too elaborate patch before 1.5.3 release, so this is a minimum
and trivially obvious fix.  new-workdir creates its symbolic links absolute,
and does not link from a symlinked workdir, so this fix should suffice for now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-submodule: remove redundant call to git-describe
Junio C Hamano [Wed, 25 Jul 2007 23:13:55 +0000 (16:13 -0700)]
git-submodule: remove redundant call to git-describe

The code to find a more descriptive name given a commit in a
submodule were improved in bffe71f, but it forgot to remove the
older logic the patch replaced.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-p4: Fix p4 user cache population on Windows.
Simon Hausmann [Wed, 25 Jul 2007 07:31:38 +0000 (09:31 +0200)]
git-p4: Fix p4 user cache population on Windows.

Fall back to USERPROFILE if HOME isn't set.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-submodule module_name: avoid using unwieldy "value_regexp" feature.
Junio C Hamano [Wed, 25 Jul 2007 22:51:26 +0000 (15:51 -0700)]
git-submodule module_name: avoid using unwieldy "value_regexp" feature.

"module_name $path" function wants to look up a configuration
variable "submodule.<modulename>.path" whose value is $path, and
return the <modulename> found.  "git-config --get-regexp" is the
natural thing to use for this, but (1) its value matching has an
unfortunate "feature" that takes leading '!' specially, and (2)
its output needs to be parsed with sed to extract <modulename>
part anyway.

This changes the call to "git-config --get-regexp" not to use
the value-regexp part, and moves the "pick the one whose value
is $path" part to the downstream sed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: fix broken snapshot
Junio C Hamano [Wed, 25 Jul 2007 22:49:55 +0000 (15:49 -0700)]
gitweb: fix broken snapshot

Recent updates to snapshot code had a typo that broke the command line to
invoke underlying "git archive" command.  This is a simple typofix for it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake sure git-stash works from subdirectory.
Junio C Hamano [Wed, 25 Jul 2007 22:32:22 +0000 (15:32 -0700)]
Make sure git-stash works from subdirectory.

We say "SUBDIRECTORY_OK" but we did not chdir to toplevel; this
is fine as long as everything we use can be started from a
subdirectory, but unfortunately "merge-recursive" is not one of
the programs you can safely use from a subdirectory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument --unified/-U option
Robin Rosenberg [Wed, 25 Jul 2007 10:08:17 +0000 (12:08 +0200)]
Document --unified/-U option

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoGIT 1.5.3-rc3 v1.5.3-rc3
Junio C Hamano [Wed, 25 Jul 2007 04:39:33 +0000 (21:39 -0700)]
GIT 1.5.3-rc3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit.el: Pass an explicit argument to enable smerge-mode.
Alexandre Julliard [Tue, 24 Jul 2007 10:02:28 +0000 (12:02 +0200)]
git.el: Pass an explicit argument to enable smerge-mode.

Without argument the mode is toggled, which would do the wrong thing
if the file was already open.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agopretty-options.txt: tiny doc fix
Jim Meyering [Tue, 24 Jul 2007 18:59:47 +0000 (20:59 +0200)]
pretty-options.txt: tiny doc fix

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agot9200: Be careful when checking CVS/Entries
Junio C Hamano [Wed, 25 Jul 2007 06:25:38 +0000 (23:25 -0700)]
t9200: Be careful when checking CVS/Entries

CVS/Entries file can contain a line with single D to say "this
directory does not have any subdirectories".  Do not get
confused with such an entry.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit am: skip pine's internal folder data
Johannes Schindelin [Tue, 24 Jul 2007 00:02:25 +0000 (01:02 +0100)]
git am: skip pine's internal folder data

Test if the From: line contains "Mail System Internal Data" and if
it is, skip this mail.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoTeach git-commit about commit message templates.
Steven Grimm [Mon, 23 Jul 2007 04:17:42 +0000 (21:17 -0700)]
Teach git-commit about commit message templates.

These are useful in organizations that enforce particular formats
for commit messages, e.g., to specify bug IDs or test plans.
Use of the template is not enforced; it is simply used as the
initial content when the editor is invoked.

Signed-off-by: Steven Grimm <koreth@midwinter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoTeach approxidate() to understand "never"
Johannes Schindelin [Tue, 24 Jul 2007 18:18:34 +0000 (19:18 +0100)]
Teach approxidate() to understand "never"

If you want to keep the reflogs around for a really long time, you should be
able to say so:

$ git config gc.reflogExpire never

Now it works, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit log -g: Complain, but do not fail, when no reflogs are there
Johannes Schindelin [Mon, 23 Jul 2007 23:39:50 +0000 (00:39 +0100)]
git log -g: Complain, but do not fail, when no reflogs are there

When asking "git log -g --all", clearly you want to see only those refs
that do have reflogs, but you do not want it to fail, either.

So instead of die()ing, complain about it, but move on to the other refs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-email: Update regex parsing for pine aliases
Kumar Gala [Tue, 24 Jul 2007 14:50:38 +0000 (09:50 -0500)]
send-email: Update regex parsing for pine aliases

The pine address book format is tab seperated and the first field
is the nickname/alias and the third field is the email address as
per:

http://www.washington.edu/pine/tech-notes/low-level.html

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocvsexportcommit: avoid racy CVS problem.
Robin Rosenberg [Tue, 24 Jul 2007 22:56:20 +0000 (00:56 +0200)]
cvsexportcommit: avoid racy CVS problem.

If git cvsexportcommit is executed fast enough in sequence, the CVS
timestamps could end up being the same. CVS tries to fix this
by sleeping until the CPU clock changes seconds. Unfortunately,
the CPU clock and the file system clock are not necessarily the same, so
the timestamps could be the same anyway. When that happens CVS may not
recognize changed files and cvs will forget to commit some files.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocleanup unpack-trees.c: shrink struct tree_entry_list
René Scharfe [Tue, 24 Jul 2007 21:54:25 +0000 (23:54 +0200)]
cleanup unpack-trees.c: shrink struct tree_entry_list

Remove the two write-only fields executable and symlink from struct
tree_entry_list.  Also replace usage of the field directory with
S_ISDIR checks on the mode field, and then remove this now obsolete
field, too.  Noticed by David Kastrup.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch: fix dash complaining about "Missing '))'"
René Scharfe [Tue, 24 Jul 2007 21:29:29 +0000 (23:29 +0200)]
filter-branch: fix dash complaining about "Missing '))'"

On e.g. Ubuntu, dash is used as /bin/sh.  Unlike bash it parses
commands like

  a=$((echo stuff) | wc)

as an arithmetic expression while what we want is a subshell inside
a command substitution.  Resolve the ambiguity by placing a space
between the two opening parentheses.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: More detailed error messages for snapshot format
Jakub Narebski [Tue, 24 Jul 2007 23:19:58 +0000 (01:19 +0200)]
gitweb: More detailed error messages for snapshot format

Improve error messages for snapshot format in git_snapshot:
distinguish between situation where snapshots are turned off, where
snapshot format ('sf') parameter is invalid, where given snapshot
format does not exist in %known_snapshot_formats hash, and where
gitweb was given unsupported snapshot format.

While at it, use first from all supported snapshots format as default,
if no snapshot format was provided.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit.el: Support for incremental status updates.
Alexandre Julliard [Tue, 24 Jul 2007 10:12:47 +0000 (12:12 +0200)]
git.el: Support for incremental status updates.

When we know which files have been modified, we can now run diff-index
or ls-files with a file list to refresh only the specified files
instead of the whole project.

This also allows proper refreshing of files upon add/delete/resolve,
instead of making assumptions about the new file state.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agouser-manual: fix typolets.
Junio C Hamano [Tue, 24 Jul 2007 08:58:51 +0000 (01:58 -0700)]
user-manual: fix typolets.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMark user-manual as UTF-8
Junio C Hamano [Tue, 24 Jul 2007 07:46:35 +0000 (00:46 -0700)]
Mark user-manual as UTF-8

There have been several complaints against k.org's user-manual
page.  The document is generated in ISO-8859-1 by the xsltproc
toolchain (I suspect this is because released docbook.xsl we use
has xsl:output element that says the output is ISO-8859-1) but
server delivers it with "charset=UTF-8", and all h*ll breaks
loose.

This attempts to force UTF-8 on the generating end.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoTeach revision machinery about --no-walk
Johannes Schindelin [Mon, 23 Jul 2007 23:38:40 +0000 (00:38 +0100)]
Teach revision machinery about --no-walk

The flag "no_walk" is present in struct rev_info since a long time, but
so far has been in use exclusively by "git show".

With this flag, you can see all your refs, ordered by date of the last
commit:

$ git log --abbrev-commit --pretty=oneline --decorate --all --no-walk

which is extremely helpful if you have to juggle with a lot topic
branches, and do not remember in which one you introduced that uber
debug option, or simply want to get an overview what is cooking.

(Note that the "git log" invocation above does not output the same as

 $ git show --abbrev-commit --pretty=oneline --decorate --all --quiet

 since "git show" keeps the alphabetic order that "--all" returns the
 refs in, even if the option "--date-order" was passed.)

For good measure, this also adds the "--do-walk" option which overrides
"--no-walk".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch: Big syntax change; support rewriting multiple refs
Johannes Schindelin [Mon, 23 Jul 2007 17:34:13 +0000 (18:34 +0100)]
filter-branch: Big syntax change; support rewriting multiple refs

We used to take the first non-option argument as the name for the new
branch.  This syntax is not extensible to support rewriting more than just
HEAD.

Instead, we now have the following syntax:

git filter-branch [<filter options>...] [<rev-list options>]

All positive refs given in <rev-list options> are rewritten.  Yes,
in-place.  If a ref was changed, the original head is stored in
refs/original/$ref now, for your inspecting pleasure, in addition to the
reflogs (since it is easier to inspect "git show-ref | grep original" than
to inspect all the reflogs).

This commit also adds the --force option to remove .git-rewrite/ and all
refs from refs/original/ before filtering.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: exchange all "if [ .. ]" by "if test .."
Johannes Schindelin [Tue, 24 Jul 2007 02:18:28 +0000 (03:18 +0100)]
rebase -i: exchange all "if [ .. ]" by "if test .."

This patch is literally

:%s/if \[ *\(.*[^ ]\) *\]/if test \1/

in vi, after making sure that the other instances of "[..]" are not
actually invocations of "test".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoShut "git rebase -i" up when no --verbose was given
Johannes Schindelin [Mon, 23 Jul 2007 22:45:49 +0000 (23:45 +0100)]
Shut "git rebase -i" up when no --verbose was given

Up to now, git rebase -i was quite chatty, showing through all the
nice core programs it called.

Now it only shows a progress meter by default.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agomailinfo: fix 'fatal: cannot convert from utf-8 to utf-8'
Johannes Schindelin [Tue, 24 Jul 2007 00:03:26 +0000 (01:03 +0100)]
mailinfo: fix 'fatal: cannot convert from utf-8 to utf-8'

For some reason, I got this error message.  Maybe it does not make sense,
but then we should not really try to convert the text when it is not
necessary.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitk: Wait for the window to become visible after creating it
Paul Mackerras [Mon, 23 Jul 2007 11:35:03 +0000 (21:35 +1000)]
gitk: Wait for the window to become visible after creating it

When the git log process returned an error immediately, we were
sometimes getting no main window and no error window displayed,
with the gitk process just hanging waiting for something.  It appears
that the tkwait in show_error, which waits for the error window to
be destroyed, wasn't sufficient to allow the main window or the error
window to be mapped.

This adds a wait in the main startup code after the main window
has been created to wait until it is visible.  This seems to fix the
problem.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agogitweb: Fix support for legacy gitweb config for snapshots
Jakub Narebski [Sun, 22 Jul 2007 21:41:20 +0000 (23:41 +0200)]
gitweb: Fix support for legacy gitweb config for snapshots

Earlier commit which cleaned up snapshot support and introduced
support for multiple snapshot formats changed the format of
$feature{'snapshot'}{'default'} (gitweb configuration) and
gitweb.snapshot configuration variable (repository configuration).
It supported old gitweb.snapshot values of 'gzip', 'bzip2' and 'zip'
and tried to support, but failed to do that, old values of
$feature{'snapshot'}{'default'}; at least those corresponding to
old gitweb.snapshot values of 'gzip', 'bzip2' and 'zip', i.e.
  ['x-gzip', 'gz', 'gzip']
  ['x-bzip2', 'bz2', 'bzip2']
  ['x-zip', 'zip', '']

This commit moves legacy configuration support out of feature_snapshot
subroutine to separate filter_snapshot_fmts subroutine. The
filter_snapshot_fmts is used on result on result of
gitweb_check_feature('snapshot').  This way feature_snapshot deals
_only_ with repository config.

As a byproduct you can now use 'gzip' and 'bzip2' as aliases to 'tgz'
and 'tbz2' also in $feature{'snapshot'}{'default'}, not only in
gitweb.snapshot.

While at it do some whitespace cleanup: use tabs for indent, but
spaces for align.

Noticed-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Tested-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofsck --lost-found: write blob's contents, not their SHA-1
Johannes Schindelin [Sun, 22 Jul 2007 20:20:26 +0000 (21:20 +0100)]
fsck --lost-found: write blob's contents, not their SHA-1

When looking for a lost blob, it is much nicer to be able to grep
through .git/lost-found/other/* than to write an inefficient loop
over the file names.  So write the contents of the dangling blobs,
not their object names.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years ago[PATCH] gitk: Bind keyboard actions to the command key on Mac OS
Shawn O. Pearce [Thu, 19 Jul 2007 04:37:58 +0000 (00:37 -0400)]
[PATCH] gitk: Bind keyboard actions to the command key on Mac OS

git-gui already uses the command key for accelerators, but gitk has
never done so.  I'm actually finding it very hard to move back and
forth between the two applications as git-gui is following the Mac
OS X conventions and gitk is not.

This trick is the same one that git-gui uses to determine which
key to bind actions to.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[PATCH] gitk: Ignore ctrl-z as EOF on windows
Mark Levedahl [Tue, 17 Jul 2007 22:42:04 +0000 (18:42 -0400)]
[PATCH] gitk: Ignore ctrl-z as EOF on windows

Cygwin's Tcl is configured to honor any occurence of ctrl-z as an
end-of-file marker, while some commits in the git repository and possibly
elsewhere include that character in the commit comment. This causes gitk
ignore commit history following such a comment and incorrect graphs. This
change affects only Windows as Tcl on other platforms already has
eofchar == {}. This fixes problems noted by me and by Ray Lehtiniemi, and
the fix was suggested by Shawn Pierce.

Signed-off-by: Mark Levedahl <mdl123@verizon.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agogitk: Make the fake commit for the index changes green rather than magenta
Paul Mackerras [Sun, 22 Jul 2007 12:05:30 +0000 (22:05 +1000)]
gitk: Make the fake commit for the index changes green rather than magenta

The magenta was a bit close in color to the normal blue commits.  This
makes them green instead as suggested by Linus.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agoAvoid to duplicate commit message when is not encoded
Marco Costalba [Sun, 22 Jul 2007 08:23:05 +0000 (10:23 +0200)]
Avoid to duplicate commit message when is not encoded

When a commit message doesn't have encoding information
and encoding output is utf-8 (default) then an useless
xstrdup() of commit message is done.

If we assume most of users live in an utf-8 world, this
useless copy is the common case.

Performance issue found with KCachegrind.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoSynonyms: -i == --regexp-ignore-case, -E == --extended-regexp
Junio C Hamano [Sun, 22 Jul 2007 06:18:33 +0000 (23:18 -0700)]
Synonyms: -i == --regexp-ignore-case, -E == --extended-regexp

These options to log family were too long to type.  Give them
shorter synonyms.

Fix the parsing of the long options while at it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocumentation/gitignore.txt: Fix the seriously misleading priority explanation
David Kastrup [Sat, 21 Jul 2007 23:53:49 +0000 (01:53 +0200)]
Documentation/gitignore.txt: Fix the seriously misleading priority explanation

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix VISUAL/EDITOR preference order in Documentation/config.txt.
Junio C Hamano [Sun, 22 Jul 2007 05:37:56 +0000 (22:37 -0700)]
Fix VISUAL/EDITOR preference order in Documentation/config.txt.

I screwed up when amending ef0c2abf.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: snapshot cleanups & support for offering multiple formats
Matt McCutchen [Sat, 21 Jul 2007 23:30:27 +0000 (01:30 +0200)]
gitweb: snapshot cleanups & support for offering multiple formats

- Centralize knowledge about snapshot formats (mime types, extensions,
  commands) in %known_snapshot_formats and improve how some of that
  information is specified.  In particular, zip files are no longer a
  special case.

- Add support for offering multiple snapshot formats to the user so
  that he/she can download a snapshot in the format he/she prefers.
  The site-wide or project configuration now gives a list of formats
  to offer, and if more than one format is offered, the "_snapshot_"
  link becomes something like "snapshot (_tar.bz2_ _zip_)".

- If only one format is offered, a tooltip on the "_snapshot_" link
  tells the user what it is.

- Fix out-of-date "tarball" -> "archive" in comment.

Alert for gitweb site administrators: This patch changes the format of
$feature{'snapshot'}{'default'} in gitweb_config.perl from a list of
three pieces of information about a single format to a list of one or
more formats you wish to offer from the set ('tgz', 'tbz2', 'zip').
Update your gitweb_config.perl appropriately.  There was taken care
for old-style gitweb configuration to work as it used to, but this
backward compatibility works only for the values which correspond to
gitweb.snapshot values of 'gzip', 'bzip2' and 'zip', i.e.
  ['x-gzip', 'gz', 'gzip']
  ['x-bzip2', 'bz2', 'bzip2']
  ['x-zip', 'zip', '']

The preferred names for gitweb.snapshot in repository configuration
have also changed from 'gzip' and 'bzip2' to 'tgz' and 'tbz2', but
the old names are still recognized for compatibility.

Signed-off-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: call editor just once for a multi-squash
Johannes Schindelin [Sat, 21 Jul 2007 17:09:41 +0000 (18:09 +0100)]
rebase -i: call editor just once for a multi-squash

Sometimes you want to squash more than two commits.  Before this patch,
the editor was fired up for each squash command.  Now the editor is
started only with the last squash command.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix up duplicate parents removal
Linus Torvalds [Sat, 21 Jul 2007 06:11:19 +0000 (23:11 -0700)]
Fix up duplicate parents removal

This removes duplicate parents properly, making gitk happy again.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb cleanup: Move @diff_opts declaration earlier
Jakub Narebski [Fri, 20 Jul 2007 00:15:09 +0000 (02:15 +0200)]
gitweb cleanup: Move @diff_opts declaration earlier

Move @diff_opts declaration earlier, so that all gitweb options are
together (and not separated by %feature hash and some subroutines),
with the exception of $GITWEB_CONFIG which must be after all option
variables including %feature hash.

While at it, in the moved comment, note that diff option '-C' implies
'-M', instead of suggesting that '-M', '-C' is required.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd GIT_EDITOR environment and core.editor configuration variables
Adam Roben [Fri, 20 Jul 2007 05:09:35 +0000 (22:09 -0700)]
Add GIT_EDITOR environment and core.editor configuration variables

These variables let you specify an editor that will be launched in
preference to the EDITOR and VISUAL environment variables. The order
of preference is GIT_EDITOR, core.editor, EDITOR, VISUAL.

[jc: added a test and config variable documentation]

Signed-off-by: Adam Roben <aroben@apple.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument how to tell git to not launch a pager
Steven Grimm [Thu, 19 Jul 2007 10:43:51 +0000 (03:43 -0700)]
Document how to tell git to not launch a pager

Signed-off-by: Steven Grimm <koreth@midwinter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRename read_pipe() with read_fd() and make its buffer nul-terminated.
Carlos Rica [Wed, 18 Jul 2007 18:31:03 +0000 (20:31 +0200)]
Rename read_pipe() with read_fd() and make its buffer nul-terminated.

The new name is closer to the purpose of the function.

A NUL-terminated buffer makes things easier when callers need that.
Since the function returns only the memory written with data,
almost always allocating more space than needed because final
size is unknown, an extra NUL terminating the buffer is harmless.
It is not included in the returned size, so the function
remains working as before.

Also, now the function allows the buffer passed to be NULL at first,
and alloc_nr is now used for growing the buffer, instead size=*2.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'master' of git://people.freedesktop.org/~hausmann/git-p4
Junio C Hamano [Thu, 19 Jul 2007 00:23:03 +0000 (17:23 -0700)]
Merge branch 'master' of git://people.freedesktop.org/~hausmann/git-p4

* 'master' of git://people.freedesktop.org/~hausmann/git-p4:
  git-p4: Cleanup, used common function for listing imported p4 branches
  git-p4: Fix upstream branch detection for submit/rebase with multiple branches.
  git-p4: Cleanup, make listExistingP4Branches a global function for later use.
  git-p4: input to "p4 files" by stdin instead of arguments
  git-p4: use subprocess in p4CmdList

17 years agofilter-branch: get rid of "set -e"
Johannes Schindelin [Wed, 18 Jul 2007 13:17:43 +0000 (14:17 +0100)]
filter-branch: get rid of "set -e"

It was reported by Alex Riesen that "set -e" can break something as
trivial as "unset CDPATH" in bash.

So get rid of "set -e".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svn: Minimalistic patch which allows svn usernames with space(s).
Richard MUSIL [Tue, 17 Jul 2007 17:02:57 +0000 (19:02 +0200)]
git-svn: Minimalistic patch which allows svn usernames with space(s).

Changed filter for username in svn-authors file, so even 'user name' is accepted.

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDo a better job at guessing unknown character sets
Linus Torvalds [Tue, 17 Jul 2007 17:34:44 +0000 (10:34 -0700)]
Do a better job at guessing unknown character sets

At least in the kernel development community, we're generally slowly
converting to UTF-8 everywhere, and the old default of Latin1 in emails is
being supplanted by UTF-8, and it doesn't necessarily show up as such in
the mail headers (because, quite frankly, when people send patches
around, they want the email client to do as little as humanly possible
about the patch)

Despite that, it's often the case that email addresses etc still have
Latin1, so I've seen emails where this is a mixed bag, with Signed-off
parts being copied from email (and containing Latin1 characters), and the
rest of the email being a patch in UTF-8.

So this suggests a very natural change: if the target character set is
utf-8 (the default), and if the source already looks like utf-8, just
assume that it doesn't need any conversion at all.

Only assume that it needs conversion if it isn't already valid utf-8, in
which case we (for historical reasons) will assume it's Latin1.

Basically no really _valid_ latin1 will ever look like utf-8, so while
this changes our historical behaviour, it doesn't do so in practice, and
makes the default behaviour saner for the case where the input was already
in proper format.

We could do a more fancy guess, of course, but this correctly handled a
series of patches I just got from Andrew that had a mixture of Latin1 and
UTF-8 (in different emails, but without any character set indication).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument "git stash message..."
しらいしななこ [Tue, 17 Jul 2007 08:15:42 +0000 (17:15 +0900)]
Document "git stash message..."

The command was recently updated to take message on the command line, but
this feature has not been documented.

Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agounpack-trees.c: assume submodules are clean during check-out
Sven Verdoolaege [Tue, 17 Jul 2007 18:28:28 +0000 (20:28 +0200)]
unpack-trees.c: assume submodules are clean during check-out

In particular, when moving back to a commit without a given submodule
and then moving back forward to a commit with the given submodule,
we shouldn't complain that updating would lose untracked file in
the submodule, because git currently does not checkout subprojects
during superproject check-out.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Thu, 19 Jul 2007 00:00:36 +0000 (17:00 -0700)]
Merge branch 'maint'

* maint:
  Force listingblocks to be monospaced in manpages
  Do not expect unlink(2) to fail on a directory.

17 years agoForce listingblocks to be monospaced in manpages
Julian Phillips [Wed, 18 Jul 2007 21:33:57 +0000 (22:33 +0100)]
Force listingblocks to be monospaced in manpages

For the html output we can use a stylesheet to make sure that the
listingblocks are presented in a monospaced font.  For the manpages do
it manually by inserting a ".ft C" before and ".ft" after the block in
question.

In order for these roff commands to get through to the manpage they
have to be element encoded to prevent quoting.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-p4: Cleanup, used common function for listing imported p4 branches
Simon Hausmann [Wed, 18 Jul 2007 15:27:50 +0000 (17:27 +0200)]
git-p4: Cleanup, used common function for listing imported p4 branches

Signed-off-by: Simon Hausmann <simon@lst.de>
17 years agogit-p4: Fix upstream branch detection for submit/rebase with multiple branches.
Simon Hausmann [Wed, 18 Jul 2007 10:40:12 +0000 (12:40 +0200)]
git-p4: Fix upstream branch detection for submit/rebase with multiple branches.

Don't use git name-rev to locate the upstream git-p4 branch for rebase and submit but instead locate the branch by comparing the depot paths.
name-rev may produce results like wrongbranch~12 as it uses the first match.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
17 years agogit-p4: Cleanup, make listExistingP4Branches a global function for later use.
Simon Hausmann [Wed, 18 Jul 2007 08:56:31 +0000 (10:56 +0200)]
git-p4: Cleanup, make listExistingP4Branches a global function for later use.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
17 years agoDo not expect unlink(2) to fail on a directory.
Junio C Hamano [Wed, 18 Jul 2007 05:58:28 +0000 (22:58 -0700)]
Do not expect unlink(2) to fail on a directory.

When "git checkout-index" checks out path A/B/C, it makes sure A
and A/B are truly directories; if there is a regular file or
symlink at A, we prefer to remove it.

We used to do this by catching an error return from mkdir(2),
and on EEXIST did unlink(2), and when it succeeded, tried
another mkdir(2).

Thomas Glanzmann found out the above does not work on Solaris
for a root user, as unlink(2) was so old fashioned there that it
allowed to unlink a directory.

As pointed out, this still doesn't guarantee that git won't call
"unlink()" on a directory (race conditions etc), but that's
fundamentally true (there is no "funlink()" like there is
"fstat()"), and besides, that is in no way git-specific (ie it's
true of any application that gets run as root).

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUpdate INSTALL
Junio C Hamano [Tue, 17 Jul 2007 06:59:54 +0000 (23:59 -0700)]
Update INSTALL

We haven't used bignum in rev-list from openssl nor elsewhere
for a long time.  Also git-gui is now part of git.git itself,
and depends on wish.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-p4: input to "p4 files" by stdin instead of arguments
Scott Lamb [Mon, 16 Jul 2007 03:58:11 +0000 (20:58 -0700)]
git-p4: input to "p4 files" by stdin instead of arguments

This approach, suggested by Alex Riesen, bypasses the need for xargs-style
argument list handling. The handling in question looks broken in a corner
case with SC_ARG_MAX=4096 and final argument over 96 characters.

Signed-off-by: Scott Lamb <slamb@slamb.org>
Signed-off-by: Simon Hausmann <simon@lst.de>
17 years agogit-p4: use subprocess in p4CmdList
Scott Lamb [Mon, 16 Jul 2007 03:58:10 +0000 (20:58 -0700)]
git-p4: use subprocess in p4CmdList

This allows bidirectional piping - useful for "-x -" to avoid commandline
arguments - and is a step toward bypassing the shell.

Signed-off-by: Scott Lamb <slamb@slamb.org>
Signed-off-by: Simon Hausmann <simon@lst.de>
17 years agoFix git-branch documentation when using remote refs
Francis Moreau [Mon, 16 Jul 2007 11:38:47 +0000 (13:38 +0200)]
Fix git-branch documentation when using remote refs

Signed-off-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svn: fix commiting renames over DAV with funky file names
Eric Wong [Mon, 16 Jul 2007 04:53:50 +0000 (21:53 -0700)]
git-svn: fix commiting renames over DAV with funky file names

Renaming files with non-URI friendly characters caused
breakage when committing to DAV repositories (over http(s)).

Even if I try leaving out the $self->{url} from the return value
of url_path(), a partial (without host), unescaped path name
does not work.

Filenames for DAV repos need to be URI-encoded before being
passed to the library.  Since this bug did not affect file://
and svn:// repos, the git-svn test library needed to be expanded
to include support for starting Apache with mod_dav_svn enabled.

This new test is not enabled by default, but can be enabled by
setting SVN_HTTPD_PORT to any available TCP/IP port on
127.0.0.1.

Additionally, for running this test, the following variables
(with defaults shown) can be changed for the suitable system.
The default values are set for Debian systems:

  SVN_HTTPD_MODULE_PATH=/usr/lib/apache2/modules
  SVN_HTTPD_PATH=/usr/sbin/apache2

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/emacs/Makefile: Also install .el files.
David Kastrup [Sun, 15 Jul 2007 09:46:11 +0000 (11:46 +0200)]
contrib/emacs/Makefile: Also install .el files.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoGIT v1.5.3-rc2 v1.5.3-rc2
Junio C Hamano [Sun, 15 Jul 2007 23:41:17 +0000 (16:41 -0700)]
GIT v1.5.3-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDemote git-p4import to contrib status.
Sean [Sun, 15 Jul 2007 19:52:32 +0000 (15:52 -0400)]
Demote git-p4import to contrib status.

Move git-p4import.py and Documentation/git-p4import.txt into
a contrib/p4import directory.   Add a README there directing
people to contrib/fast-import/git-p4 as a better alternative.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRemove p4 rpm from git.spec.in.
Sean [Sun, 15 Jul 2007 19:51:01 +0000 (15:51 -0400)]
Remove p4 rpm from git.spec.in.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRemove "WITH_P4IMPORT" knob from the Makefile
Sean [Sun, 15 Jul 2007 19:49:33 +0000 (15:49 -0400)]
Remove "WITH_P4IMPORT" knob from the Makefile

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-cvsserver: detect/diagnose write failure, etc.
Jim Meyering [Sat, 14 Jul 2007 18:48:42 +0000 (20:48 +0200)]
git-cvsserver: detect/diagnose write failure, etc.

There were many operations that did not notice and report errors
to the CVS client, which would have resulted in corrupt working
tree.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUse $(RM) in Makefiles instead of 'rm -f'
Emil Medve [Sat, 14 Jul 2007 17:51:44 +0000 (12:51 -0500)]
Use $(RM) in Makefiles instead of 'rm -f'

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'master' of git://repo.or.cz/git/fastimport
Junio C Hamano [Sun, 15 Jul 2007 05:57:47 +0000 (22:57 -0700)]
Merge branch 'master' of git://repo.or.cz/git/fastimport

* 'master' of git://repo.or.cz/git/fastimport:
  Teach fast-import to recursively copy files/directories
  Fix git-p4 on Windows to not use the Posix sysconf function.
  Correct trivial typo in fast-import documentation

17 years agoDocumentation/git-commit-tree: remove description of a nonexistent limitation
Junio C Hamano [Sun, 15 Jul 2007 05:56:47 +0000 (22:56 -0700)]
Documentation/git-commit-tree: remove description of a nonexistent limitation

Noticed by Geoff Richards.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake every builtin-*.c file #include "builtin.h"
Peter Hagervall [Sat, 14 Jul 2007 23:14:45 +0000 (01:14 +0200)]
Make every builtin-*.c file #include "builtin.h"

Make every builtin-*.c file #include "builtin.h".

Also takes care of some declaration/definition mismatches.

Signed-off-by: Peter Hagervall <hager@cs.umu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoTeach fast-import to recursively copy files/directories
Shawn O. Pearce [Sun, 15 Jul 2007 05:40:37 +0000 (01:40 -0400)]
Teach fast-import to recursively copy files/directories

Some source material (e.g. Subversion dump files) perform directory
renames by telling us the directory was copied, then deleted in the
same revision.  This makes it difficult for a frontend to convert
such data formats to a fast-import stream, as all the frontend has
on hand is "Copy a/ to b/; Delete a/" with no details about what
files are in a/, unless the frontend also kept track of all files.

The new 'C' subcommand within a commit allows the frontend to make a
recursive copy of one path to another path within the branch, without
needing to keep track of the individual file paths.  The metadata
copy is performed in memory efficiently, but is implemented as a
copy-immediately operation, rather than copy-on-write.

With this new 'C' subcommand frontends could obviously implement an
'R' (rename) on their own as a combination of 'C' and 'D' (delete),
but since we have already offered up 'R' in the past and it is a
trivial thing to keep implemented I'm not going to deprecate it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoFix git-p4 on Windows to not use the Posix sysconf function.
Marius Storm-Olsen [Fri, 13 Jul 2007 12:39:05 +0000 (14:39 +0200)]
Fix git-p4 on Windows to not use the Posix sysconf function.

Add condition for Windows, since it doesn't support the os.sysconf module.
We hardcode the commandline limit to 2K, as that should work on most
Windows platforms.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-svn: remove leading slashes from fetch lines in the generate config
Eric Wong [Sat, 14 Jul 2007 19:40:32 +0000 (12:40 -0700)]
git-svn: remove leading slashes from fetch lines in the generate config

We were previously sensitive to leading slashes in the fetch
lines and incorrectly writing them to the config if the user
used them (needlessly) in the command-line.

This fixes the issue and allows us to play nicely with legacy
configs that have leading slashes in fetch lines.

Thanks to Bradford Smith for figuring this out for me:
>
> This works:
>
> git-svn clone https://my.server.net/repos/path/ -Ttrunk/testing
>   -ttags/testing -bbranches/testing testing
>
> This doesn't:
>
> git-svn clone https://my.server.net/repos/path -T/trunk/testing
>   -t/tags/testing -b/branches/testing testing

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUpdate .mailmap
Junio C Hamano [Sat, 14 Jul 2007 20:44:58 +0000 (13:44 -0700)]
Update .mailmap

The script "contrib/stats/mailmap.pl" found a few missed ones.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd contrib/stats/mailmap.pl script
Junio C Hamano [Sat, 14 Jul 2007 20:43:09 +0000 (13:43 -0700)]
Add contrib/stats/mailmap.pl script

This script reads the existing commit log and .mailmap file,
and outputs author e-mail addresses that would map to more
than one names (most likely due to difference in the way they
are spelled, but some are due to ancient botched commits).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRemove useless uses of cat, and replace with filename arguments
Josh Triplett [Sat, 14 Jul 2007 08:05:43 +0000 (01:05 -0700)]
Remove useless uses of cat, and replace with filename arguments

Replace uses of cat that do nothing but writing the contents of
a single file to another command via pipe.

[jc: Original patch from Josh was somewhat buggy and rewrote
"cat $file | wc -l" to "wc -l $file", but this one should be Ok.]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMore permissive "git-rm --cached" behavior without -f.
Matthieu Moy [Fri, 13 Jul 2007 17:41:38 +0000 (19:41 +0200)]
More permissive "git-rm --cached" behavior without -f.

In the previous behavior, "git-rm --cached" (without -f) had the same
restriction as "git-rm". This forced the user to use the -f flag in
situations which weren't actually dangerous, like:

$ git add foo           # oops, I didn't want this
$ git rm --cached foo   # back to initial situation

Previously, the index had to match the file *and* the HEAD. With
--cached, the index must now match the file *or* the HEAD. The behavior
without --cached is unchanged, but provides better error messages.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument new --date=<format>
Junio C Hamano [Sat, 14 Jul 2007 06:48:03 +0000 (23:48 -0700)]
Document new --date=<format>

Now, git-log family can take full range of internally supported date format
to their --date=<format> argument.  Document it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoWire new date formats to --date=<format> parser.
Junio C Hamano [Sat, 14 Jul 2007 06:03:37 +0000 (23:03 -0700)]
Wire new date formats to --date=<format> parser.

Now we can use all internally supported date formats with

git log --date=<format>

syntax.  Earlier, we only allowed relative/local/default.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake show_rfc2822_date() just another date output format.
Junio C Hamano [Sat, 14 Jul 2007 06:14:52 +0000 (23:14 -0700)]
Make show_rfc2822_date() just another date output format.

These days, show_date() takes a date_mode parameter to specify
the output format, and a separate specialized function for dates
in E-mails does not make much sense anymore.

This retires show_rfc2822_date() function and make it just
another date output format.

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