Code

git.git
16 years agoGIT 1.5.3-rc4 v1.5.3-rc4
Junio C Hamano [Fri, 3 Aug 2007 22:33:57 +0000 (15:33 -0700)]
GIT 1.5.3-rc4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix bogus use of printf in t3700 test
Junio C Hamano [Fri, 3 Aug 2007 21:31:47 +0000 (14:31 -0700)]
Fix bogus use of printf in t3700 test

The hashed contents did not matter in the end result, but it passed
an uninitialized variable to printf, which caused it to emit empty
while giving an error/usage message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: do not choke on recursive symlink
Junio C Hamano [Fri, 27 Jul 2007 08:23:03 +0000 (01:23 -0700)]
gitweb: do not choke on recursive symlink

If somebody used to advertise his repository that physically
resides at /pub/lic.git/ as:

git://git.example.com/pub/lic.git/

but now wants to use --base-path to allow:

git://git.example.com/lic.git/

she can start git-daemon with --base-path option, like this:

git-daemon --base-path=/pub --export-all

During the transition, however, she would also want to allow
older URL as well.  One natural way to achieve that is to create
a symlink:

ln -s /pub /pub/pub

so that a request to git://git.example.com/pub/lic.git/ is first
translated by --base-path to a request to /pub/pub/lic.git/
which goes to /pub/lic.git, thanks to the symlink.

So far so good.

However, gitweb chokes if there is such a symlink (File::Find
barfs with "/pub/pub is a recursive symbolic link").  Make the
code ignore such a symlink.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix work-tree related breakages
Junio C Hamano [Thu, 2 Aug 2007 22:10:56 +0000 (15:10 -0700)]
Fix work-tree related breakages

In set_work_tree(), variable rel needs to be reinitialized to
NULL on every call (it should not be static).

Make sure the incoming dir variable is not too long before
copying to the temporary buffer, and make sure chdir to the
resulting directory succeeds.

This was spotted and fixed by Alex and Johannes in a handful
patch exchanges.  Here is the final version.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
16 years agoFix documentation for core.gitproxy to reflect code
David Symonds [Thu, 2 Aug 2007 22:45:56 +0000 (08:45 +1000)]
Fix documentation for core.gitproxy to reflect code

The current implementation of core.gitproxy only operates on
git:// URLs, so the ssh:// examples and custom protocol examples
have been removed or edited.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoread-tree: remove unnecessary call to setup_git_directory()
Johannes Schindelin [Thu, 2 Aug 2007 21:36:37 +0000 (22:36 +0100)]
read-tree: remove unnecessary call to setup_git_directory()

read-tree is already marked with RUN_SETUP in git.c, so there is
no need to call setup_git_directory() a second time.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoSupport building on GNU/Hurd
Thomas Schwinge [Thu, 2 Aug 2007 08:56:42 +0000 (10:56 +0200)]
Support building on GNU/Hurd

GNU/Hurd systems don't have strlcpy.

Signed-off-by: Thomas Schwinge <tschwinge@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix style nit in Python slicing.
Han-Wen Nienhuys [Mon, 23 Jul 2007 22:56:37 +0000 (15:56 -0700)]
Fix style nit in Python slicing.

Python slices start at 0 by default.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
16 years agoSort output of "p4 change" in incremental import before further
Han-Wen Nienhuys [Mon, 23 Jul 2007 22:51:49 +0000 (15:51 -0700)]
Sort output of "p4 change" in incremental import before further

processing

P4 change outputs the changes sorted for each directory separately. We
want the global ordering on the changes, hence we sort.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
16 years agoRelNotes 1.5.3 updates before -rc4
Junio C Hamano [Thu, 2 Aug 2007 07:13:03 +0000 (00:13 -0700)]
RelNotes 1.5.3 updates before -rc4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoWhen generating manpages, delete outdated targets first.
David Kastrup [Wed, 1 Aug 2007 23:48:44 +0000 (01:48 +0200)]
When generating manpages, delete outdated targets first.

This makes "make doc" work even if you made "sudo make doc" previously
by mistake.  Apparently an oversight: the other targets did this already.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase -i: fix for optional [branch] parameter
Johannes Schindelin [Wed, 1 Aug 2007 22:31:03 +0000 (23:31 +0100)]
rebase -i: fix for optional [branch] parameter

