]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
16 years agoProvide git_config with a callback-data parameter
Johannes Schindelin [Wed, 14 May 2008 17:46:53 +0000 (18:46 +0100)] 
Provide git_config with a callback-data parameter

git_config() only had a function parameter, but no callback data
parameter.  This assumes that all callback functions only modify
global variables.

With this patch, every callback gets a void * parameter, and it is hoped
that this will help the libification effort.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch: fix variable export logic
Jeff King [Tue, 13 May 2008 08:46:38 +0000 (04:46 -0400)] 
filter-branch: fix variable export logic

filter-branch tries to restore "old" copies of some
environment variables by using the construct:

  unset var
  test -z "$old_var" || var="$old_var" && export var

This is just wrong.  AND-list and OR-list operators && and || have equal
precedence and they bind left to right.  The second term, var="$old"
assignment always succeeds, so we always end up exporting var.

On bash and dash, exporting an unset variable has no effect. However, on
some shells (such as FreeBSD's /bin/sh), the shell exports the empty
value.

This manifested itself in this case as git-filter-branch setting
GIT_INDEX_FILE to the empty string, which in turn caused its call to
git-read-tree to fail, leaving the working tree pointing at the original
HEAD instead of the rewritten one.

To fix this, we change the short-circuit logic to better match the intent:

  test -z "$old_var" || {
    var="$old_var" && export var
  }

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoclone: bsd shell portability fix
Jeff King [Tue, 13 May 2008 08:45:56 +0000 (04:45 -0400)] 
clone: bsd shell portability fix

When using /bin/sh from FreeBSD 6.1, the value of $? is lost
when calling a function inside the 'trap' action. This
resulted in clone erroneously indicating success when it
should have reported failure.

As a workaround, we save the value of $? before calling any
functions.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot5000: tar portability fix
Jeff King [Tue, 13 May 2008 08:45:32 +0000 (04:45 -0400)] 
t5000: tar portability fix

The output of 'tar tv' varies from system to system. In
particular, the t5000 was expecting to parse the date from
something like:

  -rw-rw-r-- root/root         0 2008-05-13 04:27 file

but FreeBSD's tar produces this:

  -rw-rw-r--  0 root   root        0 May 13 04:27 file

Instead of relying on tar's output, let's just extract the
file using tar and stat the result using perl.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofix bsd shell negation
Jeff King [Wed, 14 May 2008 04:01:22 +0000 (00:01 -0400)] 
fix bsd shell negation

On some shells (notably /bin/sh on FreeBSD 6.1), the
construct

  foo && ! bar | baz

is true if

  foo && baz

whereas for most other shells (such as bash) is true if

  foo && ! baz

We can work around this by specifying

  foo && ! (bar | baz)

which works everywhere.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoImprove reporting of errors in config file routines
Alex Riesen [Mon, 12 May 2008 21:41:04 +0000 (23:41 +0200)] 
Improve reporting of errors in config file routines

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'gp/bisect-fix'
Junio C Hamano [Mon, 12 May 2008 22:44:43 +0000 (15:44 -0700)] 
Merge branch 'gp/bisect-fix'

* gp/bisect-fix:
  bisect: print an error message when "git rev-list --bisect-vars" fails
  git-bisect.sh: don't accidentally override existing branch "bisect"

16 years agoMerge branch 'maint'
Junio C Hamano [Sun, 11 May 2008 19:09:18 +0000 (12:09 -0700)] 
Merge branch 'maint'

* maint:
  wt-status.h: declare global variables as extern
  builtin-commit.c: add -u as short name for --untracked-files
  git-repack: re-enable parsing of -n command line option

16 years agoMerge branch 'maint-1.5.4' into maint
Junio C Hamano [Sun, 11 May 2008 19:09:12 +0000 (12:09 -0700)] 
Merge branch 'maint-1.5.4' into maint

* maint-1.5.4:
  wt-status.h: declare global variables as extern
  builtin-commit.c: add -u as short name for --untracked-files
  git-repack: re-enable parsing of -n command line option

16 years agoMerge branch 'lt/core-optim'
Junio C Hamano [Sun, 11 May 2008 19:08:20 +0000 (12:08 -0700)] 
Merge branch 'lt/core-optim'

* lt/core-optim:
  Optimize symlink/directory detection
  Avoid some unnecessary lstat() calls
  is_racy_timestamp(): do not check timestamp for gitlinks
  diff-lib.c: rename check_work_tree_entity()
  diff: a submodule not checked out is not modified
  Add t7506 to test submodule related functions for git-status
  t4027: test diff for submodule with empty directory
  Make git-add behave more sensibly in a case-insensitive environment
  When adding files to the index, add support for case-independent matches
  Make unpack-tree update removed files before any updated files
  Make branch merging aware of underlying case-insensitive filsystems
  Add 'core.ignorecase' option
  Make hash_name_lookup able to do case-independent lookups
  Make "index_name_exists()" return the cache_entry it found
  Move name hashing functions into a file of its own
  Make unpack_trees_options bit flags actual bitfields

16 years agorev-parse --verify: do not output anything on error
Christian Couder [Sun, 11 May 2008 16:28:25 +0000 (18:28 +0200)] 
rev-parse --verify: do not output anything on error

Before this patch, when "git rev-parse --verify" was passed at least one
good rev and then anything, it would output something for the good rev
even if it would latter exit on error.

With this patch, we only output something if everything is ok.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorev-parse: fix using "--default" with "--verify"
Christian Couder [Sun, 11 May 2008 16:27:36 +0000 (18:27 +0200)] 
rev-parse: fix using "--default" with "--verify"

Before this patch, something like:

$ git rev-parse --verify HEAD --default master

did not work, while:

$ git rev-parse --default master --verify HEAD

worked.

This patch fixes that, so that they both work (assuming
HEAD and master can be parsed).

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorev-parse: add test script for "--verify"
Christian Couder [Sun, 11 May 2008 16:27:10 +0000 (18:27 +0200)] 
rev-parse: add test script for "--verify"

This patch documents the current behavior of "git rev-parse --verify".

This command is tested both with and without the "--quiet" and
"--default" options.

This shows some problems with the current behavior that will be fixed
in latter patches:

- in case of errors, there should be no good rev output on
stdout,
- with "--default" one test case is broken

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd svn-compatible "blame" output format to git-svn
Steven Grimm [Sun, 11 May 2008 05:11:18 +0000 (22:11 -0700)] 
Add svn-compatible "blame" output format to git-svn

git-svn blame produced output in the format of git blame; in environments
where there are scripts that read the output of svn blame, it's useful
to be able to use them with the output of git-svn. The git-compatible
format is still available using the new "--git-format" option.

This also fixes a bug in the initial git-svn blame implementation; it was
bombing out on uncommitted local changes.

Signed-off-by: Steven Grimm <koreth@midwinter.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomergetool: Make ECMerge use the settings as specified by the user in the GUI
Sebastian Schuberth [Tue, 6 May 2008 10:53:56 +0000 (12:53 +0200)] 
mergetool: Make ECMerge use the settings as specified by the user in the GUI

When run from the command line, ECMerge does not automatically use the same
settings for a merge / diff that it would use when starting the GUI and loading
files manually. In the first case the built-in factory defaults would be used,
while in the second case the settings the user has specified in the GUI would
be used, which can be misleading. Specifying the "--default" command line
option changes this behavior so that always the user specfified GUI settings
are used.

Signed-off-by: Sebastian Schuberth <sschuberth@visageimaging.com>
Tested-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-format-patch: add --no-binary to omit binary changes in the patch.
Caio Marcelo de Oliveira Filho [Fri, 9 May 2008 22:55:43 +0000 (19:55 -0300)] 
git-format-patch: add --no-binary to omit binary changes in the patch.

Add a new option --no-binary to git-format-patch so that no binary
changes are included in the generated patches, only notices that those
files changed.  This generate patches that cannot be applied, but still
is useful for generating mails for code review purposes.

See also: commit e47f306d4bf964def1a0b29e8f7cea419471dffd, where --binary
option was turned on by default.

Signed-off-by: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agowt-status.h: declare global variables as extern
Johannes Sixt [Fri, 9 May 2008 08:05:27 +0000 (10:05 +0200)] 
wt-status.h: declare global variables as extern

There are linkers out there that complain if a global non-static variable
is defined multiple times.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit.c: add -u as short name for --untracked-files
Sitaram Chamarty [Fri, 9 May 2008 17:12:55 +0000 (22:42 +0530)] 
builtin-commit.c: add -u as short name for --untracked-files

This makes the C code consistent with the documentation and the old shell
code.

Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-repack: re-enable parsing of -n command line option
A Large Angry SCM [Sat, 10 May 2008 20:52:51 +0000 (16:52 -0400)] 
git-repack: re-enable parsing of -n command line option

In commit 5715d0b (Migrate git-repack.sh to use git-rev-parse --parseopt,
2007-11-04), parsing of the '-n' command line option was accidentally lost
when git-repack.sh was migrated to use git-rev-parse --parseopt. This adds
it back.

Signed-off-by: A Large Angry SCM <gitzilla@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAllow tracking branches to set up rebase by default.
Dustin Sallings [Sat, 10 May 2008 22:36:29 +0000 (15:36 -0700)] 
Allow tracking branches to set up rebase by default.

Change cd67e4d4 introduced a new configuration parameter that told
pull to automatically perform a rebase instead of a merge.  This
change provides a configuration option to enable this feature
automatically when creating a new branch.

If the variable branch.autosetuprebase applies for a branch that's
being created, that branch will have branch.<name>.rebase set to true.

Signed-off-by: Dustin Sallings <dustin@spy.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: fix cloning of HTTP URLs with '+' in their path
Eric Wong [Sun, 11 May 2008 00:14:49 +0000 (17:14 -0700)] 
git-svn: fix cloning of HTTP URLs with '+' in their path

With this, git svn clone -s http://svn.gnome.org/svn/gtk+
is successful.

Also modified the funky rename test for this, which _does_
include escaped '+' signs for HTTP URLs.  SVN seems to accept
either "+" or "%2B" in filenames and directories (just not the
main URL), so I'll leave it alone for now.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoalloc_ref_from_str(): factor out a common pattern of alloc_ref from string
Krzysztof Kowalczyk [Sat, 10 May 2008 23:26:58 +0000 (16:26 -0700)] 
alloc_ref_from_str(): factor out a common pattern of alloc_ref from string

Also fix an underallocation in walker.c::interpret_target().

Signed-off-by: Krzysztof Kowalczyk <kkowalczyk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoOptimize symlink/directory detection
Linus Torvalds [Fri, 9 May 2008 16:21:07 +0000 (09:21 -0700)] 
Optimize symlink/directory detection

This is the base for making symlink detection in the middle fo a pathname
saner and (much) more efficient.

Under various loads, we want to verify that the full path leading up to a
filename is a real directory tree, and that when we successfully do an
'lstat()' on a filename, we don't get a false positive due to a symlink in
the middle of the path that git should have seen as a symlink, not as a
normal path component.

The 'has_symlink_leading_path()' function already did this, and cached
a single level of symlink information, but didn't cache the _lack_ of a
symlink, so the normal behaviour was actually the wrong way around, and we
ended up doing an 'lstat()' on each path component to check that it was a
real directory.

This caches the last detected full directory and symlink entries, and
speeds up especially deep directory structures a lot by avoiding to
lstat() all the directories leading up to each entry in the index.

[ This can - and should - probably be extended upon so that we eventually
  never do a bare 'lstat()' on any path entries at *all* when checking the
  index, but always check the full path carefully. Right now we do not
  generally check the whole path for all our normal quick index
  revalidation.

  We should also make sure that we're careful about all the invalidation,
  ie when we remove a link and replace it by a directory we should
  invalidate the symlink cache if it matches (and vice versa for the
  directory cache).

  But regardless, the basic function needs to be sane to do that. The old
  'has_symlink_leading_path()' was not capable enough - or indeed the code
  readable enough - to really do that sanely. So I'm pushing this as not
  just an optimization, but as a base for further work. ]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAvoid some unnecessary lstat() calls
Linus Torvalds [Fri, 9 May 2008 16:11:43 +0000 (09:11 -0700)] 
Avoid some unnecessary lstat() calls

The commit sequence used to do

if (file_exists(p->path))
add_file_to_cache(p->path, 0);

where both "file_exists()" and "add_file_to_cache()" needed to do a
lstat() on the path to do their work.

This cuts down 'lstat()' calls for the partial commit case by two
for each path we know about (because we do this twice per path).

Just move the lstat() to the caller instead (that's all that
"file_exists()" really does), and pass the stat information down to the
add_to_cache() function.

This essentially makes 'add_to_index()' the core function that adds a path
to the index, getting the index pointer, the pathname and the stat
information as arguments. There are then shorthand helper functions that
use this core function:

 - 'add_to_cache()' is just 'add_to_index()' with the default index

 - 'add_file_to_cache/index()' is the same, but does the lstat() call
   itself, so you can pass just the pathname if you don't already have the
   stat information available.

So old users of the 'add_file_to_xyzzy()' are essentially left unchanged,
and this just exposes the more generic helper function that can take
existing stat information into account.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'py/diff-submodule'
Junio C Hamano [Sun, 11 May 2008 01:16:25 +0000 (18:16 -0700)] 
Merge branch 'py/diff-submodule'

* py/diff-submodule:
  is_racy_timestamp(): do not check timestamp for gitlinks
  diff-lib.c: rename check_work_tree_entity()
  diff: a submodule not checked out is not modified
  Add t7506 to test submodule related functions for git-status
  t4027: test diff for submodule with empty directory

16 years agoMerge branch 'lt/case-insensitive'
Junio C Hamano [Sun, 11 May 2008 01:14:28 +0000 (18:14 -0700)] 
Merge branch 'lt/case-insensitive'

* lt/case-insensitive:
  Make git-add behave more sensibly in a case-insensitive environment
  When adding files to the index, add support for case-independent matches
  Make unpack-tree update removed files before any updated files
  Make branch merging aware of underlying case-insensitive filsystems
  Add 'core.ignorecase' option
  Make hash_name_lookup able to do case-independent lookups
  Make "index_name_exists()" return the cache_entry it found
  Move name hashing functions into a file of its own
  Make unpack_trees_options bit flags actual bitfields

16 years agoMerge branch 'maint'
Junio C Hamano [Fri, 9 May 2008 03:50:03 +0000 (20:50 -0700)] 
Merge branch 'maint'

* maint:
  Documentation/config.txt: Mention branch.<name>.rebase applies to "git pull"
  doc: clarify definition of "update" for git-add -u

16 years agoMerge branch 'maint-1.5.4' into maint
Junio C Hamano [Fri, 9 May 2008 03:12:44 +0000 (20:12 -0700)] 
Merge branch 'maint-1.5.4' into maint

* maint-1.5.4:
  Documentation/config.txt: Mention branch.<name>.rebase applies to "git pull"
  doc: clarify definition of "update" for git-add -u

16 years agoMerge branch 'sg/merge-options' (early part)
Junio C Hamano [Fri, 9 May 2008 03:06:36 +0000 (20:06 -0700)] 
Merge branch 'sg/merge-options' (early part)

* 'sg/merge-options' (early part):
  merge, pull: add '--(no-)log' command line option
  fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable
  add 'merge.stat' config variable
  merge, pull: introduce '--(no-)stat' option
  doc: moved merge.* config variables into separate merge-config.txt

16 years agoMerge branch 'db/learn-HEAD'
Junio C Hamano [Fri, 9 May 2008 03:06:23 +0000 (20:06 -0700)] 
Merge branch 'db/learn-HEAD'

* db/learn-HEAD:
  Make ls-remote http://... list HEAD, like for git://...
  Make walker.fetch_ref() take a struct ref.

16 years agoMerge branch 'jn/webfeed'
Junio C Hamano [Fri, 9 May 2008 03:06:15 +0000 (20:06 -0700)] 
Merge branch 'jn/webfeed'

* jn/webfeed:
  gitweb: Use feed link according to current view

16 years agoMerge branch 'cc/help'
Junio C Hamano [Fri, 9 May 2008 03:06:11 +0000 (20:06 -0700)] 
Merge branch 'cc/help'

* cc/help:
  documentation: web--browse: add a note about konqueror
  documentation: help: add info about "man.<tool>.cmd" config var
  help: use "man.<tool>.cmd" as custom man viewer command
  documentation: help: add "man.<tool>.path" config variable
  help: use man viewer path from "man.<tool>.path" config var

16 years agoMerge branch 'dm/cherry-pick-s'
Junio C Hamano [Fri, 9 May 2008 03:06:06 +0000 (20:06 -0700)] 
Merge branch 'dm/cherry-pick-s'

* dm/cherry-pick-s:
  Allow cherry-pick (and revert) to add signoff line

16 years agoMerge branch 'lt/dirmatch-optim'
Junio C Hamano [Fri, 9 May 2008 03:05:43 +0000 (20:05 -0700)] 
Merge branch 'lt/dirmatch-optim'

* lt/dirmatch-optim:
  Optimize match_pathspec() to avoid fnmatch()

16 years agobisect: print an error message when "git rev-list --bisect-vars" fails
Christian Couder [Wed, 7 May 2008 21:54:28 +0000 (23:54 +0200)] 
bisect: print an error message when "git rev-list --bisect-vars" fails

Before this patch no error was printed when "git rev-list --bisect-vars"
failed. This can happen when bad and good revs are mistaken.

This patch prints an error message on stderr that describe the likely
failure cause.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocompat-util: avoid macro redefinition warning
Johannes Sixt [Thu, 8 May 2008 07:34:49 +0000 (09:34 +0200)] 
compat-util: avoid macro redefinition warning

Some systems define fopen as a macro based on compiler settings, and
unconditionally redefining it triggers a compilation warning.

16 years agocompat/fopen.c: avoid clobbering the system defined fopen macro
Brandon Casey [Wed, 7 May 2008 17:34:18 +0000 (12:34 -0500)] 
compat/fopen.c: avoid clobbering the system defined fopen macro

Some systems define fopen as a macro based on compiler settings.
The previous technique for reverting to the system fopen function
by merely undefining fopen is inadequate in this case. Instead,
avoid defining fopen entirely when compiling this source file.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Tested-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/config.txt: Mention branch.<name>.rebase applies to "git pull"
Dustin Sallings [Thu, 8 May 2008 18:28:07 +0000 (11:28 -0700)] 
Documentation/config.txt: Mention branch.<name>.rebase applies to "git pull"

Signed-off-by: Dustin Sallings <dustin@spy.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodoc: clarify definition of "update" for git-add -u
Jeff King [Thu, 8 May 2008 17:25:06 +0000 (13:25 -0400)] 
doc: clarify definition of "update" for git-add -u

The "-u" option is described only in terms of "updating"
files, which in turn is described only as "similar to what
git commit -a does". Let's be a little more specific about
what updating entails.

Suggested by Geoffrey Irving.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: bisect: add a few "git bisect run" examples
Christian Couder [Wed, 7 May 2008 23:00:54 +0000 (01:00 +0200)] 
Documentation: bisect: add a few "git bisect run" examples

Before this patch, there were no "git bisect run" example.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/config.txt: Add git-gui options
Gustaf Hendeby [Thu, 8 May 2008 08:55:02 +0000 (10:55 +0200)] 
Documentation/config.txt: Add git-gui options

The 'git gui' has a number of options that can be specified using the
options dialog. Sometimes it is convenient to be able to specify these
from the command line, therefor document these options.

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Acked-by: Shawn O. Pearce <speace@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: improve "add", "pull" and "format-patch" examples
Christian Couder [Wed, 7 May 2008 04:29:28 +0000 (06:29 +0200)] 
Documentation: improve "add", "pull" and "format-patch" examples

Before this patch in "git-add.txt" and "git-format-patch.txt", the
commands used in the examples were "git-CMD" instead of "git CMD".
This patch fixes that.

In "git-pull.txt" only the last example had the code sample in an
asciidoc "Listing Block", and in the other two files, none.
This patch fixes that by putting all code samples in listing
blocks.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoBe more careful with objects directory permissions on clone
Mark Hills [Mon, 5 May 2008 16:46:42 +0000 (17:46 +0100)] 
Be more careful with objects directory permissions on clone

Honour the setgid and umask when re-creating the objects directory
at the destination.

cpio in copy-pass mode aims to copy file permissions which causes this
problem and cannot be disabled. Be explicit by copying the directory
structure first, honouring the permissions at the destination, then copy
the files with 0444 permissions. This also avoids bugs in some versions
of cpio.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'jc/lstat'
Junio C Hamano [Tue, 6 May 2008 02:16:26 +0000 (19:16 -0700)] 
Merge branch 'jc/lstat'

* jc/lstat:
  diff-files: mark an index entry we know is up-to-date as such
  write_index(): optimize ce_smudge_racily_clean_entry() calls with CE_UPTODATE

16 years agoMerge branch 'bc/filter-branch'
Junio C Hamano [Tue, 6 May 2008 02:16:20 +0000 (19:16 -0700)] 
Merge branch 'bc/filter-branch'

* bc/filter-branch:
  filter-branch.sh: support nearly proper tag name filtering

16 years agoMerge branch 'lh/git-file'
Junio C Hamano [Tue, 6 May 2008 02:16:16 +0000 (19:16 -0700)] 
Merge branch 'lh/git-file'

* lh/git-file:
  Teach GIT-VERSION-GEN about the .git file
  Teach git-submodule.sh about the .git file
  Teach resolve_gitlink_ref() about the .git file
  Add platform-independent .git "symlink"

16 years agoMerge branch 'jk/fetch-status'
Junio C Hamano [Tue, 6 May 2008 02:16:12 +0000 (19:16 -0700)] 
Merge branch 'jk/fetch-status'

* jk/fetch-status:
  git-fetch: always show status of non-tracking-ref fetches

16 years agoMerge branch 'lh/branch-merged'
Junio C Hamano [Tue, 6 May 2008 02:16:06 +0000 (19:16 -0700)] 
Merge branch 'lh/branch-merged'

* lh/branch-merged:
  Add tests for `branch --[no-]merged`
  git-branch.txt: compare --contains, --merged and --no-merged
  git-branch: add support for --merged and --no-merged

16 years agoMerge branch 'pb/remote-mirror-config'
Junio C Hamano [Tue, 6 May 2008 02:15:39 +0000 (19:15 -0700)] 
Merge branch 'pb/remote-mirror-config'

* pb/remote-mirror-config:
  Add a remote.*.mirror configuration option

16 years agopost-merge: Add it's not executed if merge failed.
Jörg Sommer [Mon, 5 May 2008 09:06:49 +0000 (11:06 +0200)] 
post-merge: Add it's not executed if merge failed.

Signed-off-by: J��rg Sommer <joerg@alea.gnuu.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-bisect.sh: don't accidentally override existing branch "bisect"
Gerrit Pape [Mon, 5 May 2008 07:43:00 +0000 (07:43 +0000)] 
git-bisect.sh: don't accidentally override existing branch "bisect"

If a branch named "bisect" or "new-bisect" already was created in the
repo by other means than git bisect, doing a git bisect used to override
the branch without a warning.  Now if the branch "bisect" or
"new-bisect" already exists, and it was not created by git bisect itself,
git bisect start fails with an appropriate error message.  Additionally,
if checking out a new bisect state fails due to a merge problem, git
bisect cleans up the temporary branch "new-bisect".

The accidental override has been noticed by Andres Salomon, reported
through
 http://bugs.debian.org/478647

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: Add create-ignore to git svn manual
Gustaf Hendeby [Sun, 4 May 2008 22:33:10 +0000 (00:33 +0200)] 
Documentation: Add create-ignore to git svn manual

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: Make create-ignore use git add -f
Gustaf Hendeby [Sun, 4 May 2008 22:33:09 +0000 (00:33 +0200)] 
git-svn: Make create-ignore use git add -f

When having a svn:ignore that ignores the .gitignore file the -f
option to git add must be used to avoid git complaining about adding
an ignored file and hence stop the process of creating .gitignores.

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoINSTALL: add a note about GNU interactive tools has been renamed
Miklos Vajna [Sun, 4 May 2008 14:55:11 +0000 (16:55 +0200)] 
INSTALL: add a note about GNU interactive tools has been renamed

In recent versions GNU's git has been renamed to gnuit, document this
while talking about how to resolve the conflict.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agois_racy_timestamp(): do not check timestamp for gitlinks
Junio C Hamano [Sun, 4 May 2008 00:24:28 +0000 (17:24 -0700)] 
is_racy_timestamp(): do not check timestamp for gitlinks

Because we do not even check the timestamp to determie if a gitlink
is up to date or not, triggering the racy-timestamp check for gitlinks
does not make sense.

This fixes the recently added test in t7506.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff-lib.c: rename check_work_tree_entity()
Junio C Hamano [Sun, 4 May 2008 00:23:46 +0000 (17:23 -0700)] 
diff-lib.c: rename check_work_tree_entity()

The function is about checking for removed work tree item, so name it
accordingly to avoid future confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff: a submodule not checked out is not modified
Junio C Hamano [Sun, 4 May 2008 00:04:42 +0000 (17:04 -0700)] 
diff: a submodule not checked out is not modified

948dd34 (diff-index: careful when inspecting work tree items, 2008-03-30)
made the work tree check careful not to be fooled by a new directory that
exists at a place the index expects a blob.  For such a change to be a
typechange from blob to submodule, the new directory has to be a
repository.

However, if the index expects a submodule there, we should not insist the
work tree entity to be a repository --- a simple directory that is not a
full fledged repository (even an empty directory would do) should be
considered an unmodified subproject, because that is how a superproject
with a submodule is checked out sparsely by default.

This makes the function check_work_tree_entity() even more careful not to
report a submodule that is not checked out as removed.  It fixes the
recently added test in t4027.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd t7506 to test submodule related functions for git-status
Ping Yin [Fri, 2 May 2008 13:35:34 +0000 (21:35 +0800)] 
Add t7506 to test submodule related functions for git-status

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot4027: test diff for submodule with empty directory
Ping Yin [Fri, 2 May 2008 13:35:33 +0000 (21:35 +0800)] 
t4027: test diff for submodule with empty directory

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoCleanup xread() loops to use read_in_full()
Heikki Orsila [Sat, 3 May 2008 13:27:26 +0000 (16:27 +0300)] 
Cleanup xread() loops to use read_in_full()

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Sun, 4 May 2008 05:15:09 +0000 (22:15 -0700)] 
Merge branch 'maint'

