]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
16 years agogitweb: Put project README in div.readme, fix its padding
Jakub Narebski [Mon, 19 Nov 2007 13:16:12 +0000 (14:16 +0100)] 
gitweb: Put project README in div.readme, fix its padding

Put (optional) projects README on "summary" page in <div> element
using "readme" class.  This allow to style it using CSS.

Add padding to project's README to make it line out with the rest
of the page.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
16 years agogitweb: Style all tables using CSS
Jakub Narebski [Mon, 19 Nov 2007 13:16:11 +0000 (14:16 +0100)] 
gitweb: Style all tables using CSS

Remove all cellspacing="0" attributes from tables in gitweb,
replacing it by CSS rule.  Add CSS classes for all tables.

While at it, change class(es) of table for commit message and commit
authorship search from "grep" to "commit_search"; similarly,
"grep_search" class is now used for table with results of grep (files)
search.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
16 years agosend-email: Don't add To: recipients to the Cc: header
Ask Bjørn Hansen [Mon, 19 Nov 2007 11:00:26 +0000 (03:00 -0800)] 
send-email: Don't add To: recipients to the Cc: header

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitview: import only one of gtksourceview and gtksourceview2
Anton Gyllenberg [Mon, 19 Nov 2007 10:37:16 +0000 (12:37 +0200)] 
gitview: import only one of gtksourceview and gtksourceview2

Importing both gtksourceview and gtksourceview2 will make python segfault
on my system (ubuntu 7.10). Change so that gtksourceview is only imported
if importing gtksourceview2 fails. This should be safe as gtksourceview
is only used if gtksourceview2 is not available.

Signed-off-by: Anton Gyllenberg <anton@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-send-email: show all headers when sending mail
David D. Kilzer [Mon, 19 Nov 2007 04:14:55 +0000 (20:14 -0800)] 
git-send-email: show all headers when sending mail

As a git newbie, it was confusing to set an In-Reply-To header but then
not see it printed when the git-send-email command was run.

This patch prints all headers that would be sent to sendmail or an SMTP
server instead of only printing From, Subject, Cc, To.  It also removes
the now-extraneous Date header after the "Log says" line.

Added test to t/t9001-send-email.sh.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Mon, 19 Nov 2007 08:19:15 +0000 (00:19 -0800)] 
Merge branch 'maint'

* maint:
  Documentation: Fix references to deprecated commands
  user-manual: mention "..." in "Generating diffs", etc.
  user-manual: Add section "Why bisecting merge commits can be harder ..."
  git-remote.txt: fix example url

16 years agoFurther clarify clean.requireForce changes
Wincent Colaiuta [Mon, 19 Nov 2007 08:06:31 +0000 (09:06 +0100)] 
Further clarify clean.requireForce changes

Mention the -f switch in the release notes for clean.requireForce to avoid
possible misunderstandings.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
Junio C Hamano [Mon, 19 Nov 2007 07:56:01 +0000 (23:56 -0800)] 
Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint

* 'maint' of git://linux-nfs.org/~bfields/git:
  Documentation: Fix references to deprecated commands
  user-manual: mention "..." in "Generating diffs", etc.
  user-manual: Add section "Why bisecting merge commits can be harder ..."
  git-remote.txt: fix example url

16 years agoDocumentation: Fix references to deprecated commands
J. Bruce Fields [Mon, 19 Nov 2007 01:50:57 +0000 (20:50 -0500)] 
Documentation: Fix references to deprecated commands

... by changing git-tar-tree reference to git-archive and removing
seemingly unrelevant footnote about git-ssh-{fetch,upload}.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoUpdate draft release notes for 1.5.4
Junio C Hamano [Mon, 19 Nov 2007 00:24:14 +0000 (16:24 -0800)] 
Update draft release notes for 1.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agouser-manual: mention "..." in "Generating diffs", etc.
J. Bruce Fields [Mon, 19 Nov 2007 00:18:27 +0000 (19:18 -0500)] 
user-manual: mention "..." in "Generating diffs", etc.

We should mention the use of the "..." syntax for git-diff here.  The
note about the difference between diff and the combined output of
git-format-patch then no longer fits so well, so remove it.  Add a
reference to the git-format-patch[1] manpage.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoMerge branch 'lt/rev-list-gitlink'
Junio C Hamano [Mon, 19 Nov 2007 00:16:37 +0000 (16:16 -0800)] 
Merge branch 'lt/rev-list-gitlink'

* lt/rev-list-gitlink:
  Fix rev-list when showing objects involving submodules

16 years agoMerge branch 'ds/checkout-upper'
Junio C Hamano [Mon, 19 Nov 2007 00:04:17 +0000 (16:04 -0800)] 
Merge branch 'ds/checkout-upper'

* ds/checkout-upper:
  git-checkout: Test for relative path use.
  git-checkout: Support relative paths containing "..".

16 years agoMerge branch 'sh/p4'
Junio C Hamano [Mon, 19 Nov 2007 00:03:58 +0000 (16:03 -0800)] 
Merge branch 'sh/p4'

* sh/p4:
  git-p4: Fix direct import from perforce after fetching changes through git from origin

16 years agoMerge branch 'lt/rev-list-interactive'
Junio C Hamano [Mon, 19 Nov 2007 00:03:24 +0000 (16:03 -0800)] 
Merge branch 'lt/rev-list-interactive'

* lt/rev-list-interactive:
  Fix parent rewriting in --early-output
  revision walker: mini clean-up
  Enhance --early-output format
  Add "--early-output" log flag for interactive GUI use
  Simplify topo-sort logic

16 years agoMerge branch 'ph/diffopts'
Junio C Hamano [Sun, 18 Nov 2007 23:50:16 +0000 (15:50 -0800)] 
Merge branch 'ph/diffopts'

* ph/diffopts:
  Reorder diff_opt_parse options more logically per topics.
  Make the diff_options bitfields be an unsigned with explicit masks.
  Use OPT_BIT in builtin-pack-refs
  Use OPT_BIT in builtin-for-each-ref
  Use OPT_SET_INT and OPT_BIT in builtin-branch
  parse-options new features.

