Граф коммитов

625 Коммитов

Автор SHA1 Сообщение Дата
Franck Bui-Huu 4df096a5ca Add git-archive
git-archive is a command to make TAR and ZIP archives of a git tree.
It helps prevent a proliferation of git-{format}-tree commands.

Instead of directly calling git-{tar,zip}-tree command, it defines
a very simple API, that archiver should implement and register in
"git-archive.c". This API is made up by 2 functions whose prototype
is defined in "archive.h" file.

 - The first one is used to parse 'extra' parameters which have
   signification only for the specific archiver. That would allow
   different archive backends to have different kind of options.

 - The second one is used to ask to an archive backend to build
   the archive given some already resolved parameters.

The main reason for making this API is to avoid using
git-{tar,zip}-tree commands, hence making them useless. Maybe it's
time for them to die ?

It also implements remote operations by defining a very simple
protocol: it first sends the name of the specific uploader followed
the repository name (git-upload-tar git://example.org/repo.git).
Then it sends options. It's done by sending a sequence of one
argument per packet, with prefix "argument ", followed by a flush.

The remote protocol is implemented in "git-archive.c" for client
side and is triggered by "--remote=<repo>" option. For example,
to fetch a TAR archive in a remote repo, you can issue:

$ git archive --format=tar --remote=git://xxx/yyy/zzz.git HEAD

We choose to not make a new command "git-fetch-archive" for example,
avoind one more GIT command which should be nice for users (less
commands to remember, keeps existing --remote option).

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-09 11:57:36 -07:00
Jakub Narebski 0b5deba132 gitweb: Add GIT favicon, assuming image/png type
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-04 15:33:04 -07:00
Christian Couder 7cf67205ca Trace into open fd and refactor tracing code.
Now if GIT_TRACE is set to an integer value greater than 1
and lower than 10, we interpret this as an open fd value
and we trace into it. Note that this behavior is not
compatible with the previous one.

We also trace whole messages using one write(2) call to
make sure messages from processes do net get mixed up in
the middle.

It's now possible to run the tests like this:

	GIT_TRACE=9 make test 9>/var/tmp/trace.log

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-31 14:16:38 -07:00
Johannes Schindelin 104ff34a74 Makefile: fix typo
We checked NO_SETENV instead of NO_UNSETENV to decide if unsetenv
is available.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-29 14:26:14 -07:00
Junio C Hamano 1e49cb8ad4 Merge branch 'js/c-merge-recursive'
* js/c-merge-recursive: (21 commits)
  discard_cache(): discard index, even if no file was mmap()ed
  merge-recur: do not die unnecessarily
  merge-recur: try to merge older merge bases first
  merge-recur: if there is no common ancestor, fake empty one
  merge-recur: do not setenv("GIT_INDEX_FILE")
  merge-recur: do not call git-write-tree
  merge-recursive: fix rename handling
  .gitignore: git-merge-recur is a built file.
  merge-recur: virtual commits shall never be parsed
  merge-recur: use the unpack_trees() interface instead of exec()ing read-tree
  merge-recur: fix thinko in unique_path()
  Makefile: git-merge-recur depends on xdiff libraries.
  merge-recur: Explain why sha_eq() and struct stage_data cannot go
  merge-recur: Cleanup last mixedCase variables...
  merge-recur: Fix compiler warning with -pedantic
  merge-recur: Remove dead code
  merge-recur: Get rid of debug code
  merge-recur: Convert variable names to lower_case
  Cumulative update of merge-recursive in C
  recur vs recursive: help testing without touching too many stuff.
  ...

This is an evil merge that removes TEST script from the toplevel.
2006-08-27 20:33:46 -07:00
Rene Scharfe e4fbbfe9ec Add git-zip-tree
In the Windows world ZIP files are better supported than tar files.
Windows even includes built-in support for ZIP files nowadays.

git-zip-tree is similar to git-tar-tree; it creates ZIP files out of
git trees.  It stores the commit ID (if available) in a ZIP file comment
which can be extracted by unzip.

There's still quite some room for improvement: this initial version
supports no symlinks, calls write() way too often (three times per file)
and there is no unit test.

[jc: with a minor typefix to avoid void* arithmetic]

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26 18:27:35 -07:00
Rene Scharfe 7230e6d042 Add write_or_die(), a helper function
The little helper write_or_die() won't come back with bad news about
full disks or broken pipes.  It either succeeds or terminates the
program, making additional error handling unnecessary.

This patch adds the new function and uses it to replace two similar
ones (the one in tar-tree originally has been copied from cat-file
btw.).  I chose to add the fd parameter which both lacked to make
write_or_die() just as flexible as write() and thus suitable for
lib-ification.

There is a regression: error messages emitted by this function don't
show the program name, while the replaced two functions did.  That's
acceptable, I think; a lot of other functions do the same.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-21 20:22:23 -07:00
Junio C Hamano 8e3abd4c97 Merge branch 'jc/racy'
* jc/racy:
  Remove the "delay writing to avoid runtime penalty of racy-git avoidance"
  Add check program "git-check-racy"
  Documentation/technical/racy-git.txt
  avoid nanosleep(2)
2006-08-16 14:00:34 -07:00
Jakub Narebski 19a8721ef8 gitweb: Show project's git URL on summary page
From 31e4de9f22a3b17d4ad0ac800132e4e1a0a15006 Mon Sep 17 00:00:00 2001
From: David Rientjes <rientjes@google.com>
Date: Tue, 15 Aug 2006 11:43:04 -0700
Subject: [PATCH] gitweb: Show project's git URL on summary page

Add support for showing multiple clone/fetch git URLs for project on
a summary page. URL for project is created from base URL and project
name.

For example for XMMS2 project (xmms.se) the git base URL would be
git://git.xmms.se/xmms2.

With corrections from David Rientjes <rientjes@google.com>

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:54:26 -07:00
Junio C Hamano 42f774063d Add check program "git-check-racy"
This will help counting the racily clean paths, but it should be
useless for daily use.  Do not even enable it in the makefile.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:38:07 -07:00
Junio C Hamano c9c3470aec Merge branch 'maint'
* maint:
  finish_connect(): thinkofix
  git-mv: succeed even if source is a prefix of destination
  Solaris does not support C99 format strings before version 10
2006-08-15 21:15:32 -07:00
Dennis Stosberg f4e14ca9e0 Solaris has strlcpy() at least since version 8
See http://docs.sun.com/app/docs/doc/816-3321/6m9k23sjk?a=view

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 02:57:24 -07:00
Dennis Stosberg 66c4509b73 Solaris does not support C99 format strings before version 10
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 02:55:39 -07:00
Yasushi SHOJI 2de21fac98 gitweb: configurable home link string
I've always found difficult to figure out git URL for clone from
gitweb URL because git:// and http:// are different on many site
including kernel.org.

I've found this enhancement at http://dev.laptop.org/git when I was on
git channel, and thought that it'd be nice if all public gitweb site
show it's git URL on its page.

This patch allow us to change the home link string.  The current
default is "projects" as we all see on gitweb now.

ie. kernel.org might set this variable to "git://git.kernel.org/pub/scm/"

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:09:33 -07:00
Junio C Hamano eb4541569d Merge branch 'js/read-tree' 2006-08-12 19:29:11 -07:00
Junio C Hamano efced1e06e Merge branch 'lt/web' 2006-08-12 19:24:09 -07:00
Junio C Hamano 86183fbb09 Merge branch 'jn/conf' 2006-08-12 19:23:09 -07:00
Junio C Hamano eed94a570e Merge branch 'master' into js/c-merge-recursive
Adjust to hold_lock_file_for_update() change on the master.
2006-08-12 18:35:14 -07:00
Rene Scharfe 2e3ed670eb git-verify-pack: make builtin
Convert git-verify-pack to a builtin command.  Also rename ac to argc
and av to argv for consistancy.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10 14:19:06 -07:00
Junio C Hamano 1b1b678e3c autoconf: clean temporary file mak.append
When configure is interrupted in the middle it leaves
config.mak.append behind.  Add it to .gitignore and make sure
$(MAKE) clean removes it.

Also earlier .gitignore listed config.mak.in which is a tracked
file.  Fix it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08 17:19:28 -07:00
Junio C Hamano 102cb08521 Merge branch 'master' into mk/rename 2006-08-08 15:42:20 -07:00
Jakub Narebski 3900145ed7 autoconf: Add configure target to main Makefile
While at it fill git version information in configure.ac
configure target needs autoconf, of course.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08 13:32:04 -07:00
Junio C Hamano 0d958ac47a Makefile: Cygwin does not seem to need NO_STRLCPY
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-05 13:52:05 -07:00
Jakub Narebski 465e649d0c autoconf: Typo cleanup, reordering etc.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-04 11:53:13 -07:00
Junio C Hamano f754fa9c54 builtins: Makefile clean-up
This cleans up the build procedure for built-in commands by:

 - generating mostly redundant definition of BUILT_INS from
   BUILTIN_OBJS in the Makefile,
 - renaming a few files to make the above possible, and
 - sorting the built-in command table in git.c.

It might be a good idea to binary search (or perfect hash) the built-in
command table, but that can be done later when somebody feels like.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-04 01:51:04 -07:00
Junio C Hamano e414156ab6 Make git-checkout-index a builtin
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-04 01:23:19 -07:00
Matthias Kestenholz 640ce1052b Make git-symbolic-ref a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 23:15:11 -07:00
Matthias Kestenholz 6441363079 Make git-unpack-objects a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 23:15:11 -07:00
Matthias Kestenholz 5d4a600335 Make git-pack-objects a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 23:15:11 -07:00
Matthias Kestenholz d6b64ed0f3 Make git-name-rev a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 23:15:11 -07:00
Junio C Hamano c8b87ef8b0 .gitignore: git-merge-recur is a built file.
Also it is OK to omit the documentation for it at least for now.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 16:17:51 -07:00
Junio C Hamano 70b9c59656 Cygwin needs NO_C99_FORMAT???
I noticed that t3800 test breaks with git built without this
option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 17:06:50 -07:00
Matthias Kestenholz e12c095aa6 Make git-repo-config a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 17:05:14 -07:00
Junio C Hamano 06c084d28b gitweb: do not use @@FOO@@ for replaced tokens
This makes it easier to run gitweb/gitweb.perl without token substitution.
Using @@ makes Perl emit "unintended interpolation" warnings.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 13:58:04 -07:00
Jeff King c8d138a8c0 gitweb: optionally read config from GITWEB_CONFIG
Configuration will first be taken from variables inside the gitweb.cgi
script, which in turn come from the Makefile. Afterwards, the contents of
GITWEB_CONFIG are read, overriding the builtin defaults.

This should eliminate the need for editing the gitweb script at all. Users
should edit the Makefile and/or add a config file.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 13:56:34 -07:00
Matthias Kestenholz 53bb2c002a Make git-prune-packed a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 11:36:01 -07:00
Ramsay Allan Jones 579d1fbfaf Add NO_C99_FORMAT to support older compilers.
The NO_C99_FORMAT macro allows compilers that lack support for the
ll,hh,j,z,t size specifiers (eg. gcc 2.95.2) to adapt the code to avoid
runtime errors in the formatted IO functions.

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 00:27:18 -07:00
Ramsay Allan Jones 7ffe7098dc Fix installation of templates on ancient systems.
Do not use $(call) for 'shell quoting' paths, and pass DESTDIR down
to the templates makefile.

[jc: we have fixed the main Makefile long time ago, but somehow
 forgot to apply the same fix to templates Makefile.]

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 00:27:18 -07:00
Junio C Hamano 22987ae0bc Makefile: gitweb/gitweb.cgi is now generated.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-01 16:23:47 -07:00
Martin Waitz 281f2f6b45 gitweb: use out-of-line GIT logo.
Use the normal web server instead of the CGI to provide the git logo,
just like the gitweb.css.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-01 15:55:19 -07:00
Martin Waitz 5d043a3d85 gitweb: fill in gitweb configuration by Makefile
Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi
by the end user.  The GIT installation directory is already known
by the Makefile, and can be inserted directly into gitweb.
All other gitweb configuration parameters can now be specified by
providing GITWEB_* variables while building GIT.  These are described
in gitweb/README.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-01 15:44:47 -07:00
Junio C Hamano c1a788acee Merge branch 'js/read-tree' into js/c-merge-recursive
* js/read-tree: (107 commits)
  read-tree: move merge functions to the library
  read-trees: refactor the unpack_trees() part
  tar-tree: illustrate an obscure feature better
  git.c: allow alias expansion without a git directory
  setup_git_directory_gently: do not barf when GIT_DIR is given.
  Build on Debian GNU/kFreeBSD
  Call setup_git_directory() much earlier
  Call setup_git_directory() early
  Display an error from update-ref if target ref name is invalid.
  Fix http-fetch
  t4103: fix binary patch application test.
  git-apply -R: binary patches are irreversible for now.
  Teach git-apply about '-R'
  Makefile: ssh-pull.o depends on ssh-fetch.c
  log and diff family: honor config even from subdirectories
  git-reset: detect update-ref error and report it.
  lost-found: use fsck-objects --full
  Teach git-http-fetch the --stdin switch
  Teach git-local-fetch the --stdin switch
  Make pull() support fetching multiple targets at once
  ...
2006-07-30 23:42:10 -07:00
Johannes Schindelin 16da134b1f read-trees: refactor the unpack_trees() part
Basically, the options are passed by a struct unpack_trees_options now.
That's all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30 23:31:31 -07:00
Gerrit Pape ca7a741647 Build on Debian GNU/kFreeBSD
Patch from Petr Salinger to make the build process detect and support the
Debian GNU/kFreeBSD architecture, see
 http://bugs.debian.org/380209

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30 13:36:12 -07:00
Junio C Hamano 522a98caa5 Merge branch 'js/mv'
* js/mv:
  builtin git-mv: support moving directories
  Make git-mv a builtin
  Extract helper bits from c-merge-recursive work
2006-07-30 13:24:48 -07:00
Junio C Hamano 2dcb927f37 Merge branch 'jn/make'
* jn/make:
  Set datarootdir in config.mak.in
  Quote all calls to GIT_CONF_APPEND_LINE
  Typofix in configure.ac comment.
  configure.ac vertical whitespace usage cleanup
  autoconf: Checks for some programs
  autoconf: Checks for libraries
  autoconf: Checks for some library functions.
  autoconf: Checks for typedefs, structures, and compiler characteristics.
  autoconf: Preparing the way for autodetection
  Copy description of build configuration variables to configure.ac
  Teach make clean about configure and autoconf
  autoconf: Use autoconf to write installation directories to config.mak.autogen
2006-07-30 13:24:29 -07:00
Johannes Schindelin 2941cab99c Makefile: ssh-pull.o depends on ssh-fetch.c
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 11:15:35 -07:00
Junio C Hamano a060b803b4 Makefile: git-merge-recur depends on xdiff libraries.
Tighten dependencies to allow parallel build.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 22:02:45 -07:00
Johannes Schindelin 11be42a476 Make git-mv a builtin
This also moves add_file_to_index() to read-cache.c. Oh, and while
touching builtin-add.c, it also removes a duplicate git_config() call.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 13:36:36 -07:00
Junio C Hamano 24cf6e5847 Merge branch 'pb/configure'
* pb/configure:
  Rename man1 and man7 variables to man1dir and man7dir
  Allow INSTALL, bindir, mandir to be set in main Makefile
2006-07-26 13:35:35 -07:00