* maint:
  checkout: don't rfc2047-encode oneline on detached HEAD
  filter-branch: Documentation fix.

16 years agoMerge branch 'maint-1.5.4' into maint
Junio C Hamano [Sun, 4 May 2008 01:55:33 +0000 (18:55 -0700)] 
Merge branch 'maint-1.5.4' into maint

* maint-1.5.4:
  filter-branch: Documentation fix.

16 years agocheckout: don't rfc2047-encode oneline on detached HEAD
Jeff King [Fri, 2 May 2008 14:05:36 +0000 (10:05 -0400)] 
checkout: don't rfc2047-encode oneline on detached HEAD

When calling pretty_print_commit, there is an implicit
assumption that passing in a non-NULL "subject" variable
for oneline or email formats means that the output is part
of a subject and therefore "subject" to rfc2047 encoding.
This is not the desired effect when reporting the movement
of detached HEAD.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: hooks: fix missing verb in pre-applypatch description
Christian Couder [Fri, 2 May 2008 03:30:41 +0000 (05:30 +0200)] 
Documentation: hooks: fix missing verb in pre-applypatch description

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch: Documentation fix.
Florian Ragwitz [Wed, 30 Apr 2008 07:47:43 +0000 (09:47 +0200)] 
filter-branch: Documentation fix.