16 years agoDraft release notes: fix clean.requireForce description
Junio C Hamano [Sun, 18 Nov 2007 23:22:51 +0000 (15:22 -0800)] 
Draft release notes: fix clean.requireForce description

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint' to synchronize with 1.5.3.6
Junio C Hamano [Sun, 18 Nov 2007 23:15:47 +0000 (15:15 -0800)] 
Merge branch 'maint' to synchronize with 1.5.3.6

* maint:
  GIT 1.5.3.6
  grep -An -Bm: fix invocation of external grep command

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agouser-manual: Add section "Why bisecting merge commits can be harder ..."
Steffen Prohaska [Sat, 10 Nov 2007 13:49:54 +0000 (14:49 +0100)] 
user-manual: Add section "Why bisecting merge commits can be harder ..."

This commit adds a discussion of the challenge of bisecting
merge commits to the user manual.  The original author is
Junio C Hamano <gitster@pobox.com>, who posted the text to
the mailing list <http://marc.info/?l=git&m=119403257315527&w=2>.
His email was adapted for the manual.

The discussion is added to "Rewriting history and maintainig
patch series".  The text added requires good understanding of
merging and rebasing.  Therefore it should not be placed too
early in the manual.  Right after the section on "Problems with
rewriting history", the discussion of bisect gives another reason
for linearizing as much of the history as possible.

The text includes suggestions and fixes by
Ralf Wildenhues <Ralf.Wildenhues@gmx.de> and
Benoit Sigoure <tsuna@lrde.epita.fr>.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoGIT 1.5.3.6 v1.5.3.6
Junio C Hamano [Sun, 18 Nov 2007 22:00:38 +0000 (14:00 -0800)] 
GIT 1.5.3.6

16 years agoUse compat mkdtemp() on Solaris boxes
Guido Ostkamp [Fri, 16 Nov 2007 18:59:58 +0000 (19:59 +0100)] 
Use compat mkdtemp() on Solaris boxes

Define NO_MKDTEMP for all variants of SunOS; Solaris 10 does not
have mkdtemp() and all the other versions our Makefile knows
about don't have it either.

NO_{SETENV,UNSETENV,C99_FORMAT,STRTOUMAX} definitions cannot be
unified across versions.  Beginning with Solaris 10, the C-library
provides unsetenv(), setenv() and strtoumax().  Also 'z'/'t' formats
are supported.  However, older versions of Solaris do not support
these.

Signed-off-by: Guido Ostkamp <git@ostkamp.fastmail.fm>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'ph/parseopt-sh'
Junio C Hamano [Sun, 18 Nov 2007 05:39:37 +0000 (21:39 -0800)] 
Merge branch 'ph/parseopt-sh'

* ph/parseopt-sh:
  git-quiltimport.sh fix --patches handling
  git-am: -i does not take a string parameter.
  sh-setup: don't let eval output to be shell-expanded.
  git-sh-setup: fix parseopt `eval` string underquoting
  Give git-am back the ability to add Signed-off-by lines.
  git-rev-parse --parseopt
  scripts: Add placeholders for OPTIONS_SPEC
  Migrate git-repack.sh to use git-rev-parse --parseopt
  Migrate git-quiltimport.sh to use git-rev-parse --parseopt
  Migrate git-checkout.sh to use git-rev-parse --parseopt --keep-dashdash
  Migrate git-instaweb.sh to use git-rev-parse --parseopt
  Migrate git-merge.sh to use git-rev-parse --parseopt
  Migrate git-am.sh to use git-rev-parse --parseopt
  Migrate git-clone to use git-rev-parse --parseopt
  Migrate git-clean.sh to use git-rev-parse --parseopt.
  Update git-sh-setup(1) to allow transparent use of git-rev-parse --parseopt
  Add a parseopt mode to git-rev-parse to bring parse-options to shell scripts.

16 years agogrep -An -Bm: fix invocation of external grep command
Junio C Hamano [Sun, 18 Nov 2007 05:18:14 +0000 (21:18 -0800)] 
grep -An -Bm: fix invocation of external grep command

When building command line to invoke external grep, the
arguments to -A/-B/-C options were placd in randarg[] buffer,
but the code forgot that snprintf() does not count terminating
NUL in its return value.  This caused "git grep -A1 -B2" to
invoke external grep with "-B21 -A1".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-remote.txt: fix example url
J. Bruce Fields [Sat, 3 Nov 2007 02:54:31 +0000 (22:54 -0400)] 
git-remote.txt: fix example url

If I'm going to use a real example as a URL, I suppose I should get it
right....

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Sun, 18 Nov 2007 00:40:03 +0000 (16:40 -0800)] 
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: Fix a typo and add a comma in an error message in git-svn
  git-svn log: handle unreachable revisions like "svn log"
  git-svn log: include commit log for the smallest revision in a range
  git-svn log: fix ascending revision ranges
  git-svn's dcommit must use subversion's config
  git-svn: add tests for command-line usage of init and clone commands

16 years agogit-svn: Fix a typo and add a comma in an error message in git-svn
David Reiss [Tue, 13 Nov 2007 21:47:26 +0000 (13:47 -0800)] 
git-svn: Fix a typo and add a comma in an error message in git-svn

Signed-off-by: David Reiss <dreiss@facebook.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn log: handle unreachable revisions like "svn log"
David D Kilzer [Mon, 12 Nov 2007 06:56:52 +0000 (22:56 -0800)] 
git-svn log: handle unreachable revisions like "svn log"

When unreachable revisions are given to "svn log", it displays all commit
logs in the given range that exist in the current tree.  (If no commit
logs are found in the current tree, it simply prints a single commit log
separator.)  This patch makes "git-svn log" behave the same way.

Ten tests added to t/t9116-git-svn-log.sh.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn log: include commit log for the smallest revision in a range
David D Kilzer [Sun, 11 Nov 2007 06:10:34 +0000 (22:10 -0800)] 
git-svn log: include commit log for the smallest revision in a range

The "svn log -rM:N" command shows commit logs inclusive in the range [M,N].
Previously "git-svn log" always excluded the commit log for the smallest
revision in a range, whether the range was ascending or descending.  With
this patch, the smallest revision in a range is always shown.

