Commit graph

3025 commits

Author SHA1 Message Date
Junio C Hamano 657907e76e ls-files --others --directory: fix a bug with index entry ordering
When both howto-index.sh and howto/make-dist.txt exist under
Documentation/ directory, dir_exists() mistakenly checked it
without the trailing slash to see if there was something under
Documentation/howto directory, and did not realize there was,
because '-' sorts earlier than '/' and cache_name_pos() finds
howto-index.sh, which is not under howto/ directory.  This
caused --others --directory to show it which was incorrect.

Check the directory name with the trailing slash, because having
an entry that has such as a prefix is what we are looking for.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-07 21:34:02 -08:00
Linus Torvalds 9518eb2629 ls-files -o: optionally skip showing the contents in "untracked" directories
Darrin Thompson notes that git-ls-files -o reports all the unknown
files it finds in a work area.  Subversion and probably other systems
"simply ignore all the files and directories inside an unknown
directory and just note the directory as unknown."

With --directory option, ls-files --others shows untracked directories
without descending into them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-07 21:34:02 -08:00
Junio C Hamano 03febf99bc git-fetch: auto-following tags.
I added things to ls-remote so that Cogito can auto-follow tags
easily and correctly a while ago, but git-fetch did not use the
facility.  Recently added git-describe command relies on
repository keeping up-to-date set of tags, which made it much
more attractive to automatically follow tags, so we do that as
well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-07 21:33:51 -08:00
John Ellson 026351a035 Make GIT-VERSION-GEN tolerate missing git describe command
I think it is probably a bug that "git non_existent_command"
returns its error message to stdout without an error, where
"git-non_existent_command" behaves differently and does return an
error.

Older versions of git did not implement "git describe"  and
GIT-VERSION-GEN produces an empty version string if run on
a system with such a git installed.  The consequence
is that "make rpm" fails.

This patch fixes GIT-VERSION-GEN so that it works in the
absence of a working "git describe"

Signed-off-by: John Ellson <ellson@research.att.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 21:02:01 -08:00
Junio C Hamano 5df466c507 Merge fixes up to GIT 1.0.7
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:54:42 -08:00
Junio C Hamano 92e802c6cc GIT 1.0.7
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:52:50 -08:00
Jon Loeliger c1fe2fe4fe Fix git-symbolic-ref typo in git.txt.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:29:52 -08:00
Andreas Ericsson da6bf70ebf git: grok 'help' to mean '--help'.
Most other scm's understand it, most users expect it and it's an easy fix.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:28:52 -08:00
Eric Wong 2ed8e622bf Documentation/git-svnimport: document -T and -t switches correctly
The -T and -t switches are swapped in the documentation and actual
code.  I've made the documentation match the code.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:28:19 -08:00
Eric Wong 2961e0ee8b svnimport: support repositories requiring SSL authentication
I looked at svn-mirror to see how it did this, seems about right.
"It works for me" when using it against https://svn.musicpd.org

tested command-line: git-svnimport -C mpc -i -m -v  \
	-T mpc/trunk -b mpc/branches -t mpc/tags https://svn.musicpd.org

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:28:14 -08:00
Junio C Hamano 6ce183216d t3300: skip when filesystem does not like TAB in filenames.
Instead of checking Cygwin explicitly, see if the filesystem lets us
create funny filenames.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:14:40 -08:00
Junio C Hamano aa66c7ec77 format-patch/commit: Quote single quote in the author name properly.
Noticed by Kyle McMartin.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:02:33 -08:00
Junio C Hamano 81214e4ddf git-fetch --tags: reject malformed tags.
When the other end was prepared with older git and has tags that
do not follow the naming convention (see check-ref-format), do not
barf but simply reject to copy them.