It's --msg-filter, not --message-filter.

Signed-off-by: Florian Ragwitz <rafl@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agolog: print log entry terminator even if the message is empty
Adam Simpkins [Tue, 29 Apr 2008 08:33:00 +0000 (01:33 -0700)] 
log: print log entry terminator even if the message is empty

This eliminates a special case in the show_log() function, to help
simplify the terminator semantics.  Now show_log() always prints a
newline after the log entry when use_terminator is set, even if the log
message is empty.

This change should only affect the --pretty=tformat output, since that
was the only way to trigger this special case.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRemove dead code: show_log() sep argument and diff_options.msg_sep
Adam Simpkins [Tue, 29 Apr 2008 08:32:59 +0000 (01:32 -0700)] 
Remove dead code: show_log() sep argument and diff_options.msg_sep

These variables were made unnecessary by commit
3969cf7db1a13a78f3b7a36d8c1084bbe0a53459.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: Same default as cvsimport when using --use-log-author
Stephen R. van den Berg [Tue, 29 Apr 2008 21:20:32 +0000 (23:20 +0200)] 
git-svn: Same default as cvsimport when using --use-log-author

When using git-cvsimport, the author is inferred from the cvs commit,
e.g. cvs commit logname is foobaruser, then the author field in git
results in:

Author: foobaruser <foobaruser>