Updated tests for ascending and descending revision ranges.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn log: fix ascending revision ranges
David D Kilzer [Sun, 11 Nov 2007 06:10:33 +0000 (22:10 -0800)] 
git-svn log: fix ascending revision ranges

Fixed typo in Git::SVN::Log::git_svn_log_cmd().  Previously a command like
"git-svn log -r1:4" would only show a commit log separator.

Added tests for ascending and descending revision ranges.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn's dcommit must use subversion's config
Konstantin V. Arkhipov [Wed, 14 Nov 2007 00:52:02 +0000 (03:52 +0300)] 
git-svn's dcommit must use subversion's config

When doing dcommit git-svn must use subversion's config or newly created
files will not include svn's properties
(defined in [auto-props] with 'enable-auto-props = yes').

Signed-off-by: Konstantin V. Arkhipov <voxus@onphp.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn: add tests for command-line usage of init and clone commands
Eric Wong [Sat, 17 Nov 2007 20:47:16 +0000 (12:47 -0800)] 
git-svn: add tests for command-line usage of init and clone commands

Some patches broke these commands in certain cases and were only
caught by manual testing.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
16 years agoUpdate draft release notes for 1.5.4
Junio C Hamano [Sat, 17 Nov 2007 05:47:59 +0000 (21:47 -0800)] 
Update draft release notes for 1.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix and improve t7004 (git-tag tests)
Mike Hommey [Fri, 16 Nov 2007 22:02:08 +0000 (23:02 +0100)] 
Fix and improve t7004 (git-tag tests)

Brown paper bag fix to avoid using non portable sed syntax. The
test by itself didn't catch what it was supposed to, anyways.

The new test first checks if git-tag correctly errors out when
the user exited the editor without editing the file.  Then it
checks if what the user was presented in the editor was any
useful, which we define as the following:

 * It begins with a single blank line, where the invoked editor
   would typically place the editing curser at, so that the user
   can immediately start typing;

 * It has some instruction but that comes after that initial
   blank line, all lines prefixed with "#".  We specifically do
   not check for the wording of this instruction.

 * And it has nothing else, as the expected behaviour is "Hey
   you did not leave any message".

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: fix git-clone manpage not to refer to itself
Sergei Organov [Fri, 16 Nov 2007 18:43:16 +0000 (21:43 +0300)] 
Documentation: fix git-clone manpage not to refer to itself

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agouser-manual.txt: minor clarification.
Sergei Organov [Fri, 16 Nov 2007 11:28:57 +0000 (14:28 +0300)] 
user-manual.txt: minor clarification.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Sat, 17 Nov 2007 05:30:06 +0000 (21:30 -0800)] 
Merge branch 'maint'

* maint:
  Update draft release notes for 1.5.3.6
  Fix per-directory exclude handing for "git add"
  core.excludesfile clean-up
  Fix t9101 test failure caused by Subversion "auto-props"
  git-send-email: add charset header if we add encoded 'From'

16 years agoUpdate draft release notes for 1.5.3.6
Junio C Hamano [Sat, 17 Nov 2007 02:44:06 +0000 (18:44 -0800)] 
Update draft release notes for 1.5.3.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'ds/maint-deflatebound' into maint
Junio C Hamano [Sat, 17 Nov 2007 05:14:17 +0000 (21:14 -0800)] 
Merge branch 'ds/maint-deflatebound' into maint

* ds/maint-deflatebound:
  Improve accuracy of check for presence of deflateBound.

16 years agoFix per-directory exclude handing for "git add"
Junio C Hamano [Fri, 16 Nov 2007 09:15:41 +0000 (01:15 -0800)] 
Fix per-directory exclude handing for "git add"

In "dir_struct", each exclusion element in the exclusion stack records a
base string (pointer to the beginning with length) so that we can tell
where it came from, but this pointer is just pointing at the parameter
that is given by the caller to the push_exclude_per_directory()
function.

While read_directory_recursive() runs, calls to excluded() makes use
the data in the exclusion elements, including this base string.  The
caller of read_directory_recursive() is not supposed to free the
buffer it gave to push_exclude_per_directory() earlier, until it
returns.

The test case Bruce Stephens gave in the mailing list discussion
was simplified and added to the t3700 test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocore.excludesfile clean-up
Junio C Hamano [Sat, 17 Nov 2007 01:05:02 +0000 (17:05 -0800)] 
core.excludesfile clean-up

There are inconsistencies in the way commands currently handle
the core.excludesfile configuration variable.  The problem is
the variable is too new to be noticed by anything other than
git-add and git-status.

 * git-ls-files does not notice any of the "ignore" files by
   default, as it predates the standardized set of ignore files.
   The calling scripts established the convention to use
   .git/info/exclude, .gitignore, and later core.excludesfile.

 * git-add and git-status know about it because they call
   add_excludes_from_file() directly with their own notion of
   which standard set of ignore files to use.  This is just a
   stupid duplication of code that need to be updated every time
   the definition of the standard set of ignore files is
   changed.

 * git-read-tree takes --exclude-per-directory=<gitignore>,
   not because the flexibility was needed.  Again, this was
   because the option predates the standardization of the ignore
   files.

 * git-merge-recursive uses hardcoded per-directory .gitignore
   and nothing else.  git-clean (scripted version) does not
   honor core.* because its call to underlying ls-files does not
   know about it.  git-clean in C (parked in 'pu') doesn't either.

We probably could change git-ls-files to use the standard set
when no excludes are specified on the command line and ignore
processing was asked, or something like that, but that will be a
change in semantics and might break people's scripts in a subtle
way.  I am somewhat reluctant to make such a change.

On the other hand, I think it makes perfect sense to fix
git-read-tree, git-merge-recursive and git-clean to follow the
same rule as other commands.  I do not think of a valid use case
to give an exclude-per-directory that is nonstandard to
read-tree command, outside a "negative" test in the t1004 test
script.

This patch is the first step to untangle this mess.

