Commit Graph

14080 Commits

Author SHA1 Message Date
Damien Diederen
e78f69a3f2 cvsserver: Implement update -p (print to stdout)
Cvs update -p -r <rev> <path> is the documented way to retrieve a
specific revision of a file (similar to git show <rev>:<path>).
Without this patch, the -p flag is ignored and status output is
produced, causing clients to interpret it as the contents of the file.

TkCVS uses update -p as a basis for implementing its various "View"
and "Diff" commands.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 16:05:27 -07:00
Damien Diederen
dded801a7b cvsserver: Add a few tests for 'status' command
Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 16:05:27 -07:00
Damien Diederen
852b921c78 cvsserver: Do not include status output for subdirectories if -l is passed
This effectively implements the -l switch by pruning the entries whose
filenames contain a path separator.  It was previously ignored.

Without this, TkCVS includes strange "ghost" entries in its directory
listings.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 16:05:27 -07:00
Damien Diederen
23b7180fdc cvsserver: Only print the file part of the filename in status header
The "File:" header of CVS status output only includes the basename of
the file, even when generating a recursive listing; do the same.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 16:05:27 -07:00
Damien Diederen
38bcd31a58 cvsserver: Respond to the 'editors' and 'watchers' commands
These commands list users editing and watching locked files.  This trivial
implementation always returns an empty response, since git-cvsserver does not
implement file locking.

Without this, TkCVS hangs at startup, waiting forever for a response.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 16:05:27 -07:00
Junio C Hamano
fe308f5373 builtin-prune: protect objects listed on the command line
Finally, this resurrects the documented behaviour to protect other
objects listed on the command line from getting pruned.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 15:39:57 -07:00
Michele Ballabio
629de472b6 builtin-prune.c: use parse_options()
Using the OPT_DATE() introduced earlier, this updates builtin-prune to
use parse_options().

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 13:55:15 -07:00
Michele Ballabio
0c62705a0d Add tests for git-prune
It seems that git prune changed behaviour with respect to revisions added
from command line, probably when it became a builtin. Currently, it prints
a short usage and exits: instead, it should take those revisions into
account and not prune them. So add a couple of test to point this out.

We'll be fixing this by switching to parse_options(), so add tests to
detect bogus command line parameters as well, to keep ourselves from
introducing regressions.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 13:55:15 -07:00
Michele Ballabio
1f4a711a05 parse-options.c: introduce OPT_DATE
There are quite a few places that will need to call approxidate(),
when they'll adopt the parse-options system, so this patch adds the
function parse_opt_approxidate_cb(), used by OPT_DATE.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 13:55:15 -07:00
Jeff King
ca7246864b add--interactive: allow user to choose mode update
When using the 'p'atch command, instead of just throwing out any mode
change, present it to the user in the same way that we show hunks.

This way, the mode change can be staged independently from the changes
to the contents.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 13:54:57 -07:00
Jeff King
b717a62762 add--interactive: ignore mode change in 'p'atch command
When a path is examined in the patch subcommand, any mode changes in
the file are given to use in the diff header by git-diff. If no hunks
are staged, then we throw out that header and do not touch the
path.  But if _any_ hunks are staged, we use the header, and the mode
is changed together with the contents.