When calling "git rebase -i <upstream> <branch>", git should switch
to <branch> first.  This worked before, but I broke it by my
"Shut git rebase -i up" patch.

Fix that, and add a test to make sure that it does not break again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTry to be consistent with capitalization in the documentation
Steve Hoelzer [Wed, 1 Aug 2007 15:43:06 +0000 (10:43 -0500)]
Try to be consistent with capitalization in the documentation

Signed-off-by: Steve Hoelzer <shoelzer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-commit.sh: Permit the --amend message to be given with -m/-c/-C/-F.
Junio C Hamano [Thu, 2 Aug 2007 01:14:41 +0000 (18:14 -0700)]
git-commit.sh: Permit the --amend message to be given with -m/-c/-C/-F.

[jc: adjusted t/t7501 as this makes -F and --amend compatible]

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commands
David Kastrup [Wed, 1 Aug 2007 21:47:20 +0000 (23:47 +0200)]
git-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commands

The previous code only allowed specifying a single executable rather
than a complete command like "emacsclient --alternate-editor vi" in
those variables.  Since VISUAL/EDITOR appear to be traditionally
passed to a shell for interpretation (as corroborated with "less",
"mail" and "mailx", while the really ancient "more" indeed allows only
an executable name), the shell function git_editor has been amended
appropriately.

"eval" is employed to have quotes and similar interpreted _after_
expansion, so that specifying
EDITOR='"/home/dak/My Commands/notepad.exe"'
can be used for actually using commands with blanks.

Instead of passing just the first argument of git_editor on, we pass
all of them (so that +lineno might be employed at a later point of
time, or so that multiple files may be edited when appropriate).

Strictly speaking, there is a change in behavior: when
git config core.editor
returns a valid but empty string, the fallbacks are still searched.
This is more consistent, and the old code was problematic with regard
to multiple blanks.  Putting in additional quotes might have worked,
but quotes inside of command substitution inside of quotes is nasty
enough to not reliably work the same across "Bourne shells".

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoHack git-add--interactive to make it work with ActiveState Perl
Alex Riesen [Wed, 1 Aug 2007 12:57:43 +0000 (14:57 +0200)]
Hack git-add--interactive to make it work with ActiveState Perl