Which is not perfect, but perfectly acceptable given the circumstances.

The default git-svn import however, results in:

Author: foobaruser <foobaruser@acf43c95-373e-0410-b603-e72c3f656dc1>

When using mixes of imports, from CVS and SVN into the same git
repository, you'd like to harmonise the imports to the format cvsimport
uses.
git-svn supports an experimental option --use-log-author which currently
results in the same logentry as without that option when no From: or
Signed-off-by: is found in the logentry ($email currently ends up empty,
and hence is generated again).

This patches harmonises the result with cvsimport, and makes
git-svn --use-log-author produce:

Author: foobaruser <foobaruser>

Signed-off-by: Stephen R. van den Berg <srb@cuci.nl>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 30 Apr 2008 18:43:37 +0000 (11:43 -0700)] 
Merge branch 'maint'

* maint:
  fetch-pack: brown paper bag fix

16 years agofetch-pack: brown paper bag fix
Junio C Hamano [Wed, 30 Apr 2008 18:42:05 +0000 (11:42 -0700)] 
fetch-pack: brown paper bag fix

When I applied Linus's patch from the list by hand somehow I ended
up reversing the logic by mistake.  This fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: point git-prune users to git-gc
Jeff King [Tue, 29 Apr 2008 20:45:14 +0000 (16:45 -0400)] 
Documentation: point git-prune users to git-gc

