1
0
mirror of https://github.com/git/git.git synced 2024-10-05 19:41:52 +02:00
Commit Graph

4036 Commits

Author SHA1 Message Date
Junio C Hamano
b4196cf70a Merge branches 'master' and 'jc/combine' into next
* master:
  Add git-clean command
  diff_flush(): leakfix.
  parse_date(): fix parsing 03/10/2006

* jc/combine:
  combine-diff: refactor built-in xdiff interface.
2006-04-05 02:58:14 -07:00
Pavel Roskin
c3b831bd84 Add git-clean command
This command removes untracked files from the working tree.  This
implementation is based on cg-clean with some simplifications.  The
documentation is included.

[jc: with trivial documentation fix, noticed by Jakub Narebski]

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-05 02:51:27 -07:00
Junio C Hamano
12d81ce598 Merge branch 'fix'
* fix:
  diff_flush(): leakfix.
  parse_date(): fix parsing 03/10/2006
2006-04-05 02:50:54 -07:00
Junio C Hamano
7d6c447145 diff_flush(): leakfix.
We were leaking filepairs when output-format was set to
NO_OUTPUT.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-05 02:48:41 -07:00
Junio C Hamano
d9ea73e056 combine-diff: refactor built-in xdiff interface.
This refactors the line-by-line callback mechanism used in
combine-diff so that other programs can reuse it more easily.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-05 02:09:58 -07:00
Junio C Hamano
fa0cdab537 parse_date(): fix parsing 03/10/2006
The comment associated with the date parsing code for three
numbers separated with slashes or dashes implied we wanted to
interpret using this order:

	yyyy-mm-dd
	yyyy-dd-mm
	mm-dd-yy
	dd-mm-yy

However, the actual code had the last two wrong, and making it
prefer dd-mm-yy format over mm-dd-yy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 23:00:18 -07:00
Junio C Hamano
110cb41cbf Merge branch 'nh/http' into next
* nh/http:
  http-fetch: add optional DAV-based pack list
  cvsimport: use git-update-ref when updating
2006-04-04 18:13:54 -07:00
Nick Hengeveld
8d9fbe57b3 http-fetch: add optional DAV-based pack list
If git is not built with NO_EXPAT, this patch changes git-http-fetch to
attempt using DAV to get a list of remote packs and fall back to using
objects/info/packs if the DAV request fails.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 18:06:35 -07:00
Junio C Hamano
afb28f239f Merge branch 'pb/regex' into next
* pb/regex:
  On some platforms, certain headers need to be included before regex.h
2006-04-04 17:15:02 -07:00
Johannes Schindelin
46b8dec038 On some platforms, certain headers need to be included before regex.h
Happily, these are already included in cache.h, which is included anyway...
so: change the order of includes.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 17:14:06 -07:00
Johannes Schindelin
42277bc81c cvsimport: use git-update-ref when updating
This simplifies code, and also fixes a subtle bug: when importing in a
shared repository, where another user last imported from CVS, cvsimport
used to complain that it could not open <branch> for update.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 17:13:25 -07:00
Junio C Hamano
ca3874a470 Merge branch 'jc/combine' into next
* jc/combine:
  combine-diff: use built-in xdiff.
  GIT 1.3.0-rc2
  Set HTTP user agent to git/GIT_VERSION
  git-ls-remote: send no-cache header when fetching info/refs
2006-04-04 15:00:34 -07:00
Junio C Hamano
f23fc773a2 combine-diff: use built-in xdiff.
Now there is no GNU diff invocations, except the one from
blame.c

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 14:53:43 -07:00
Junio C Hamano
fc4c4cd21c GIT 1.3.0-rc2
Bunch of cleanups with a few notable enhancements since
1.3.0-rc1:

 - revision traversal infrastructure is updated so that
   existence of paths limiters and/or --max-age does not cause
   it to call limit_list().  This helps the latency working with
   the command quite a bit.

 - comes with updated gitk.

One notable fix is to make sure that the IO is restarted upon
signal even on platforms whose default signal semantics is not
to do so.  This is the fix for the notorious "clone is broken
since 1.2.2 on Solaris" problem.