It wont work for arguments with special characters (like ", : or *).
It is generally not possible on Windows, so I didn't even try.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase -i: ignore patches that are already in the upstream
Johannes Schindelin [Wed, 1 Aug 2007 14:59:35 +0000 (15:59 +0100)]
rebase -i: ignore patches that are already in the upstream

Non-interactive rebase had this from the beginning -- match it by
using --cherry-pick option to rev-list.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoget_relative_cwd(): clarify why it handles dir == NULL
Johannes Schindelin [Wed, 1 Aug 2007 18:26:59 +0000 (19:26 +0100)]
get_relative_cwd(): clarify why it handles dir == NULL

The comment did not make a good case why it makes sense.
Clarify, and remove stale comment about the caller being lazy.
The behaviour on NULL input is pretty much intentional.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoClean up work-tree handling
Johannes Schindelin [Wed, 1 Aug 2007 00:30:14 +0000 (01:30 +0100)]
Clean up work-tree handling

The old version of work-tree support was an unholy mess, barely readable,
and not to the point.

For example, why do you have to provide a worktree, when it is not used?
As in "git status".  Now it works.

Another riddle was: if you can have work trees inside the git dir, why
are some programs complaining that they need a work tree?

IOW it is allowed to call

$ git --git-dir=../ --work-tree=. bla

when you really want to.  In this case, you are both in the git directory
and in the working tree.  So, programs have to actually test for the right
thing, namely if they are inside a working tree, and not if they are
inside a git directory.

Also, GIT_DIR=../.git should behave the same as if no GIT_DIR was
specified, unless there is a repository in the current working directory.
It does now.

The logic to determine if a repository is bare, or has a work tree
(tertium non datur), is this:

--work-tree=bla overrides GIT_WORK_TREE, which overrides core.bare = true,
which overrides core.worktree, which overrides GIT_DIR/.. when GIT_DIR
ends in /.git, which overrides the directory in which .git/ was found.

In related news, a long standing bug was fixed: when in .git/bla/x.git/,
which is a bare repository, git formerly assumed ../.. to be the
appropriate git dir.  This problem was reported by Shawn Pearce to have
caused much pain, where a colleague mistakenly ran "git init" in "/" a
long time ago, and bare repositories just would not work.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd set_git_dir() function
Johannes Schindelin [Wed, 1 Aug 2007 00:29:38 +0000 (01:29 +0100)]
Add set_git_dir() function

With the function set_git_dir() you can reset the path that will
be used for git_path(), git_dir() and friends.

The responsibility to close files and throw away information from the
old git_dir lies with the caller.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd functions get_relative_cwd() and is_inside_dir()
Johannes Schindelin [Wed, 1 Aug 2007 00:29:17 +0000 (01:29 +0100)]
Add functions get_relative_cwd() and is_inside_dir()

The function get_relative_cwd() works just as getcwd(), only that it
takes an absolute path as additional parameter, returning the prefix
of the current working directory relative to the given path.  If the
cwd is no subdirectory of the given path, it returns NULL.

is_inside_dir() is just a trivial wrapper over get_relative_cwd().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd is_absolute_path() and make_absolute_path()
Johannes Schindelin [Wed, 1 Aug 2007 00:28:59 +0000 (01:28 +0100)]
Add is_absolute_path() and make_absolute_path()

This patch adds convenience functions to work with absolute paths.
The function is_absolute_path() should help the efforts to integrate
the MinGW fork.

Note that make_absolute_path() returns a pointer to a static buffer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years ago--base-path-relaxed option
Jens Axboe [Fri, 27 Jul 2007 21:00:29 +0000 (14:00 -0700)]
--base-path-relaxed option

I switched git.kernel.dk to --base-path a few minutes ago, to get rid of
a /data/git postfix in the posted urls. But transitioning is tricky,
since now all old paths will fail miserably.

So I added this --base-path-relaxed option, that will make git-daemon
try the absolute path without prefixing --base-path before giving up.
With this in place and --base-path-relaxed added, both my new url of

    git://git.kernel.dk/linux-2.6-block.git

and the old

    git://git.kernel.dk/data/git/linux-2.6-block.git

work fine.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd test case for basic commit functionality.
Kristian Høgsberg [Tue, 31 Jul 2007 19:37:30 +0000 (15:37 -0400)]
Add test case for basic commit functionality.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.el: Take into account the core.excludesfile config option.
Alexandre Julliard [Tue, 31 Jul 2007 10:36:32 +0000 (12:36 +0200)]
git.el: Take into account the core.excludesfile config option.

Also don't require .git/info/exclude to exist in order to list unknown
files.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.el: Avoid using ewoc-set-data for compatibility with Emacs 21.
Alexandre Julliard [Wed, 1 Aug 2007 06:03:41 +0000 (23:03 -0700)]
git.el: Avoid using ewoc-set-data for compatibility with Emacs 21.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake verse of git-config manpage more readable
Alex Riesen [Tue, 31 Jul 2007 22:01:17 +0000 (00:01 +0200)]
Make verse of git-config manpage more readable

Also mention '--file' in FILES.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd a test for git-config --file
Alex Riesen [Tue, 31 Jul 2007 10:30:52 +0000 (12:30 +0200)]
Add a test for git-config --file

Check for non-0 exit code if the confiog file does not exist and
if it works exactly like when setting GIT_CONFIG.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd an option to specify a file to config builtin
Alex Riesen [Tue, 31 Jul 2007 09:58:43 +0000 (11:58 +0200)]
Add an option to specify a file to config builtin

There are (really!) systems where using environment variables is very
cumbersome (yes, Windows, it has problems unsetting them). Besides this
form is shorter.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomake the name of the library directory a config option
Robert Schiele [Wed, 1 Aug 2007 04:30:35 +0000 (06:30 +0200)]
make the name of the library directory a config option

Introduce new makefile variable lib to hold the name of the lib
directory ("lib" by default).  Also introduce a switch for configure
to specify this name with --with-lib=ARG.  This is useful for systems
that use a different name than "lib" (like "lib64" on some 64 bit
Linux architectures).

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 1 Aug 2007 04:12:32 +0000 (21:12 -0700)]
Merge branch 'maint'