Most users should be using git-gc instead of directly
calling prune. For those who really do want more information
on pruning, let's point them at git-fsck, which goes into
slightly more detail on reachability.

And since we're pointing users there, let's make sure
reflogs are mentioned in git-fsck(1).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation on --git-dir and --work-tree
Liu Yubao [Mon, 28 Apr 2008 20:09:20 +0000 (04:09 +0800)] 
Documentation on --git-dir and --work-tree

16 years agoMake read_in_full() and write_in_full() consistent with xread() and xwrite()
Heikki Orsila [Sun, 27 Apr 2008 18:21:58 +0000 (21:21 +0300)] 
Make read_in_full() and write_in_full() consistent with xread() and xwrite()

xread() and xwrite() return ssize_t values as their native POSIX
counterparts read(2) and write(2).

To be consistent, read_in_full() and write_in_full() should also return
ssize_t values.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation gitk: Describe what --merge does
Richard Quirk [Mon, 28 Apr 2008 20:58:35 +0000 (22:58 +0200)] 
Documentation gitk: Describe what --merge does

Signed-off-by: Richard Quirk <richard.quirk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUse the modern syntax of git-diff-files in t2002-checkout-cache-u.sh
Alex Riesen [Sun, 27 Apr 2008 11:31:23 +0000 (13:31 +0200)] 
Use the modern syntax of git-diff-files in t2002-checkout-cache-u.sh