Signed-off-by: Junio C Hamano <junkio@cox.net>
v1.3.0-rc2
2006-04-04 14:52:53 -07:00
Junio C Hamano
3d9c54d7b3 Merge in xdiff cleanup pieces 2006-04-04 14:43:57 -07:00
Nick Hengeveld
20fc9bc5e4 Set HTTP user agent to git/GIT_VERSION
Useful for diagnostics/troubleshooting to know which client versions are
hitting your server.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 14:42:47 -07:00
Nick Hengeveld
7fa8ddd6e2 git-ls-remote: send no-cache header when fetching info/refs
Proxies should not cache this file as it can cause a client to end up with
a stale version, as reported here:

http://marc.theaimsgroup.com/?l=git&m=114407944125389

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 14:36:22 -07:00
Junio C Hamano
46e48c3604 Merge branch 'pb/regex' into next
* pb/regex:
  Support for pickaxe matching regular expressions
2006-04-04 13:45:29 -07:00
Petr Baudis
d01d8c6782 Support for pickaxe matching regular expressions
git-diff-* --pickaxe-regex will change the -S pickaxe to match
POSIX extended regular expressions instead of fixed strings.

The regex.h library is a rather stupid interface and I like pcre too, but
with any luck it will be everywhere we will want to run Git on, it being
POSIX.2 and all. I'm not sure if we can expect platforms like AIX to
conform to POSIX.2 or if win32 has regex.h. We might add a flag to
Makefile if there is a portability trouble potential.

Signed-off-by: Petr Baudis <pasky@suse.cz>
2006-04-04 13:44:15 -07:00
Junio C Hamano
810e152375 Merge branch 'pe/cleanup'
* pe/cleanup:
  Replace xmalloc+memset(0) with xcalloc.
  Use blob_, commit_, tag_, and tree_type throughout.
2006-04-04 13:43:00 -07:00
Junio C Hamano
4c61b7d15a Merge branch 'lt/fix-sol-pack'
* lt/fix-sol-pack:
  Use sigaction and SA_RESTART in read-tree.c; add option in Makefile.
  safe_fgets() - even more anal fgets()
  pack-objects: be incredibly anal about stdio semantics
  Fix Solaris stdio signal handling stupidities
2006-04-04 13:42:02 -07:00
Junio C Hamano
00cbdec981 Merge branch 'pe/cleanup' into next
* pe/cleanup:
  Replace xmalloc+memset(0) with xcalloc.
  Use blob_, commit_, tag_, and tree_type throughout.
2006-04-04 00:23:36 -07:00
Junio C Hamano
b411fda15d Merge early part of 'jc/combine' branch 2006-04-04 00:21:50 -07:00
Peter Eriksen
90321c106c Replace xmalloc+memset(0) with xcalloc.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 00:11:19 -07:00
Peter Eriksen
8e44025925 Use blob_, commit_, tag_, and tree_type throughout.
This replaces occurences of "blob", "commit", "tag", and "tree",
where they're really used as type specifiers, which we already
have defined global constants for.

Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 00:11:19 -07:00
Davide Libenzi
ca557afff9 Clean-up trivially redundant diff.
Also corrects the line numbers in unified output when using
zero lines context.
2006-04-04 00:11:09 -07:00
Eric Wong
fc9957b005 contrib/git-svn: handle array values correctly
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 00:09:47 -07:00
Eric Wong
5f2f424002 contrib/git-svn: make sure our git-svn is up-to-date for test
Bugs like the last one could've been avoided if it weren't for
this...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 00:09:45 -07:00
Eric Wong
5941a9e9d8 contrib/git-svn: ensure repo-config returns a value before using it
fetching from repos without an authors-file defined was broken.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 00:09:42 -07:00
Junio C Hamano
7941602983 Merge branch 'lt/fix-sol-pack' into next
* lt/fix-sol-pack:
  Use sigaction and SA_RESTART in read-tree.c; add option in Makefile.
  safe_fgets() - even more anal fgets()
2006-04-03 23:43:16 -07:00
Jason Riedy
72fdfb50f7 Use sigaction and SA_RESTART in read-tree.c; add option in Makefile.
Might as well ape the sigaction change in read-tree.c to avoid
the same potential problems.  The fprintf status output will
be overwritten in a second, so don't bother guarding it.  Do
move the fputc after disabling SIGALRM to ensure we go to the
next line, though.