* maint:
  rev-list --bisect: fix allocation of "int*" instead of "int".

16 years agorev-list --bisect: fix allocation of "int*" instead of "int".
Christian Couder [Tue, 31 Jul 2007 12:48:29 +0000 (14:48 +0200)]
rev-list --bisect: fix allocation of "int*" instead of "int".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.c: execution path
Junio C Hamano [Tue, 31 Jul 2007 09:06:14 +0000 (02:06 -0700)]
git.c: execution path

The comment before executing git subcommands were stale and confusing.
Noticed by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoadd option to find zlib in custom path
Robert Schiele [Sun, 29 Jul 2007 18:35:45 +0000 (20:35 +0200)]
add option to find zlib in custom path

Some systems do not provide zlib development headers and libraries in
default search path of the compiler.  For these systems we should allow
specifying the location by --with-zlib=PATH or by setting ZLIB_PATH in
the makefile.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUnset GIT_EDITOR while running tests.
Junio C Hamano [Tue, 31 Jul 2007 05:16:40 +0000 (22:16 -0700)]
Unset GIT_EDITOR while running tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoadd_file_to_index: skip rehashing if the cached stat already matches
Junio C Hamano [Tue, 31 Jul 2007 00:12:58 +0000 (17:12 -0700)]
add_file_to_index: skip rehashing if the cached stat already matches

An earlier commit 366bfcb6 broke git-add by moving read_cache()
call down, because it wanted the directory walking code to grab
paths that are already in the index.  The change serves its
purpose, but introduces a regression because the responsibility
of avoiding unnecessary reindexing by matching the cached stat
is shifted nowhere.

This makes it the job of add_file_to_index() function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: Translate invalid characters in refname
Robert Ewald [Mon, 30 Jul 2007 09:08:21 +0000 (11:08 +0200)]
git-svn: Translate invalid characters in refname

In git some characters are invalid as documented
in git-check-ref-format. In subversion these characters might
be valid, so a translation is required.

This patch does this translation by url escaping characters, that
are not allowed.

Credit goes to Eric Wong, martin f. krafft and Jan Hudec

Signed-off-by: Robert Ewald <robewald@gmx.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agowhite space fixes in setup.c
Johannes Schindelin [Sun, 29 Jul 2007 23:24:38 +0000 (00:24 +0100)]
white space fixes in setup.c

Some lines were not indented by tabs but by spaces.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/gitattributes.txt: typofix
David Soria Parra [Mon, 30 Jul 2007 01:50:24 +0000 (22:50 -0300)]
Documentation/gitattributes.txt: typofix

The file used for per-repository attribute setting is not
$GIT_DIR/info/gitattributes, but $GIT_DIR/info/attributes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase: try not to munge commit log message
Junio C Hamano [Sun, 29 Jul 2007 00:57:25 +0000 (17:57 -0700)]
rebase: try not to munge commit log message

This makes rebase/am keep the original commit log message
better, even when it does not conform to "single line paragraph
to say what it does, then explain and defend why it is a good
change in later paragraphs" convention.

This change is a two-edged sword.  While the earlier behaviour
would make such commit log messages more friendly to readers who
expect to get the birds-eye view with oneline summary formats,
users who primarily use git as a way to interact with foreign
SCM systems would not care much about the convenience of oneline
git log tools, but care more about preserving their own
convention.  This changes their commits less useful to readers
who read them with git tools while keeping them more consistent
with the foreign SCM systems they interact with.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosymbolic-ref, update-ref: do not refuse reflog message with LF
Junio C Hamano [Sun, 29 Jul 2007 00:20:52 +0000 (17:20 -0700)]
symbolic-ref, update-ref: do not refuse reflog message with LF

Earlier these tools refused to create a reflog entry when the
message given by the calling Porcelain had a LF in it, partially
to keep the file format integrity of reflog file, which is
one-entry-per-line.  These tools should not be dictating such a
policy.