As a nice side effect it also fixes t2002-checkout-cache-u.sh on FreeBSD 4,
/bin/sh of which has problems interpreting "! command" construction.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd otherwise missing --strict option to unpack-objects summary.
Jon Loeliger [Wed, 23 Apr 2008 21:14:30 +0000 (16:14 -0500)] 
Add otherwise missing --strict option to unpack-objects summary.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: detect and fail gracefully when dcommitting to a void
Matthieu Moy [Thu, 24 Apr 2008 18:06:36 +0000 (20:06 +0200)] 
git-svn: detect and fail gracefully when dcommitting to a void

The command

  git svn clone (URL of an empty SVN repo here)

works, creates an empty git repository. I can perform the initial
commit there, but then, "git svn dcommit" says :

Use of uninitialized value in concatenation (.) or string at .../git-svn line 414.
Committing to  ...
Unable to determine upstream SVN information from HEAD history

I guess a correct management of the initial commit in git-svn would be
hard to implement, but at least, the error message can be improved.
First step is something like the patch below, and better would be for
"git svn clone" to warn that it won't be able to do much with the
cloned repo.

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomake git-status use a pager
Bart Trojanowski [Thu, 24 Apr 2008 00:57:48 +0000 (20:57 -0400)] 
make git-status use a pager

make git status act similar to git log and git diff by presenting long
output in a pager.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 30 Apr 2008 06:06:30 +0000 (23:06 -0700)] 
Merge branch 'maint'

* maint:
  cvsimport: always pass user data to "system" as a list
  fix reflog approxidate parsing bug
  Fix use after free() in builtin-fetch
  fetch-pack: do not stop traversing an already parsed commit
  Use "=" instead of "==" in condition as it is more portable