Since the 'p'atch command should just be dealing with hunks that are
shown to the user, it makes sense to just ignore mode changes
entirely. We do squirrel away the mode, though, since the next patch
will allow users to select the mode update separately.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 13:54:56 -07:00
Junio C Hamano
1768905b51 Update draft release notes for 1.5.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 13:37:29 -07:00
Junio C Hamano
319a36a5c2 Merge branch 'maint'
* maint:
  Update draft release notes for 1.5.4.5
  Documentation: clarify use of .git{ignore,attributes} versus .git/info/*
  t/t3800-mktag.sh: use test_must_fail rather than '!'

Conflicts:

	t/t3800-mktag.sh
2008-03-27 13:35:18 -07:00
Junio C Hamano
24362a5d3f Update draft release notes for 1.5.4.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 13:14:20 -07:00
Junio C Hamano
b88605f6d4 Merge branch 'jc/maint-fetch-regression-1.5.4' into maint
* jc/maint-fetch-regression-1.5.4:
  git-fetch test: test tracking fetch results, not just FETCH_HEAD
  Fix branches file configuration
  Tighten refspec processing
2008-03-27 13:03:56 -07:00
Jeff King
90b22907f2 Documentation: clarify use of .git{ignore,attributes} versus .git/info/*
gitignore patterns can be read from three different
files, while gitattributes can come from two files. Let's
provide some hints to the user about the differences and how
they are typically used.

Suggested by Toby Corkindale, but gratuitously reworded by Jeff King.

Signed-off-by: Toby Corkindale <toby.corkindale@rea-group.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 13:03:51 -07:00
Junio C Hamano
8ee002fd3d test_must_fail: 129 is a valid error code from usage()
When a git command is run under test_must_fail to make sure that
the argument parser catches bogus command line, it exits with 129.
We need to catch it as a valid "graceful error exit".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27 12:13:39 -07:00
Gerrit Pape
5b67b8e2d4 imap-send: properly error out if imap.host is not set in config
If no imap host is specified in the git config, git imap-send used
to try to lookup a null pointer through gethostbyname(), causing a
segfault.  Since setting the imap.host variable is mandatory,
imap-send now properly fails with an explanatory error message.

The problem has been reported by picca through
 http://bugs.debian.org/472632

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26 16:15:02 -07:00
Frank Lichtenheld
40ae8872a1 t9600-cvsimport.sh: set HOME before checking for cvsps availability
This actually sounds like a bug in cvsps, which requires an existing
home directory when asked for the usage through -h

 $ HOME=/nonexistent cvsps -h
 Cannot create the cvsps directory '.cvsps': No such file or directory

This made t9600 think that cvsps is not available if HOME did not exist,
causing the tests to be skipped

 $ HOME=/nonexistent sh t9600-cvsimport.sh
 * skipping cvsimport tests, cvsps not found
 * passed all 0 test(s)

Now t9600 sets HOME to the current working directory before checking for
the availability of the cvsps program.

This issue has been discovered by Marco Rodrigues, and fixed by Frank
Lichtenheld through
 http://bugs.debian.org/471969

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26 16:14:52 -07:00
SZEDER Gábor
af05d67939 Always set *nongit_ok in setup_git_directory_gently()
setup_git_directory_gently() only modified the value of its *nongit_ok
argument if we were not in a git repository.  Now it will always set it
to 0 when we are inside a repository.

Also remove now unnecessary initializations in the callers of this
function.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26 15:41:35 -07:00
Brandon Casey
525d461528 t/t3800-mktag.sh: use test_must_fail rather than '!'
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26 14:26:52 -07:00
Junio C Hamano
660b9c3a4e Merge branch 'jc/maint-fetch-regression-1.5.4'
* jc/maint-fetch-regression-1.5.4:
  git-fetch test: test tracking fetch results, not just FETCH_HEAD
  Fix branches file configuration
  Tighten refspec processing
  Fix the wrong output of `git-show v1.3.0~155^2~4` in documentation.
2008-03-26 01:49:41 -07:00
Junio C Hamano
a466637c57 git-fetch test: test tracking fetch results, not just FETCH_HEAD
We really should have done this long time ago.  Existing t5515 test
was written for the specific purpose of catching regression to the
contents of generated FETCH_HEAD file, but it also is a good place
to make sure various fetch configurations do fetch what they intend
to fetch (and nothing else).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26 01:29:54 -07:00
Daniel Barkalow
472fa4cd33 Fix branches file configuration
Fetched remote branch from .git/branches/foo should fetch into
refs/heads/foo.  Also when partial URL is given, the fetched head should
always be remote HEAD, and the result should not be stored anywhere.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26 00:50:51 -07:00
Daniel Barkalow
c091b3d415 Tighten refspec processing
This changes the pattern matching code to not store the required final
/ before the *, and then to require each side to be a valid ref (or
empty). In particular, any refspec that looks like it should be a
pattern but doesn't quite meet the requirements will be found to be
invalid as a fallback non-pattern.

This was cherry picked from commit ef00d15 (Tighten refspec processing,
2008-03-17), and two fix-up commits 46220ca (remote.c: Fix overtight
refspec validation, 2008-03-20) and 7d19da4 (refspec: allow colon-less
wildcard "refs/category/*", 2008-03-25) squashed in.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26 00:10:55 -07:00
Guanqun Lu
71a5099b64 Fix the wrong output of git-show v1.3.0~155^2~4 in documentation.
Texts between ~ and ~ will be subscripted during the asciidoc translation.

Signed-off-by: Guanqun Lu <Guanqun.Lu@Gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
(cherry picked from commit 0c829391cf)
2008-03-26 00:09:17 -07:00
Junio C Hamano
7d19da46fd refspec: allow colon-less wildcard "refs/category/*"
"git push --tags elsewhere" is implemented in terms of wildcarded refspec
"refs/tags/*" these days, and the user wants to push the tags under the
same name to the other branch.  This resurrects the support for it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-25 21:55:38 -07:00
Johannes Schindelin
5cc8f37250 init: show "Reinit" message even in an (existing) empty repository
Earlier, git-init tested for a valid HEAD ref, but if the repository
was empty, there was none.  Instead, test for the existence of
the file $GIT_DIR/HEAD.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-25 00:34:05 -07:00
Julian Phillips
76ce946294 Documentation/git-checkout: Update summary to reflect current abilities
For a while now, git-checkout has been more powerful than the man-page
summary would suggest (the main text does describe the new features),
so update the summary to hopefully better reflect the current
functionality.  Also update the glossary description of the word checkout.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-25 00:00:07 -07:00
Dirk Süsserott
995e8df4a9 Documentation: git-tag '-m'/'-F' implies '-a' 2008-03-24 22:14:35 -07:00
Johannes Sixt
ec31b0ce98 builtin-remote: Fix missing newline at end of listing of pushed branches
Without this the output of 'git remote show' does not end with a new-line:

bash> git remote show repo
* remote repo
  URL: repo.or.cz:/srv/git/kdbg.git
  Tracked remote branches
    maint master mob
  Local branch pushed with 'git push'
    +master:masterbash>

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-23 17:11:33 -07:00
Guanqun Lu
0c829391cf Fix the wrong output of git-show v1.3.0~155^2~4 in documentation.
Texts between ~ and ~ will be subscripted during the asciidoc translation.

Signed-off-by: Guanqun Lu <Guanqun.Lu@Gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-23 12:02:11 -07:00
Johannes Schindelin
313da4f71c RelNotes: mention checkout/branch's --track option, too
checkout and branch recently learnt to track local branches when
branch.autosetupmerge = always, but they _also_ learnt to do that when
asked explicitely with the option "--track".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-23 10:16:33 -07:00
Govind Salinas
42c8c74c14 pretty.c: add %x00 format specifier.
This adds a %xXX format which inserts two hexdigits after %x as a byte
value in the resulting string.  This can be used to add a NUL byte or any
other byte that can make machine parsing easier.  It is also necessary to
use fwrite to print out the data since printf will terminate if you feed
it a NUL.

Signed-off-by: Govind Salinas <blix@sophiasuchtig.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-23 00:41:54 -07:00
Junio C Hamano
bc6100087c GIT 1.5.5-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-23 00:22:29 -07:00
Junio C Hamano
970639740c gc --auto: raise default auto pack limit from 20 to 50
Recent discussion on the list, with the improvement f7c22cc (always start
looking up objects in the last used pack first, 2007-05-30) brought in,
reached the concensus that the current default 20 is too low.

Reference: http://thread.gmane.org/gmane.comp.version-control.git/77586
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-23 00:11:31 -07:00
Junio C Hamano
dc96bdb946 Merge branch 'git-p4' of git://repo.or.cz/git/git-p4
* 'git-p4' of git://repo.or.cz/git/git-p4:
  git-p4: Use P4EDITOR environment variable when set
  git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
  git-p4: Optimize the fetching of data from perforce.
2008-03-23 00:02:06 -07:00
Junio C Hamano
46220ca100 remote.c: Fix overtight refspec validation
We tightened the refspec validation code in an earlier commit ef00d15
(Tighten refspec processing, 2008-03-17) per my suggestion, but the
suggestion was misguided to begin with and it broke this usage:

    $ git push origin HEAD~12:master

The syntax of push refspecs and fetch refspecs are similar in that they
are both colon separated LHS and RHS (possibly prefixed with a + to
force), but the similarity ends there.  For example, LHS in a push refspec
can be anything that evaluates to a valid object name at runtime (except
when colon and RHS is missing, or it is a glob), while it must be a
valid-looking refname in a fetch refspec.  To validate them correctly, the
caller needs to be able to say which kind of refspecs they are.  It is
unreasonable to keep a single interface that cannot tell which kind it is
dealing with, and ask it to behave sensibly.

This commit separates the parsing of the two into different functions, and
clarifies the code to implement the parsing proper (i.e. splitting into
two parts, making sure both sides are wildcard or neither side is).

This happens to also allow pushing a commit named with the esoteric "look
for that string" syntax:

    $ git push ../test.git ':/remote.c: Fix overtight refspec:master'

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-22 23:46:17 -07:00
Eyvind Bernhardsen
9b33fa08b2 fast-import: Document the effect of "merge" with no "from" in a commit
The fast-import documentation currently does not document the behaviour
of "merge" when there is no "from" in a commit.  This patch adds a
description of what happens: the commit is created with a parent, but
no files.  This behaviour is equivalent to "from" followed by
"filedeleteall".

Signed-off-by: Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-22 23:20:01 -07:00
Kevin Ballard
3644da7214 Make git-svn tests behave better on OS X
Give lib-git-svn.sh a few alternate paths to look for apache2.
Explicitly define the LockFile so httpd will actually start under OS X

Signed-off-by: Kevin Ballard <kevin@sb.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-22 17:53:12 -07:00
Ralf Wildenhues
bf7c90216d Improve description of git filter-branch.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-22 17:25:16 -07:00
Brandon Casey
c8a0869290 t/t7003-filter-branch.sh: use test_must_fail rather than '!'
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-22 17:23:29 -07:00
Kevin Ballard
8114da1616 Don't try and percent-escape existing percent escapes in git-svn URIs
git-svn project names are percent-escaped ever since f5530b8
(git-svn: support for funky branch and project names over HTTP(S),
2007-11-11).

Unfortunately this breaks the scenario where the user hands git-svn an
already-escaped URI.  Fix the regexp to skip over what looks like
existing percent escapes, and test this scenario.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-20 23:59:12 -07:00
Johannes Schindelin
740fdd27f0 remote show: do not show symbolic refs
For symbolic refs, a sane notion of being "stale" is that the ref
they point to no longer exists.  Since this is checked already,
"remote show" does not need to show them at all.

Incidentally, this fixes the issue that "HEAD" was shown as a
stale ref by "remote show" in a freshly cloned repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19 17:33:30 -07:00
Kevin Ballard
a811e4f0f0 Document the sendemail.smtpserverport config variable
Add sendemail.smtpserverport to the Configuration section
of the git-send-email manpage. It should probably be
referenced in the --smtp-server-port option as well.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19 17:32:28 -07:00
Kevin Ballard
7ccd366779 Add --reverse to the git-rev-list usage string
git-rev-list accepts --reverse, as documented in
the manpage, but the usage string does not list it.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19 17:31:51 -07:00
Nicolas Pitre
05f3045261 make it easier for people who just want to get rid of 'git gc --auto'
Give a direct hint to those who feel highly annoyed by the auto gc
behavior.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19 17:30:53 -07:00
Brandon Casey
b14d255ba8 builtin-gc.c: allow disabling all auto-gc'ing by assigning 0 to gc.auto
The gc.auto configuration variable is somewhat ambiguous now that there
is also a gc.autopacklimit setting. Some users may assume that it controls
all auto-gc'ing. Also, now users must set two configuration variables to
zero when they want to disable autopacking. Since it is unlikely that users
will want to autopack based on some threshold of pack files when they have
disabled autopacking based on the number of loose objects, be nice and allow
a setting of zero for gc.auto to disable all autopacking.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19 17:29:52 -07:00
Miklos Vajna
02b00e16bb Documentation/git-merge: document subtree strategy.
There was already some documentation about subtree under
Documentation/howto but it was missing from git-merge manpage.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19 01:43:02 -07:00
Daniel Barkalow
420e9af498 Fix tag following
Before the second fetch-pack connection in the same process, unmark
all of the objects marked in the first connection, in order that we'll
list them as things we have instead of thinking we've already
mentioned them.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19 01:43:02 -07:00