The next step would be to teach read-tree, merge-recursive and
clean (in C) to use setup_standard_excludes().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix t9101 test failure caused by Subversion "auto-props"
Wincent Colaiuta [Fri, 16 Nov 2007 13:25:10 +0000 (14:25 +0100)] 
Fix t9101 test failure caused by Subversion "auto-props"

If a user has an "auto-prop" in his/her ~/.subversion/config file for
automatically setting the svn:keyword Id property on all ".c" files
(a reasonably common configuration in the Subversion world) then one
of the "svn propset" operations in the very first test would become a
no-op, which in turn would make the next commit a no-op.

This then caused the 25th test ('test propget') to fail because it
expects a certain number of commits to have taken place but the actual
number of commits was off by one.

Björn Steinbrink identified the "auto-prop" feature as the cause
of the failure. This patch avoids it by passing the "--no-auto-prop"
flag to "svn import" when setting up the test repository, thus ensuring
that the "svn propset" operation is no longer a no-op, regardless of the
users' settings in their config.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-send-email: add charset header if we add encoded 'From'
Jeff King [Fri, 16 Nov 2007 10:49:09 +0000 (05:49 -0500)] 
git-send-email: add charset header if we add encoded 'From'

We sometimes pick out the original rfc822 'From' header and
include it in the body of the message. If the original
author's name needs encoding, then we should specify that in
the content-type header.

If we already had a content-type header in the mail, then we
may need to re-encode. The logic is there to detect
this case, but it doesn't actually do the re-encoding.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-p4: Fix direct import from perforce after fetching changes through git from origin
Simon Hausmann [Thu, 15 Nov 2007 09:38:45 +0000 (10:38 +0100)] 
git-p4: Fix direct import from perforce after fetching changes through git from origin

When using an existing git repository to cache the perforce import we don't
fetch the branch mapping from perforce as that is a slow operation. However
the origin repository may not be fully up-to-date and therefore it may be
necessary to import more changes directly from Perforce.