16 years agoMerge branch 'maint-1.5.4' into maint
Junio C Hamano [Wed, 30 Apr 2008 05:55:07 +0000 (22:55 -0700)] 
Merge branch 'maint-1.5.4' into maint

* maint-1.5.4:
  cvsimport: always pass user data to "system" as a list
  fix reflog approxidate parsing bug

16 years agocvsimport: always pass user data to "system" as a list
Jeff King [Wed, 30 Apr 2008 04:36:14 +0000 (00:36 -0400)] 
cvsimport: always pass user data to "system" as a list

This avoids invoking the shell. Not only is it faster, but
it prevents the possibility of interpreting our arguments in
the shell.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofix reflog approxidate parsing bug
Jeff King [Wed, 30 Apr 2008 04:13:58 +0000 (00:13 -0400)] 
fix reflog approxidate parsing bug

In get_sha1_basic, we parse a string like

  HEAD@{10 seconds ago}:path/to/file

into its constituent ref, reflog date, and path components.
We never actually munge the string itself, but instead keep
offsets into the string with their associated lengths.

When we call approxidate on the contents inside braces,
however, we pass just a string without a length. This means
that approxidate could sometimes look past the closing brace
and (erroneously) interpret the rest of the string as part
of the date.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix use after free() in builtin-fetch
Alex Riesen [Mon, 28 Apr 2008 20:23:35 +0000 (22:23 +0200)] 
Fix use after free() in builtin-fetch

As reported by Dave Jones:

Since master.kernel.org updated to latest, I noticed that I could crash
git-fetch by doing this..

export KERNEL=/pub/scm/linux/kernel/git/
git fetch $KERNEL/torvalds/linux-2.6 master:linus

(gdb) bt
 0  0x000000349fd6d44b in free () from /lib64/libc.so.6
 1  0x000000000048f4eb in transport_unlock_pack (transport=0x7ce530) at transport.c:811
 2  0x000000349fd31b25 in exit () from /lib64/libc.so.6
 3  0x00000000004043d8 in handle_internal_command (argc=3, argv=0x7fffea4449f0) at git.c:379
 4  0x0000000000404547 in main (argc=3, argv=0x7fffea4449f0) at git.c:443
 5  0x000000349fd1c784 in __libc_start_main () from /lib64/libc.so.6
 6  0x0000000000403ef9 in ?? ()
 7  0x00007fffea4449d8 in ?? ()
 8  0x0000000000000000 in ?? ()

I then remembered, my .bashrc has this..

export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))

which is handy for showing up such bugs.

More info on this glibc feature is at http://udrepper.livejournal.com/11429.html

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofetch-pack: do not stop traversing an already parsed commit
Linus Torvalds [Mon, 28 Apr 2008 23:27:49 +0000 (16:27 -0700)] 
fetch-pack: do not stop traversing an already parsed commit

f3ec549 (fetch-pack: check parse_commit/object results, 2008-03-03)
broke common ancestor computation by stopping traversal when it sees
an already parsed commit.  This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUse "=" instead of "==" in condition as it is more portable
Alex Riesen [Mon, 28 Apr 2008 21:09:55 +0000 (23:09 +0200)] 
Use "=" instead of "==" in condition as it is more portable

At least the dash from Ubuntu's /bin/sh says:

    test: 233: ==: unexpected operator

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDie for an early EOF in a file reading loop
Heikki Orsila [Sun, 27 Apr 2008 14:07:24 +0000 (17:07 +0300)] 
Die for an early EOF in a file reading loop

The resulting data is zero terminated after the read loop, but
the subsequent loop that scans for '\n' will overrun the buffer.

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocument functions xmemdupz(), xread() and xwrite()
Heikki Orsila [Sun, 27 Apr 2008 09:48:30 +0000 (12:48 +0300)] 
Document functions xmemdupz(), xread() and xwrite()

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Mon, 28 Apr 2008 04:47:51 +0000 (21:47 -0700)] 
Merge branch 'maint'

* maint:
  clone: detect and fail on excess parameters
  Remove 'header' from --signoff option description

16 years agoclone: detect and fail on excess parameters
Junio C Hamano [Wed, 23 Apr 2008 17:53:47 +0000 (10:53 -0700)] 
clone: detect and fail on excess parameters

"git clone [options] $src $dst excess-garbage" simply ignored
excess-garbage without giving any diagnostic message.  Fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint-1.5.4' into maint
Junio C Hamano [Mon, 28 Apr 2008 04:47:38 +0000 (21:47 -0700)] 
Merge branch 'maint-1.5.4' into maint

* maint-1.5.4:
  Remove 'header' from --signoff option description

16 years agoRemove 'header' from --signoff option description
Dan McGee [Sun, 27 Apr 2008 00:43:20 +0000 (19:43 -0500)] 
Remove 'header' from --signoff option description

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash: Add completion for gitk --merge
Richard Quirk [Sun, 27 Apr 2008 15:35:10 +0000 (17:35 +0200)] 
bash: Add completion for gitk --merge

Option is only completed when .git/MERGE_HEAD is present.

Signed-off-by: Richard Quirk <richard.quirk@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorev-parse: fix --verify to error out when passed junk after a good rev
Christian Couder [Sat, 26 Apr 2008 13:19:29 +0000 (15:19 +0200)] 
rev-parse: fix --verify to error out when passed junk after a good rev

Before this patch something like:

$ git rev-parse --verify <good-rev> <junk>

worked whatever junk was as long as <good-rev> could be parsed
correctly.

This patch makes "git rev-parse --verify" error out when passed
any junk after a good rev.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit checkout: add -t alias for --track
Miklos Vajna [Wed, 23 Apr 2008 23:04:48 +0000 (01:04 +0200)] 
git checkout: add -t alias for --track

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorev-parse: teach "--verify" to be quiet when using "-q" or "--quiet"
Christian Couder [Sat, 26 Apr 2008 11:57:23 +0000 (13:57 +0200)] 
rev-parse: teach "--verify" to be quiet when using "-q" or "--quiet"