Initial fix by Simon Richter, but done differently.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 19:42:12 -08:00
Jonas Fonseca 353ce81597 Wrap synopsis lines and use [verse] to keep formatting
In addition, also fixes a few synopses to be more consistent and a gitlink.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 18:44:28 -08:00
Alex Riesen 6ff0b1c56c use GIT_DIR instead of /var/tmp
Not every system (will not one microsoft windows system) have /var/tmp,
whereas using GIT_DIR for random temporary files is more or less established.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:24:51 -08:00
Alex Riesen 2ccd2027b0 trivial: check, if t/trash directory was successfully created
and was successfully entered. Otherwise git-init-db will create it directly
in the working directory (t/) which can be dangerous.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:24:47 -08:00
Alex Riesen 10ae7d86c1 trivial: .gitignore precompiled python modules
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:24:42 -08:00
Alex Riesen b484ef28fb trivial: use git-repo-config to detect how to run tests in the test repository
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:23:46 -08:00
Alex Riesen e58b97af31 trivial: use git-repo-config to detect if the test can be run on the repository
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:23:44 -08:00
Alex Riesen 31f883d1b8 trivial: remove the dots at the end of file names from merge-one-file
to make the output more friendly to mouse copy-paste.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:23:41 -08:00
Alex Riesen 50b4e0c178 trivial: clarify, what are the config's user.name and user.email about
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:23:21 -08:00
Alex Riesen b6ae5409ea trivial: typo in git-commit.sh
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:23:16 -08:00
Alex Riesen 88fb958baa use result of open(2) to check for presence
Not that the stat against open race would matter much in this context,
but that simplifies
the code a bit. Also some diagnostics added (why the open failed)

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:22:51 -08:00
Alex Riesen d9e08be9d5 fix potential deadlock in create_one_file
It can happen if the temporary file already exists (i.e. after a panic
and reboot).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:22:49 -08:00
Alex Riesen 781411ed46 trivial: O_EXCL makes O_TRUNC redundant
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:22:47 -08:00
Alex Riesen 7f272ca80c trivial: retval of waitpid is not errno
...but is used as such and passed to strerror.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:22:45 -08:00
Linus Torvalds b73cebf437 Fix nasty approxidate bug
Stupid me.

If approxidate ends up with a month that is ahead of the current month, it
decrements the year to last year.

Which is correct, and means that "last december" does the right thing.

HOWEVER. It should only do so if the year is the same as the current year.

Without this fix, "5 days ago" ends up being in 2004, because it first
decrements five days, getting us to December 2005 (correct), but then it
also ends up decrementing the year once more to turn that December into
"last year" (incorrect, since it already _was_ last year).

Duh. Pass me a donut.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:22:43 -08:00
Amos Waterland 0a15217184 AIX compile fix for repo-config.c
AIX 5 has a /usr/include/regex.h containing this code:

 #ifdef  _NO_PROTO
 extern  char    *regex();
 extern  char    *regcmp();
 #else /* _NO_PROTO */
 extern  char    *regex(const char *, const char *, ...);
 extern  char    *regcmp(const char *, ...);
 #endif  /* _NO_PROTO */

This means that repo-config.c is trying to redefine the `regex' symbol.
Here is a simple patch that just uses `regexp' as the symbol name instead.

Signed-off-by: Amos Waterland <apw@us.ibm.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:22:37 -08:00
Jonas Fonseca 8b32572c74 git-init-db(1): Describe --shared and the idempotent nature of init-db
Based on the recent discussion on the mailing list.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 17:22:31 -08:00
Junio C Hamano 4e7a2eccc2 ?alloc: do not return NULL when asked for zero bytes
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-29 01:33:40 -08:00
Junio C Hamano 82f9d58a39 code comments: spell
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-29 01:32:56 -08:00
Junio C Hamano 89438677ab Documentation: spell.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-29 01:32:56 -08:00
Gerrit Pape f1ec72ba1e Fix skipping merge-order test with NO_OPENSSL=1.
Move git-rev-list --merge-order usage check for 'OpenSSL not linked' after
test 1; we cannot trigger this unless we try to actually use --merge-order
by giving some ref, and we do not have any ref until we run the first test
to create commits.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-28 11:09:53 -08:00
Junio C Hamano 58e3fb40f7 Merge fixes up to GIT 1.0.6 2005-12-27 18:13:30 -08:00
Junio C Hamano 17dff84b5e GIT 1.0.6
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 18:08:58 -08:00
Junio C Hamano cfee10a773 send-pack/receive-pack: allow errors to be reported back to pusher.
This updates the protocol between git-send-pack/git-receive-pack
in a backward compatible way to allow failures at the receiving
end to be propagated back to the sender.  Most notably, versions
of git-push before this could not notice if the update hook on
the receiving end refused to update the ref for its own policy
reasons.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 18:04:14 -08:00
Junio C Hamano 9b88fcef7d Makefile: use git-describe to mark the git version.
Note: with this commit, the GIT maintainer workflow must change.
GIT-VERSION-GEN is now the file to munge when the default
version needs to be changed, not Makefile.  The tag needs to be
pushed into the repository to build the official tarball and
binary package beforehand.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:28 -08:00
Junio C Hamano c06818e20a git-describe: documentation.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:28 -08:00
Junio C Hamano 64deb858b0 git-describe: still prefer annotated tag under --all and --tags
Even though --all and --tags can be used to include non
annotated tags in the reference point candidates, prefer to use
annotated tags if there are more than one refs that name the
same commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:27 -08:00
Junio C Hamano 2d9e7c9f90 git-describe: --tags and --abbrev
With --tags, not just annontated tags, but also any ref under
refs/tags/ are used to name the revision.