Such a direct import needs self.knownBranches to be set up though, so
initialize it from the existing p4/* git branches.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix per-directory exclude handing for "git add"
Junio C Hamano [Fri, 16 Nov 2007 09:15:41 +0000 (01:15 -0800)] 
Fix per-directory exclude handing for "git add"

In "dir_struct", each exclusion element in the exclusion stack records a
base string (pointer to the beginning with length) so that we can tell
where it came from, but this pointer is just pointing at the parameter
that is given by the caller to the push_exclude_per_directory()
function.

While read_directory_recursive() runs, calls to excluded() makes use
the data in the exclusion elements, including this base string.  The
caller of read_directory_recursive() is not supposed to free the
buffer it gave to push_exclude_per_directory() earlier, until it
returns.

The test case Bruce Stephens gave in the mailing list discussion
was simplified and added to the t3700 test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: customize diff-options depending on particular command
Sergei Organov [Thu, 15 Nov 2007 13:19:29 +0000 (16:19 +0300)] 
Documentation: customize diff-options depending on particular command

Customize diff-options depending on particular command as follows,
mostly to make git-diff and git-format-patch manuals less confusing:

* git-format-patch:

  - Mark --patch-with-stat as being the default.

  - Change -p description so that it matches what it actually does and
    so that it doesn't refer to absent "section on generating
    patches".

* git-diff: mark -p as being the default.

* git-diff-index/git-diff-files/git-diff-tree: mark --raw as being
  the default.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-ls-files: add --exclude-standard
Jeff King [Thu, 15 Nov 2007 07:04:30 +0000 (02:04 -0500)] 
git-ls-files: add --exclude-standard

This provides a way for scripts to get at the new standard exclude
function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRemove unreachable statements
Guido Ostkamp [Thu, 15 Nov 2007 22:19:11 +0000 (23:19 +0100)] 
Remove unreachable statements

Solaris Workshop Compiler found a few unreachable statements.

Signed-off-by: Guido Ostkamp <git@ostkamp.fastmail.fm>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorefs.c: Remove unused get_ref_sha1()
Johannes Sixt [Thu, 15 Nov 2007 16:33:44 +0000 (17:33 +0100)] 
refs.c: Remove unused get_ref_sha1()

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocore.excludesfile clean-up
Junio C Hamano [Wed, 14 Nov 2007 08:05:00 +0000 (00:05 -0800)] 
core.excludesfile clean-up

There are inconsistencies in the way commands currently handle
the core.excludesfile configuration variable.  The problem is
the variable is too new to be noticed by anything other than
git-add and git-status.

 * git-ls-files does not notice any of the "ignore" files by
   default, as it predates the standardized set of ignore files.
   The calling scripts established the convention to use
   .git/info/exclude, .gitignore, and later core.excludesfile.

 * git-add and git-status know about it because they call
   add_excludes_from_file() directly with their own notion of
   which standard set of ignore files to use.  This is just a
   stupid duplication of code that need to be updated every time
   the definition of the standard set of ignore files is
   changed.

 * git-read-tree takes --exclude-per-directory=<gitignore>,
   not because the flexibility was needed.  Again, this was
   because the option predates the standardization of the ignore
   files.

 * git-merge-recursive uses hardcoded per-directory .gitignore
   and nothing else.  git-clean (scripted version) does not
   honor core.* because its call to underlying ls-files does not
   know about it.  git-clean in C (parked in 'pu') doesn't either.

We probably could change git-ls-files to use the standard set
when no excludes are specified on the command line and ignore
processing was asked, or something like that, but that will be a
change in semantics and might break people's scripts in a subtle
way.  I am somewhat reluctant to make such a change.

On the other hand, I think it makes perfect sense to fix
git-read-tree, git-merge-recursive and git-clean to follow the
same rule as other commands.  I do not think of a valid use case
to give an exclude-per-directory that is nonstandard to
read-tree command, outside a "negative" test in the t1004 test
script.

This patch is the first step to untangle this mess.

The next step would be to teach read-tree, merge-recursive and
clean (in C) to use setup_standard_excludes().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'sp/fetch-fix'
Junio C Hamano [Wed, 14 Nov 2007 22:26:04 +0000 (14:26 -0800)] 
Merge branch 'sp/fetch-fix'

* sp/fetch-fix:
  git-fetch: avoid local fetching from alternate (again)
  rev-list: Introduce --quiet to avoid /dev/null redirects
  run-command: Support sending stderr to /dev/null
  git-fetch: Always fetch tags if the object they reference exists

16 years agoMerge branch 'bs/maint-commit-options'
Junio C Hamano [Wed, 14 Nov 2007 22:25:46 +0000 (14:25 -0800)] 
Merge branch 'bs/maint-commit-options'

* bs/maint-commit-options:
  git-commit: Add tests for invalid usage of -a/--interactive with paths
  git-commit.sh: Fix usage checks regarding paths given when they do not make sense

16 years agoMerge branch 'rv/maint-index-commit'
Junio C Hamano [Wed, 14 Nov 2007 22:25:33 +0000 (14:25 -0800)] 
Merge branch 'rv/maint-index-commit'

* rv/maint-index-commit:
  Make GIT_INDEX_FILE apply to git-commit

16 years agoMerge branch 'bs/maint-t7005'
Junio C Hamano [Wed, 14 Nov 2007 22:25:19 +0000 (14:25 -0800)] 
Merge branch 'bs/maint-t7005'

* bs/maint-t7005:
  t7005-editor.sh: Don't invoke real vi when it is in GIT_EXEC_PATH

16 years agoMerge branch 'jc/maint-add-sync-stat'
Junio C Hamano [Wed, 14 Nov 2007 22:15:40 +0000 (14:15 -0800)] 
Merge branch 'jc/maint-add-sync-stat'

* jc/maint-add-sync-stat:
  t2200: test more cases of "add -u"
  git-add: make the entry stat-clean after re-adding the same contents
  ce_match_stat, run_diff_files: use symbolic constants for readability

Conflicts:

builtin-add.c

16 years agoMerge branch 'mh/retag'
Junio C Hamano [Wed, 14 Nov 2007 22:06:09 +0000 (14:06 -0800)] 
Merge branch 'mh/retag'

* mh/retag:
  Add tests for git tag
  Reuse previous annotation when overwriting a tag

16 years agoMerge branch 'jc/stash-create'
Junio C Hamano [Wed, 14 Nov 2007 22:05:47 +0000 (14:05 -0800)] 
Merge branch 'jc/stash-create'

* jc/stash-create:
  git-stash: Fix listing stashes
  git-merge: no reason to use cpio anymore
  Revert "rebase: allow starting from a dirty tree."
  rebase: allow starting from a dirty tree.
  stash: implement "stash create"

16 years agoMerge branch 'bg/format-patch-N'
Junio C Hamano [Wed, 14 Nov 2007 22:04:25 +0000 (14:04 -0800)] 
Merge branch 'bg/format-patch-N'

* bg/format-patch-N:
  Rearrange git-format-patch synopsis to improve clarity.
  format-patch: Test --[no-]numbered and format.numbered
  format-patch: Add configuration and off switch for --numbered

16 years agoMerge branch 'np/progress'
Junio C Hamano [Wed, 14 Nov 2007 22:04:19 +0000 (14:04 -0800)] 
Merge branch 'np/progress'

* np/progress:
  nicer display of thin pack completion
  make display of total transferred fully accurate
  remove dead code from the csum-file interface
  git-fetch: be even quieter.
  make display of total transferred more accurate
  sideband.c: ESC is spelled '\033' not '\e' for portability.
  fix display overlap between remote and local progress

16 years agoMerge branch 'js/rebase-detached'
Junio C Hamano [Wed, 14 Nov 2007 22:04:06 +0000 (14:04 -0800)] 
Merge branch 'js/rebase-detached'

* js/rebase-detached:
  rebase: fix "rebase --continue" breakage
  rebase: operate on a detached HEAD

16 years agoMerge branch 'rs/pretty'
Junio C Hamano [Wed, 14 Nov 2007 22:03:50 +0000 (14:03 -0800)] 
Merge branch 'rs/pretty'

* rs/pretty:
  Fix preprocessor logic that determines the availablity of strchrnul().
  Simplify strchrnul() compat code
  --format=pretty: avoid calculating expensive expansions twice
  add strbuf_adddup()
  --pretty=format: parse commit message only once
  --pretty=format: on-demand format expansion
  Add strchrnul()

16 years agoMerge branch 'rr/cvsexportcommit-w'
Junio C Hamano [Wed, 14 Nov 2007 22:03:40 +0000 (14:03 -0800)] 
Merge branch 'rr/cvsexportcommit-w'

* rr/cvsexportcommit-w:
  cvsexportcommit: Add switch to specify CVS workdir

16 years agoMerge branch 'gh/cvsimport-user'
Junio C Hamano [Wed, 14 Nov 2007 22:03:27 +0000 (14:03 -0800)] 
Merge branch 'gh/cvsimport-user'

* gh/cvsimport-user:
  git-cvsimport: fix handling of user name when it is not set in CVSROOT

16 years agouser-manual: minor rewording for clarity.
Sergei Organov [Wed, 14 Nov 2007 20:08:15 +0000 (12:08 -0800)] 
user-manual: minor rewording for clarity.

Junio screwed up when applying the previous round of the patch;
rewording from "previous" to "old" does make the description
clearer.

Also revert the rewording from head to branch.  The description
is talking about the branch's tip commit and using the word head
is clearer.

Based on input from Sergei and Bruce.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix parent rewriting in --early-output
Linus Torvalds [Tue, 13 Nov 2007 07:16:08 +0000 (23:16 -0800)] 
Fix parent rewriting in --early-output

We cannot tell a node that has been checked and found not to be
interesting (which does not have the TREECHANGE flag) from a
node that hasn't been checked if it is interesting or not,
without relying on something else, such as object->parsed.

But an object can get the "parsed" flag for other reasons.
Which means that "TREECHANGE" has the wrong polarity.

This changes the way how the path pruning logic marks an
uninteresting commits.  From now on, we consider a commit
interesting by default, and explicitly mark the ones we decided
to prune.  The flag is renamed to "TREESAME".

Then, this fixes the logic to show the early output with
incomplete pruning.  It basically says "a commit that has
TREESAME set is kind-of-UNINTERESTING", but obviously in a
different way than an outright UNINTERESTING commit.  Until we
parse and examine enough parents to determine if a commit
becomes surely "kind-of-UNINTERESTING", we avoid rewriting
the ancestry so that later rounds can fix things up.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix rev-list when showing objects involving submodules
Linus Torvalds [Sun, 11 Nov 2007 23:35:23 +0000 (23:35 +0000)] 
Fix rev-list when showing objects involving submodules

The function mark_tree_uninteresting() assumed that the tree entries
are blob when they are not trees.  This is not so.  Since we do
not traverse into submodules (yet), the gitlinks should be ignored.

In general, we should try to start moving away from using the
"S_ISLNK()" like things for internal git state. It was a mistake to
just assume the numbers all were same across all systems in the first
place.  This implementation converts to the "object_type", and then
uses a case statement.

Noticed by Ilari on IRC.
Test script taken from an earlier version by Dscho.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 14 Nov 2007 11:37:18 +0000 (03:37 -0800)] 
Merge branch 'maint'

* maint:
  git-clean: honor core.excludesfile
  Documentation: Fix man page breakage with DocBook XSL v1.72
  git-remote.txt: fix typo
  core-tutorial.txt: Fix argument mistake in an example.
  replace reference to git-rm with git-reset in git-commit doc
  Grammar fixes for gitattributes documentation
  Don't allow fast-import tree delta chains to exceed maximum depth
  revert/cherry-pick: allow starting from dirty work tree.
  t/t3404: fix test for a bogus todo file.

Conflicts:

fast-import.c

16 years agoFix dependencies of parse-options test program
Alex Riesen [Tue, 13 Nov 2007 23:16:36 +0000 (00:16 +0100)] 
Fix dependencies of parse-options test program

A stale test-parse-options can break t0040 otherwise.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agouser-manual.txt: fix a few mistakes
Sergei Organov [Tue, 13 Nov 2007 18:19:39 +0000 (21:19 +0300)] 
user-manual.txt: fix a few mistakes

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-clean: honor core.excludesfile
Junio C Hamano [Wed, 14 Nov 2007 09:54:43 +0000 (01:54 -0800)] 
git-clean: honor core.excludesfile

git-clean did not honor core.excludesfile configuration
variable, although some other commands such as git-add and
git-status did.  Fix this inconsistency.

Original report and patch from Shun'ichi Fuji.  Rewritten by me
and bugs and tests are mine.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: Fix man page breakage with DocBook XSL v1.72
Jonas Fonseca [Wed, 14 Nov 2007 09:38:46 +0000 (10:38 +0100)] 
Documentation: Fix man page breakage with DocBook XSL v1.72

From version 1.72 it will replace all dots in roff requests with U+2302
("house" character), and add escaping in output for all instances of dot
that are not in roff requests. This caused the ".ft" hack forcing
monospace font in listingblocks to end up as "\&.ft" and being visible
in the resulting man page.

The fix adds a DOCBOOK_XSL_172 build variable that will disable the
hack. To allow this variable to be defined in config.mak it also moves
build variable handling below the inclusion of config.mak.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoHandle broken vsnprintf implementations in strbuf
Shawn O. Pearce [Tue, 13 Nov 2007 08:22:44 +0000 (03:22 -0500)] 
Handle broken vsnprintf implementations in strbuf

Solaris 9's vsnprintf implementation returns -1 if we pass it a
buffer of length 0.  The only way to get it to give us the actual
length necessary for the formatted string is to grow the buffer
out to have at least 1 byte available in the strbuf and then ask
it to compute the length.

If the available space is 0 I'm growing it out by 64 to ensure
we will get an accurate length estimate from all implementations.
Some callers may need to grow the strbuf again but 64 should be a
reasonable enough initial growth.

We also no longer silently fail to append to the string when we are
faced with a broken vsnprintf implementation.  On Solaris 9 this
silent failure caused me to no longer be able to execute "git clone"
as we tried to exec the empty string rather than "git-clone".

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-remote.txt: fix typo
Sergei Organov [Tue, 13 Nov 2007 18:17:47 +0000 (21:17 +0300)] 
git-remote.txt: fix typo

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocore-tutorial.txt: Fix argument mistake in an example.
Sergei Organov [Sat, 10 Nov 2007 13:17:33 +0000 (16:17 +0300)] 
core-tutorial.txt: Fix argument mistake in an example.

One of examples has wrong output given the arguments provided.
Fix arguments to match the output.

Fix a minor syntax mistake in another place.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoreplace reference to git-rm with git-reset in git-commit doc
Jing Xue [Mon, 12 Nov 2007 04:43:00 +0000 (23:43 -0500)] 
replace reference to git-rm with git-reset in git-commit doc

The message in git-commit suggesting to use 'git rm --cached'
to unstage is just plain wrong. It really should mention 'git reset'.

Suggested by Jan Hudec.

Signed-off-by: Jing Xue <jingxue@digizenstudio.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGrammar fixes for gitattributes documentation
Wincent Colaiuta [Wed, 14 Nov 2007 07:51:41 +0000 (08:51 +0100)] 
Grammar fixes for gitattributes documentation

Tweak the "filter" section of the gitattributes documentation to add
some
missing articles and improve some word choices without changing the
semantics of the section.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDon't allow fast-import tree delta chains to exceed maximum depth
Shawn O. Pearce [Wed, 14 Nov 2007 04:48:42 +0000 (23:48 -0500)] 
Don't allow fast-import tree delta chains to exceed maximum depth

Brian Downing noticed fast-import can produce tree depths of up
to 6,035 objects and even deeper.  Long delta chains can create
very small packfiles but cause problems during repacking as git
needs to unpack each tree to count the reachable blobs.

What's happening here is the active branch cache isn't big enough.
We're swapping out the branch and thus recycling the tree information
(struct tree_content) back into the free pool.  When we later reload
the tree we set the delta_depth to 0 but we kept the tree we just
reloaded as a delta base.

So if the tree we reloaded was already at the maximum depth we
wouldn't know it and make the new tree a delta.  Multiply the
number of times the branch cache has to swap out the tree times
max_depth (10) and you get the maximum delta depth of a tree created
by fast-import.  In Brian's case above the active branch cache had
to swap the branch out 603/604 times during this import to produce
a tree with a delta depth of 6035.

Acked-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoResurrect git-revert.sh example and add comment to builtin-revert.c
Junio C Hamano [Tue, 13 Nov 2007 21:45:11 +0000 (13:45 -0800)] 
Resurrect git-revert.sh example and add comment to builtin-revert.c

I had to scratch my head for quite some time figuring out why we
cannot optimize out write_tree() we do when --no-commit option
is given, whose purpose seem to be only to check if the index is
unmerged, with a simple loop over the active_cache[].

So add a comment to describe why the write_tree() is there, and
resurrect the last scripted version as a reference material in
contrib/example directory with others.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorevert/cherry-pick: allow starting from dirty work tree.
Junio C Hamano [Tue, 13 Nov 2007 20:28:53 +0000 (12:28 -0800)] 
revert/cherry-pick: allow starting from dirty work tree.

There is no reason to forbid a dirty work tree when reverting or
cherry-picking a change, as long as the index is clean.

The scripted version used to allow it:

    case "$no_commit" in
    t)
     # We do not intend to commit immediately.  We just want to
     # merge the differences in.
     head=$(git-write-tree) ||
     die "Your index file is unmerged."
     ;;
    *)
     head=$(git-rev-parse --verify HEAD) ||
     die "You do not have a valid HEAD"
     files=$(git-diff-index --cached --name-only $head) || exit
     if [ "$files" ]; then
     die "Dirty index: cannot $me (dirty: $files)"
     fi
     ;;
    esac

but C rewrite tightened the check, probably by mistake.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot/t3404: fix test for a bogus todo file.
Junio C Hamano [Tue, 13 Nov 2007 21:05:50 +0000 (13:05 -0800)] 
t/t3404: fix test for a bogus todo file.

The test wants to see if there are still remaining tasks, but checked
a wrong file.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-quiltimport.sh fix --patches handling
Andy Whitcroft [Mon, 12 Nov 2007 12:07:40 +0000 (12:07 +0000)] 
git-quiltimport.sh fix --patches handling

When converting git-quiltimport.sh to the new git-rev-part --parseopt
system, the handling of --patches was broken.  We inadvertantly always
attempt to use '--patches' as the value.

This was introduced in the following commit:

    commit e01fbf1a8f185bf6722e828286862a4122269ef7
    Author: Pierre Habouzit <madcoder@debian.org>
    Date:   Sun Nov 4 11:31:01 2007 +0100

        Migrate git-quiltimport.sh to use git-rev-parse --parseopt

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-commit: Add tests for invalid usage of -a/--interactive with paths
Björn Steinbrink [Mon, 12 Nov 2007 15:15:39 +0000 (16:15 +0100)] 
git-commit: Add tests for invalid usage of -a/--interactive with paths

git-commit was/is broken in that it accepts paths together with -a or
--interactive, which it shouldn't. There tests check those usage errors.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix preprocessor logic that determines the availablity of strchrnul().
Johannes Sixt [Mon, 12 Nov 2007 10:09:05 +0000 (11:09 +0100)] 
Fix preprocessor logic that determines the availablity of strchrnul().

Apart from the error in the condition (&& should actually be ||), the
construct

    #if !defined(A) || !A

leads to a syntax error in the C preprocessor if A is indeed not defined.

Tested-by: David Symonds <dsymonds@gmail.com>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-clean: Fix error message if clean.requireForce is not set.
Johannes Sixt [Mon, 12 Nov 2007 08:27:35 +0000 (09:27 +0100)] 
git-clean: Fix error message if clean.requireForce is not set.

It was distracting to see this error message:

     clean.requireForce set and -n or -f not given; refusing to clean

even though clean.requireForce was not set at all. This patch distinguishes
the cases and gives a different message depending on whether the
configuration variable is not set or set to true.

While we are here, we also divert the error messages to stderr.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase: fix "rebase --continue" breakage
Johannes Schindelin [Mon, 12 Nov 2007 13:11:46 +0000 (13:11 +0000)] 
rebase: fix "rebase --continue" breakage

The --skip case was handled properly when rebasing without --merge,
but the --continue case was not.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: support for funky branch and project names over HTTP(S)
Eric Wong [Mon, 12 Nov 2007 07:37:42 +0000 (23:37 -0800)] 
git-svn: support for funky branch and project names over HTTP(S)

SVN requires that paths be URI-escaped for HTTP(S) repositories.
file:// and svn:// repositories do not need these rules.

Additionally, accessing individual paths inside repositories
(check_path() and get_log() do NOT require escapes to function
and in fact it breaks things).

Noticed-by: Michael J. Cohen <mjc@cruiseplanners.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: Fix references to deprecated commands
Jonas Fonseca [Mon, 12 Nov 2007 00:32:51 +0000 (01:32 +0100)] 
Documentation: Fix references to deprecated commands

... by changing git-tar-tree reference to git-archive and removing
seemingly unrelevant footnote about git-ssh-{fetch,upload}.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Mon, 12 Nov 2007 08:14:15 +0000 (00:14 -0800)] 
Merge branch 'maint'

* maint:
  for-each-ref: fix off by one read.
  git-branch: remove mention of non-existent '-b' option
  git-svn: prevent dcommitting if the index is dirty.
  Fix memory leak in traverse_commit_list

16 years agoMerge branch 'sp/maint-plug-traverse-commit-list-leak' into maint
Junio C Hamano [Mon, 12 Nov 2007 08:00:00 +0000 (00:00 -0800)] 
Merge branch 'sp/maint-plug-traverse-commit-list-leak' into maint

* sp/maint-plug-traverse-commit-list-leak:
  Fix memory leak in traverse_commit_list

16 years agofor-each-ref: fix off by one read.
Christian Couder [Mon, 12 Nov 2007 04:37:25 +0000 (05:37 +0100)] 
for-each-ref: fix off by one read.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-branch: remove mention of non-existent '-b' option
Jeff King [Mon, 12 Nov 2007 04:07:05 +0000 (23:07 -0500)] 
git-branch: remove mention of non-existent '-b' option

This looks like a cut and paste error from the git-checkout
explanation of --no-track.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: prevent dcommitting if the index is dirty.
Benoit Sigoure [Sun, 11 Nov 2007 18:41:41 +0000 (19:41 +0100)] 
git-svn: prevent dcommitting if the index is dirty.

dcommit uses rebase to sync the history with what has just been pushed to
SVN.  Trying to dcommit with a dirty index is troublesome for rebase, so now
the user will get an error message if he attempts to dcommit with a dirty
index.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot2200: test more cases of "add -u"
Junio C Hamano [Mon, 12 Nov 2007 02:44:16 +0000 (18:44 -0800)] 
t2200: test more cases of "add -u"

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-fetch: avoid local fetching from alternate (again)
Shawn O. Pearce [Sun, 11 Nov 2007 07:29:47 +0000 (02:29 -0500)] 
git-fetch: avoid local fetching from alternate (again)

Back in e3c6f240fd9c5bdeb33f2d47adc859f37935e2df Junio taught
git-fetch to avoid copying objects when we are fetching from
a repository that is already registered as an alternate object
database.  In such a case there is no reason to copy any objects
as we can already obtain them through the alternate.

However we need to ensure the objects are all reachable, so we
run `git rev-list --objects $theirs --not --all` to verify this.
If any object is missing or unreadable then we need to fetch/copy
the objects from the remote.  When a missing object is detected
the git-rev-list process will exit with a non-zero exit status,
making this condition quite easy to detect.

Although git-fetch is currently a builtin (and so is rev-list)
we cannot invoke the traverse_objects() API at this point in the
transport code.  The object walker within traverse_objects() calls
die() as soon as it finds an object it cannot read.  If that happens
we want to resume the fetch process by calling do_fetch_pack().
To get around this we spawn git-rev-list into a background process
to prevent a die() from killing the foreground fetch process,
thus allowing the fetch process to resume into do_fetch_pack()
if copying is necessary.

We aren't interested in the output of rev-list (a list of SHA-1
object names that are reachable) or its errors (a "spurious" error
about an object not being found as we need to copy it) so we redirect
both stdout and stderr to /dev/null.

We run this git-rev-list based check before any fetch as we may
already have the necessary objects local from a prior fetch.  If we
don't then its very likely the first $theirs object listed on the
command line won't exist locally and git-rev-list will die very
quickly, allowing us to start the network transfer.  This test even
on remote URLs may save bandwidth if someone runs `git pull origin`,
sees a merge conflict, resets out, then redoes the same pull just
a short time later.  If the remote hasn't changed between the two
pulls and the local repository hasn't had git-gc run in it then
there is probably no need to perform network transfer as all of
the objects are local.

Documentation for the new quickfetch function was suggested and
written by Junio, based on his original comment in git-fetch.sh.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agorev-list: Introduce --quiet to avoid /dev/null redirects
Shawn O. Pearce [Sun, 11 Nov 2007 07:29:41 +0000 (02:29 -0500)] 
rev-list: Introduce --quiet to avoid /dev/null redirects

Some uses of git-rev-list are to run it with --objects to see if
a range of objects between two or more commits is fully connected
or not.  In such a case the caller doesn't care about the actual
object names or hash hints so formatting this data only for it to
be dumped to /dev/null by a redirect is a waste of CPU time.  If
all the caller needs is the exit status then --quiet can be used
to bypass the commit and object formatting.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agorun-command: Support sending stderr to /dev/null
Shawn O. Pearce [Sun, 11 Nov 2007 07:29:37 +0000 (02:29 -0500)] 
run-command: Support sending stderr to /dev/null

Some callers may wish to redirect stderr to /dev/null in some
contexts, such as if they are executing a command only to get
the exit status and don't want users to see whatever output it
may produce as a side-effect of computing that exit status.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-fetch: Always fetch tags if the object they reference exists
Shawn O. Pearce [Sun, 11 Nov 2007 07:29:30 +0000 (02:29 -0500)] 
git-fetch: Always fetch tags if the object they reference exists

Previously git-fetch.sh used `git cat-file -t` to determine if an
object referenced by a tag exists, and if so fetch that tag locally.
This was subtly broken during the port to C based builtin-fetch as
lookup_object() only works to locate an object if it was previously
accessed by the transport.  Not all transports will access all
objects in this way, so tags were not always being fetched.

The rsync transport never loads objects into the internal object
table so automated tag following didn't work if rsync was used.
Automated tag following also didn't work on the native transport
if the new tag was behind the common point(s) negotiated between
the two ends of the connection as the tag's referrant would not
be loaded into the internal object table.  Further the automated
tag following was broken with the HTTP commit walker if the new
tag's referrant was behind an existing ref, as the walker would
stop before loading the tag's referrant into the object table.

Switching to has_sha1_file() restores the original behavior from
the shell script by checking if the object exists in the ODB,
without relying on the state left behind by a transport.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoMerge branch 'sp/maint-plug-traverse-commit-list-leak' into sp/fetch-fix
Junio C Hamano [Mon, 12 Nov 2007 01:09:48 +0000 (17:09 -0800)] 
Merge branch 'sp/maint-plug-traverse-commit-list-leak' into sp/fetch-fix

* sp/maint-plug-traverse-commit-list-leak:
  Fix memory leak in traverse_commit_list

16 years agogit-checkout: Test for relative path use.
David Symonds [Fri, 9 Nov 2007 09:12:28 +0000 (20:12 +1100)] 
git-checkout: Test for relative path use.

Signed-off-by: David Symonds <dsymonds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-checkout: Support relative paths containing "..".
David Symonds [Fri, 9 Nov 2007 00:36:06 +0000 (11:36 +1100)] 
git-checkout: Support relative paths containing "..".

Signed-off-by: David Symonds <dsymonds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoReorder diff_opt_parse options more logically per topics.
Pierre Habouzit [Wed, 7 Nov 2007 10:20:32 +0000 (11:20 +0100)] 
Reorder diff_opt_parse options more logically per topics.

This is a line reordering patch _only_.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>