Currently "git rev-parse --verify <something>" is often used with
its error output redirected to /dev/null. This patch makes it
easier to do that.

The -q|--quiet option is designed to work the same way as it does
for "git symbolic-ref".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Use feed link according to current view
Jakub Narebski [Sun, 20 Apr 2008 20:09:48 +0000 (22:09 +0200)] 
gitweb: Use feed link according to current view

Michael G. Noll said in comments to the "Switching my code repository from
Subversion (SVN) to git" article (http://tinyurl.com/37v67l) in his "My
digital moleskine" blog, that one of the things he is missing in gitweb
from SVN::Web is an RSS feed with news/information of the current view
(including RSS feed for single file or directory).

This is not exactly true, as since refactoring feed generation in af6feeb
(gitweb: Refactor feed generation, make output prettier, add Atom feed,
2006-11-19), gitweb can generate feeds (RSS or Atom) for history of a
given branch, history limited to a given directory, or history of a given
file.  Nevertheless this required handcrafting the URL to get wanted RSS
feed.

This commit makes gitweb select feed links in the HTML header and in
page footer depending on current view (action).  It is more elaborate,
and I guess more correct, than simple patch adding $hash ('h')
parameter to *all* URLs, including feed links, by Jean-Baptiste Quenot

  Subject: [PATCH] gitweb: Add hash parameter in feed URL when a hash
           is specified in the current request
  Message-ID: <ae63f8b50803211138y6355fd11pa64cda50a1f53011@mail.gmail.com>

If $hash ('h') or $hash_base ('hb') parameter is a branch name
(i.e. it starts with 'refs/heads/'; all generated URLs use this form
to discriminate between tags and heads), it is used in feed URLs; if
$file_name ('f') is defined, it is used in feed URLs.  Feed title is
set according to the kind of web feed: it is either 'log' for generic
feed, 'log of <branch>', 'history of <filename>' for generic history
(using implicit or explicit HEAD, i.e. current branch) or 'history of
<filename> on <branch>'.

There are special cases: 'heads' and 'forks' views should use OPML
providing list of available feeds; 'tags' probably also should use
OPML; there is no web feed equivalent to 'search' view.  Currently all
those cases fallback to (show) default feed.  Such feed link uses
"generic" class, and is shown in slightly lighter color for
distinction.

Currently feed can have but one starting point, and does not support
negative (exclude) commit arguments.  Therefore for now for *diff
views it is chosen that feed follow the "to" part: to-name, to-commit
for 'blobdiff', 'treediff' and 'commitdiff' views.

Generating parameters for href() for feed link was separated
(refactored) into get_feed_info() subroutine.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoOptimize match_pathspec() to avoid fnmatch()
Linus Torvalds [Sat, 19 Apr 2008 21:22:38 +0000 (14:22 -0700)] 
Optimize match_pathspec() to avoid fnmatch()

"git add *" is actually fundamentally different from "git add .", and
yeah, you should generally use the latter.

The reason? The argument list is actually something different from what
you think it is. For git, it's a "pathspec", so what actualy happens is
that in *both* cases, it will really traverse the whole tree, and then
match every file it finds against the pathspec.

So think of the arguments not as a file list, but as a random bunch of
patterns to match against the files you have!

Which is why the cost is actually approximately O(n*m), where "n" is the
size of the working tree, and "m" is the number of pathspecs.

So the reason "git add ." is fast is actually that "m" in that case is
just 1 (just one trivial pattern), and then "git add *" is slow because
"m" is large (lots of complicated patterns). In both cases, 'n' is the
same (== the whole set of files in your working tree).

Anyway, here's a trivial patch that doesn't change this fundamental fact,
but that avoids doing anything *expensive* until we've done some cheap
initial tests. It may or may not help your test-case, but it's pretty
simple and it matches the other git optimizations in this area (ie
"conceptually handle the general case, but optimize the simple cases where
we can exit early")

Notice how this patch doesn' actually change the fundamental O(n^2)
behaviour, but it makes it much cheaper by generally avoiding the
expensive 'fnmatch' and 'strlen/strncmp' when they are obviously not
needed.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake ls-remote http://... list HEAD, like for git://...
Daniel Barkalow [Sat, 26 Apr 2008 19:53:12 +0000 (15:53 -0400)] 
Make ls-remote http://... list HEAD, like for git://...

This makes a struct ref able to represent a symref, and makes http.c
able to recognize one, and makes transport.c look for "HEAD" as a ref
in the list, and makes it dereference symrefs for the resulting ref,
if any.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake walker.fetch_ref() take a struct ref.
Daniel Barkalow [Sat, 26 Apr 2008 19:53:09 +0000 (15:53 -0400)] 
Make walker.fetch_ref() take a struct ref.

This simplifies a few things, makes a few things slightly more
complicated, but, more importantly, allows that, when struct ref can
represent a symref, http_fetch_ref() can return one.

Incidentally makes the string that http_fetch_ref() gets include "refs/"
(if appropriate), because that's how the name field of struct ref works.
As far as I can tell, the usage in walker:interpret_target() wouldn't have
worked previously, if it ever would have been used, which it wouldn't
(since the fetch process uses the hash instead of the name of the ref
there).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodocumentation: web--browse: add a note about konqueror
Christian Couder [Fri, 25 Apr 2008 06:25:41 +0000 (08:25 +0200)] 
documentation: web--browse: add a note about konqueror

This note explains how to work around the fact that we try to use
kfmclient to launch konqueror.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>