Also add a NO_SA_RESTART option in the Makefile in case someone
doesn't have SA_RESTART but does restart (maybe older HP/UX?).
We want the builder to chose this specifically in case the
system both lacks SA_RESTART and does not restart stdio calls;
a compat #define in git-compat-utils.h would silently allow
broken systems.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
v1.2.5
2006-04-03 23:42:25 -07:00
Junio C Hamano
687dd75c95 safe_fgets() - even more anal fgets()
This is from Linus -- the previous round forgot to clear error
after EINTR case.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-03 23:42:25 -07:00
Junio C Hamano
1bdbb57407 Merge branch 'jc/clone' into next
* jc/clone:
  git-clone: fix handling of upsteram whose HEAD does not point at master.
  fix repacking with lots of tags
  Documentation: revise top of git man page
2006-04-02 22:23:49 -07:00
Junio C Hamano
c72112e6e1 git-clone: fix handling of upsteram whose HEAD does not point at master.
When cloning from a remote repository that has master, main, and
origin branches _and_ with the HEAD pointing at main branch, we
did quite confused things during clone.  So this cleans things
up.  The behaviour is a bit different between separate remotes/
layout and the mixed branches layout.

The newer layout with $GIT_DIR/refs/remotes/$origin/, things are
simpler and more transparent:

 - remote branches are copied to refs/remotes/$origin/.

 - HEAD points at the branch with the same name as the remote
   HEAD points at, and starts at where the remote HEAD points at.

 - $GIT_DIR/remotes/$origin file is set up to fetch all remote
   branches, and merge the branch HEAD pointed at at the time of
   the cloning.

Everything-in-refs/heads layout was the more confused one, but
cleaned up like this:

 - remote branches are copied to refs/heads, but the branch
   "$origin" is not copied, instead a copy of the branch the
   remote HEAD points at is created there.

 - HEAD points at the branch with the same name as the remote
   HEAD points at, and starts at where the remote HEAD points at.

 - $GIT_DIR/remotes/$origin file is set up to fetch all remote
   branches except "$origin", and merge the branch HEAD pointed
   at at the time of the cloning.

With this, the remote has master, main and origin, and its HEAD
points at main, you could:

	git clone $URL --origin upstream

to use refs/heads/upstream as the tracking branch for remote
"main", and your primary working branch will also be "main".
"master" and "origin" are used to track the corresponding remote
branches and with this setup they do not have any special meaning.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 22:22:27 -07:00
Jim Radford
40e907bff2 fix repacking with lots of tags
Use git-rev-list's --all instead of git-rev-parse's to keep from
hitting the shell's argument list length limits when repacking
with lots of tags.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 21:25:57 -07:00
J. Bruce Fields
23091e954c Documentation: revise top of git man page
I'm afraid I'll be accused of trying to suck all the jokes and the
personality out of the git documentation.  I'm not!  Really!

That said, "man git" is one of the first things a new user is likely try,
and it seems a little cruel to start off with a somewhat obscure joke
about the architecture of git.

So instead I'm trying for a relatively straightforward description of what
git does, and what features distinguish it from other systems, together
with immediate links to introductory documentation.