The number of digits is configurable with the --abbrev=<n> option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:27 -08:00
Junio C Hamano 4cdf78bf96 git-describe: use find_unique_abbrev()
Just in case 8 hexadecimal digits are not enough.  We could use
shorter default if we wanted to.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:27 -08:00
Junio C Hamano 635d413430 git-describe: really prefer tags only.
Often there are references other than annotated tags under
refs/tags hierarchy that are used to "keep things just in case".
default to use annotated tags only, still leaving the option to
use any ref with --all flag.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:27 -08:00
Linus Torvalds 908e5310b9 Add a "git-describe" command
It shows you the most recent tag that is reachable from a particular
commit is.

Maybe this is something that "git-name-rev" should be taught to do,
instead of having a separate command for it. Regardless, I find it useful.

What it does is to take any random commit, and "name" it by looking up the
most recent commit that is tagged and reachable from that commit. If the
match is exact, it will just print out that ref-name directly. Otherwise
it will print out the ref-name, followed by the 8-character "short SHA".

IOW, with something like Junios current tree, I get:

	[torvalds@g5 git]$ git-describe parent
	refs/tags/v1.0.4-g2414721b

ie the current head of my "parent" branch (ie Junio) is based on v1.0.4,
but since it has a few commits on top of that, it has added the git hash
of the thing to the end: "-g" + 8-char shorthand for the commit
2414721b19.

Doing a "git-describe" on a tag-name will just show the full tag path:

	[torvalds@g5 git]$ git-describe v1.0.4
	refs/tags/v1.0.4

unless there are _other_ tags pointing to that commit, in which case it
will just choose one at random.

This is useful for two things:

 - automatic version naming in Makefiles, for example. We could use it in
   git itself: when doing "git --version", we could use this to give a
   much more useful description of exactly what version was installed.

 - for any random commit (say, you use "gitk <pathname>" or
   "git-whatchanged" to look at what has changed in some file), you can
   figure out what the last version of the repo was. Ie, say I find a bug
   in commit 39ca371c45b04cd50d0974030ae051906fc516b6, I just do:

	[torvalds@g5 linux]$ git-describe 39ca371c45b04cd50d0974030ae051906fc516b6
	refs/tags/v2.6.14-rc4-g39ca371c

   and I now know that it was _not_ in v2.6.14-rc4, but was presumably in
   v2.6.14-rc5.

The latter is useful when you want to see what "version timeframe" a
commit happened in.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:27 -08:00
Junio C Hamano 36cd2cc7d9 Do not mark tags fetched via --tags flag as mergeable
Otherwise "git pull --tags" would mistakenly try to merge all of
them, which is never what the user wants.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 11:52:51 -08:00
Junio C Hamano e9add36007 Fix bogus tests on rev-list output.
These tests seem to mean checking the output with expected
result, but was not doing its handrolled test helper function.

Also fix the guard to workaround wc output that have whitespace
padding, which was broken but not exposed because the test was
not testing it ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 11:08:57 -08:00
Junio C Hamano 8eafa3da62 Guard a test against wc that pads its output with whitespace
Spotted by Johannes.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 11:08:57 -08:00
Sam Ravnborg 08337a97a2 copy_fd: close ifd on error
In copy_fd when write fails we ought to close input file descriptor.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 10:49:25 -08:00
Junio C Hamano 36de72aa9d Merge fixes up to GIT 1.0.5 2005-12-26 18:45:30 -08:00
Junio C Hamano e5f5219a4f GIT 1.0.5
Minor fixes.

Starting from this one I won't be touching debian/ directory
since the official maintainer seems to be reasonably quick to
package up things.  The packaging procedure used there seems to
be quite different from what I have, so I'd like to avoid
potential confusion and reduce work by the official maintainer
and myself.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-26 18:44:15 -08:00
Johannes Schindelin 975b31dc6e Handle symlinks graciously
This patch converts a stat() to an lstat() call, thereby fixing the case
when the date of a symlink was not the same as the one recorded in the
index. The included test case demonstrates this.

This is for the case that the symlink points to a non-existing file. If
the file exists, worse things than just an error message happen.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-26 18:33:27 -08:00