Instead, let the codepath to write out the reflog entry worry
about the format integrity and allow messages with LF in them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agolog_ref_write() -- do not chomp reflog message at the first LF
Junio C Hamano [Sun, 29 Jul 2007 00:17:17 +0000 (17:17 -0700)]
log_ref_write() -- do not chomp reflog message at the first LF

A reflog file is organized as one-line-per-entry records, and we
enforced the file format integrity by chomping the given message
at the first LF.  This changes it to convert them to SP, which
is more in line with the --pretty=oneline format.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'bs/lock'
Junio C Hamano [Mon, 30 Jul 2007 06:09:54 +0000 (23:09 -0700)]
Merge branch 'bs/lock'

* bs/lock:
  Add test for symlinked configuration file updates.
  use lockfile.c routines in git_commit_set_multivar()
  fully resolve symlinks when creating lockfiles

16 years agoMerge branch 'master' of git://repo.or.cz/git-gui
Junio C Hamano [Mon, 30 Jul 2007 05:53:33 +0000 (22:53 -0700)]
Merge branch 'master' of git://repo.or.cz/git-gui

* 'master' of git://repo.or.cz/git-gui: (50 commits)
  git-gui: Minor refactoring of merge command line in merge support
  git-gui: Use more modern looking icons in the tree browser
  git-gui: Don't offer to stage hunks from untracked files
  git-gui: Make sure remotes are loaded when picking revisions
  git-gui: Use progress bar while resetting/aborting files
  git-gui: Honor core.excludesfile when listing extra files
  git-gui: Unify wording to say "to stage" instead of "to add"
  git-gui: Don't kill modified commit message buffer with merge templates
  git-gui: Remove usernames from absolute SSH urls during merging
  git-gui: Format tracking branch merges as though they were pulls
  git-gui: Cleanup bindings within merge dialog
  git-gui: Replace merge dialog with our revision picker widget
  git-gui: Show ref last update times in revision chooser tooltips
  git-gui: Display commit/tag/remote info in tooltip of revision picker
  git-gui: Save remote urls obtained from config/remotes setup
  git-gui: Avoid unnecessary symbolic-ref call during checkout
  git-gui: Refactor current branch menu items to make i18n easier
  git-gui: Refactor diff popup into a procedure to ease i18n work
  git-gui: Paper bag fix quitting crash after commit
  git-gui: Clarify meaning of add tracked menu option
  ...

16 years agogit-gui: Minor refactoring of merge command line in merge support gitgui-0.8.0
Shawn O. Pearce [Mon, 30 Jul 2007 00:21:54 +0000 (20:21 -0400)]
git-gui: Minor refactoring of merge command line in merge support

This is just a small code movement to cleanup how we generate
the command line for a merge.  I'm only doing it to make the
next series of changes slightly more readable.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Use more modern looking icons in the tree browser
Shawn O. Pearce [Mon, 30 Jul 2007 01:19:54 +0000 (21:19 -0400)]
git-gui: Use more modern looking icons in the tree browser

This is a replacement of all of the icons in our tree browser
window, as the prior icons just looked too 1980s Tk-ish.  The
icons used here are actually from a KDE themed look, so they
might actually be familiar to some users of git-gui.

Aside from using more modern looking icons we now have a special
icon for executable blobs, to make them stand out from the normal
non-executable blobs.  We also denote symlinks now with a different
icon, so they stand out from the other types of objects in the tree.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Don't offer to stage hunks from untracked files
Shawn O. Pearce [Mon, 30 Jul 2007 00:29:52 +0000 (20:29 -0400)]
git-gui: Don't offer to stage hunks from untracked files

If the user looks at an untracked file in our diff pane we used
to offer "Stage Hunk For Commit" in the context menu when they
right-clicked in that pane.  The problem is we don't actually
have any diff hunks in untracked files, so there is nothing to
really select for staging.  So we now grey out the menu item,
so the user cannot invoke it and think its broken when it does
not perform any useful action.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Make sure remotes are loaded when picking revisions
Shawn O. Pearce [Mon, 30 Jul 2007 01:26:42 +0000 (21:26 -0400)]
git-gui: Make sure remotes are loaded when picking revisions

If we are started for only a blame/browser/citool run we don't
usually initialize the list of remotes, or determine which refs
are tracking branches and which are local branch heads.  This is
because some of that work is relatively expensive and is usually
not going to be needed if we are started only for a blame, or to
make a single commit.