I also did some minor reorganization in an attempt to clarify the
classification of commands.  And revised a bit for conciseness (as is
obvious from the diffstat--hopefully I didn't cut anything important).

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 21:17:32 -07:00
Junio C Hamano
f0c979f4db Merge branch 'lt/fix-sol-pack' into next
* lt/fix-sol-pack:
  pack-objects: be incredibly anal about stdio semantics
  Fix Solaris stdio signal handling stupidities

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 13:54:28 -07:00
Linus Torvalds
da93d12b00 pack-objects: be incredibly anal about stdio semantics
This is the "letter of the law" version of using fgets() properly in the
face of incredibly broken stdio implementations.  We can work around the
Solaris breakage with SA_RESTART, but in case anybody else is ever that
stupid, here's the "safe" (read: "insanely anal") way to use fgets.

It probably goes without saying that I'm not terribly impressed by
Solaris libc.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 13:46:27 -07:00
Linus Torvalds
fb7a6531e6 Fix Solaris stdio signal handling stupidities
This uses sigaction() to install the SIGALRM handler with SA_RESTART, so
that Solaris stdio doesn't break completely when a signal interrupts a
read.

Thanks to Jason Riedy for confirming the silly Solaris signal behaviour.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 13:41:56 -07:00
Rene Scharfe
ec26b4d6b0 Fix sparse warnings about non-ANSI function prototypes
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 12:58:47 -07:00
Rene Scharfe
5142db6912 Fix sparse warnings about usage of 0 instead of NULL
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 12:58:46 -07:00
Rene Scharfe
139faba8f5 Remove useless pointer update
buf is not used afterwards.  The compiler optimized the dead store out
anyway, but let's clean the source, too.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02 12:58:45 -07:00
Eric Wong
20b1d700c9 contrib/git-svn: documentation updates
contrib/git-svn/git-svn.txt:
	added git-repo-config key names for options
	fixed quoting of "git-svn-HEAD" in the manpage
	use preformatted text for examples

contrib/git-svn/Makefile:
	add target to generate HTML:
		http://git-svn.yhbt.net/git-svn.html

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01 21:57:55 -08:00
Eric Wong
53909056da contrib/git-svn: accept configuration via repo-config
repo-config keys are any of the long option names minus the '-'
characters

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01 21:57:52 -08:00
Junio C Hamano
bbbc8c3a8d revision: --max-age alone does not need limit_list() anymore.
This makes git log --since=7.days to be streamable.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01 19:13:22 -08:00
Junio C Hamano
5306968660 revision: simplify argument parsing.
This just moves code around to consolidate the part that sets
revs->limited to one place based on various flags.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01 18:56:16 -08:00
Junio C Hamano
22c31bf183 revision: --topo-order and --unpacked
Now, using --unpacked without limit_list() does not make much
sense, but this is parallel to the earlier --max-age fix.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01 18:55:56 -08:00
Linus Torvalds
be7db6e574 revision: Fix --topo-order and --max-age with reachability limiting.
What ends up not working very well at all is the combination of
"--topo-order" and the output filter in get_revision. It will
return NULL when we see the first commit out of date-order, even
if we have other commits coming.

So we really should do the "past the date order" thing in
get_revision() only if we have _not_ done it already in
limit_list().

Something like this.

The easiest way to test this is with just

	gitk --since=3.days.ago

on the kernel tree. Without this patch, it tends to be pretty obviously
broken.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01 18:16:53 -08:00
Linus Torvalds
2a0925be35 Make path-limiting be incremental when possible.
This makes git-rev-list able to do path-limiting without having to parse
all of history before it starts showing the results.

This makes things like "git log -- pathname" much more pleasant to use.

This is actually a pretty small patch, and the biggest part of it is
purely cleanups (turning the "goto next" statements into "continue"), but
it's conceptually a lot bigger than it looks.

What it does is that if you do a path-limited revision list, and you do
_not_ ask for pseudo-parenthood information, it won't do all the
path-limiting up-front, but instead do it incrementally in
"get_revision()".

This is an absolutely huge deal for anything like "git log -- <pathname>",
but also for some things that we don't do yet - like the "find where
things changed" logic I've described elsewhere, where we want to find the
previous revision that changed a file.

The reason I put "RFC" in the subject line is that while I've validated it
various ways, like doing

	git-rev-list HEAD -- drivers/char/ | md5sum

before-and-after on the kernel archive, it's "git-rev-list" after all. In
other words, it's that really really subtle and complex central piece of
software. So while I think this is important and should go in asap, I also
think it should get lots of testing and eyeballs looking at the code.

Btw, don't even bother testing this with the git archive. git itself is so
small that parsing the whole revision history for it takes about a second
even with path limiting. The thing that _really_ shows this off is doing

	git log drivers/

on the kernel archive, or even better, on the _historic_ kernel archive.

With this change, the response is instantaneous (although seeking to the
end of the result will obviously take as long as it ever did). Before this
change, the command would think about the result for tens of seconds - or
even minutes, in the case of the bigger old kernel archive - before
starting to output the results.

NOTE NOTE NOTE! Using path limiting with things like "gitk", which uses
the "--parents" flag to actually generate a pseudo-history of the
resulting commits won't actually see the improvement in interactivity,
since that forces git-rev-list to do the whole-history thing after all.

MAYBE we can fix that too at some point, but I won't promise anything.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-31 16:24:48 -08:00
Linus Torvalds
7b0c996679 Move "--parent" parsing into generic revision.c library code
Not only do we do it in both rev-list.c and git.c, the revision walking
code will soon want to know whether we should rewrite parenthood
information or not.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-31 16:24:48 -08:00