However by not loading the remote configuration we were crashing
if the user tried to open a browser for another branch through
the Repository menu, as our load_all_heads procedure was unable
to decide which refs/heads/ items were actually local heads.  We
now force all remote configuration data to be loaded if we have
not done so already and we are trying to create a revision mega
widget.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoMakefile: use $(FIND) instead of find
David Kastrup [Sun, 29 Jul 2007 22:23:28 +0000 (15:23 -0700)]
Makefile: use $(FIND) instead of find

Some people might prefer to be able to specify the find utility to
use.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-diff: turn on recursion by default
Jeff King [Sun, 29 Jul 2007 09:49:56 +0000 (05:49 -0400)]
git-diff: turn on recursion by default

The tree recursion behavior of git-diff may appear
inconsistent to the user because it depends on the format of
the patch as well as whether one is diffing between trees or
against the index.

Since git-diff is a porcelain wrapper for low-level diff
commands, it makes sense for its behavior to be consistent
no matter what is being diffed.  This patch turns on
recursion in all cases.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Use progress bar while resetting/aborting files
Shawn O. Pearce [Sun, 29 Jul 2007 08:06:51 +0000 (04:06 -0400)]
git-gui: Use progress bar while resetting/aborting files

Resetting a large number of files on a slow filesystem can take
considerable time, just as switching branches in such a case can
take more than two seconds.  We now take advantage of the progress
meter output by read-tree and show it in the main window status
bar, just like we do during checkout (branch switch).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Honor core.excludesfile when listing extra files
Shawn O. Pearce [Sun, 29 Jul 2007 07:22:27 +0000 (03:22 -0400)]
git-gui: Honor core.excludesfile when listing extra files

Recent git versions have a git-status that honors the core.excludesfile
configuration option when it reports on untracked files.  Unfortunately
I missed the introduction of this configuration option in the core
porcelain implementation, so it was not reflected here in git-gui.

Found and reported by Lars Noschinski <lars@public.noschinski.de>.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Unify wording to say "to stage" instead of "to add"
Christian Stimming [Sat, 28 Jul 2007 20:17:10 +0000 (22:17 +0200)]
git-gui: Unify wording to say "to stage" instead of "to add"

Also, the warning message when clicking "Reset" is adapted to
the wording "Reset" rather than a confusion "Cancel commit?".

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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

16 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>
16 years agoAdd test for symlinked configuration file updates.
Junio C Hamano [Fri, 27 Jul 2007 05:13:12 +0000 (22:13 -0700)]
Add test for symlinked configuration file updates.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agouse lockfile.c routines in git_commit_set_multivar()
Bradford C. Smith [Thu, 26 Jul 2007 16:55:28 +0000 (12:55 -0400)]
use lockfile.c routines in git_commit_set_multivar()

Changed git_commit_set_multivar() to use the routines provided by
lockfile.c to reduce code duplication and ensure consistent behavior.

Signed-off-by: Bradford C. Smith <bradford.carl.smith@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofully resolve symlinks when creating lockfiles
Bradford C. Smith [Thu, 26 Jul 2007 17:34:14 +0000 (13:34 -0400)]
fully resolve symlinks when creating lockfiles

Make the code for resolving symlinks in lockfile.c more robust as
follows:

1. Handle relative symlinks
2. recursively resolve symlink chains up to 5

[jc: removed lstat/stat calls to do things stupid way]

Signed-off-by: Bradford C. Smith <bradford.carl.smith@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Don't kill modified commit message buffer with merge templates
Shawn O. Pearce [Fri, 27 Jul 2007 06:30:15 +0000 (02:30 -0400)]
git-gui: Don't kill modified commit message buffer with merge templates

If the user is in the middle of a merge and has already started to
modify their commit message we were losing the user's changes when
they pressed 'Rescan' after resolving issues or making changes in
the working directory.

The problem here was our background timer that saves the commit
message buffer.  It marks the commit message buffer as not being
modified when it writes it out to disk, so during the rescan we
assumed the buffer should be replaced with what we read from the
MERGE_MSG file.  So we now only read these files from .git if we
have a valid backup file.  Since we clear it on commit this will
only have an impact while the user is actively editing the current
commit.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 years agogit-gui: Remove usernames from absolute SSH urls during merging
Shawn O. Pearce [Wed, 25 Jul 2007 09:02:38 +0000 (05:02 -0400)]
git-gui: Remove usernames from absolute SSH urls during merging

If we are being asked to merge a tracking branch that comes from a
remote repository accessed by the very common SSH URL format of
"user@host:/path/to/repo" then we really don't need the username
as part of the merge message, it only clutters up the history and
makes things more confusing.  So we instead clip the username part
off if the local filesystem path is absolute, as its probably not
going to be an ambiguous URL even when it is missing the username.

On the other hand we cannot clip the username off if the URL is
not absolute, because in such cases (e.g. "user@host:myrepo") the
directory that the repository path is resolved in is relative to
the user's home directory, and the username becomes important.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Format tracking branch merges as though they were pulls
Shawn O. Pearce [Wed, 25 Jul 2007 08:54:53 +0000 (04:54 -0400)]
git-gui: Format tracking branch merges as though they were pulls

If we are merging a tracking branch we know exactly what remote URL
that branch is fetched from, and what its name is on that remote
repository.  In this case we can setup a merge message that looks
just like a standard `git-pull $remote $branch` operation by filling
out FETCH_HEAD before we start git-merge, and then run git-merge just
like git-pull does.

I think the result of this behavior is that merges look a lot nicer
when the came off of local tracking branches, because they no longer
say "commit 'origin/...'" to describe the commit being merged but
instead now mention the specific repository we fetched those commits
from.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Cleanup bindings within merge dialog
Shawn O. Pearce [Wed, 25 Jul 2007 08:32:18 +0000 (04:32 -0400)]
git-gui: Cleanup bindings within merge dialog

Misc. code cleanups in the merge dialog's binding setup and action
button creation.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Replace merge dialog with our revision picker widget
Shawn O. Pearce [Wed, 25 Jul 2007 07:44:50 +0000 (03:44 -0400)]
git-gui: Replace merge dialog with our revision picker widget

Now that we only support merging one branch we can offer the user
a better user interface experience by allowing them to select the
revision they want to merge through our revision picking widget.

This change neatly solves the problem of locating a branch out of
a sea of 200 tracking branches, and of dealing with very long branch
names that all have a common prefix.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Show ref last update times in revision chooser tooltips
Shawn O. Pearce [Wed, 25 Jul 2007 08:20:02 +0000 (04:20 -0400)]
git-gui: Show ref last update times in revision chooser tooltips

If we can we now show the last modification date of a loose ref as
part of the tooltip information shown in the revision picker.  This
gives the user an indication of when was the last time that the ref
was modified locally, and may especially be of interest when looking
at a tracking branch.

If we cannot find the loose ref file than we try to fallback on the
reflog and scan it for the date of the last record.  We don't start
with the reflog however as scanning it backwards from the end is not
an easy thing to do in Tcl.  So I'm being lazy here and just going
through the entire file, line by line.  Since that is less efficient
than a single stat system call, its our fallback strategy.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Display commit/tag/remote info in tooltip of revision picker
Shawn O. Pearce [Wed, 25 Jul 2007 08:13:00 +0000 (04:13 -0400)]
git-gui: Display commit/tag/remote info in tooltip of revision picker

Our revision chooser mega-widget now sets up tooltips for itself so
that it displays details about a commit (or a tag and the commit
it refers to) when the user mouses over that line in the filtered
ref list.  If the item is from a remote tracking branch then we also
show the remote url and what branch on that remote we fetch from, so
the user has a clear concept of where that revision data originated.

To help the merge dialog I've also added a new constructor that
makes the dialog only offer unmerged revisions (those not in HEAD),
as this allows users to avoid performing merges only to get "Already
up to date" messages back from core Git.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Save remote urls obtained from config/remotes setup
Shawn O. Pearce [Wed, 25 Jul 2007 07:27:57 +0000 (03:27 -0400)]
git-gui: Save remote urls obtained from config/remotes setup

I'm storing the URLs of any pre-configured remote repositories
that we happen to come across so that we can later use these
URLs to show to the user in parts of the UI that might care.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>
16 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>