Commit Graph

5994 Commits

Author SHA1 Message Date
Aneesh Kumar K.V
f0321866be gitweb: fix snapshot support
[jc: when I applied the patch I misread RFC 2616 which mildly
 recommended against using the name "gzip", which was there only
 for a historical reason.  This fixes the mistake up and uses
 the content-encoding "x-gzip" again.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 22:58:05 -07:00
Luben Tuikov
59fb1c9445 gitweb: bugfix: git_print_page_path() needs the hash base
If a file F exists in branch B, but doesn't exist
in master branch, then blob_plain needs the hash base in
order to properly get the file.  The hash base is passed
on symbolically so we still preserve the "latest" quality
of the link presented by git_print_page_path().

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 14:31:14 -07:00
Luben Tuikov
3899e7a329 gitweb: bugfix: commitdiff regression
Fix regression in git_commitdiff() introduced
by commit 756d2f064b.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 14:30:21 -07:00
Aneesh Kumar K.V
cb9c6e5b0a gitweb: Support for snapshot
This adds snapshort support in gitweb. To enable one need to
set gitweb.snapshot = true in the config file.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@hp.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 10:41:58 -07:00
Jakub Narebski
d16d093c2d gitweb: Refactor printing commit message
Separate pretty-printing commit message (comment) into git_print_log
and git_print_simplified_log subroutines. As of now the former is used
in git_commit, the latter in git_log and git_commitdiff.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 03:04:46 -07:00
Martin Waitz
13d0216504 gitweb: fix project list if PATH_INFO=="/".
The project list now uses several common header / footer generation functions.
These functions only check for "defined $project", but when PATH_INFO just
contains a "/" (which is often generated by web servers), then this test
fails.

Now explicitly undef $project if there is none so that the tests in other
gitweb parts work again.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 03:04:46 -07:00
Martin Waitz
6132b7e4bb gitweb: support for / as home_link.
If the webserver is configured to use gitweb even for the root directory
of the site, then my_uri is empty which leads to a non-functional home
link.  Fix that by defaulting to "/" in this case.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 03:04:46 -07:00
Martin Waitz
5c95fab017 gitweb: support for "fp" parameter.
The "fp" (file name parent) parameter was previously generated for
blob diffs of renamed files.  However, it was not used in any code.

Now href() can generate "fp" parameters and they are used by the
blobdiff code to show the correct file name.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 03:04:46 -07:00
Martin Waitz
756d2f064b gitweb: continue consolidation of URL generation.
Further use href() instead of URL generation by string concatenation.
Almost all functions are converted now.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 03:04:46 -07:00
Jakub Narebski
d4baf9eaf4 gitweb: Uniquify version info output, add meta generator in page header
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17 03:04:38 -07:00
Junio C Hamano
409d1d2053 Merge branch 'jc/format-patch'
* jc/format-patch:
  Add a newline before appending "Signed-off-by: " line
2006-08-16 19:27:03 -07:00
Ville Skyttä
076a10c728 Be nicer if git executable is not installed
This patch avoids problems if vc-git.el is installed and activated, but
the git executable is not available, for example
http://list-archive.xemacs.org/xemacs-beta/200608/msg00062.html

Signed-off-by: Ville Skyttä <scop@xemacs.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-16 19:18:27 -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
Junio C Hamano
500a99935d Merge branch 'maint'
* maint:
  [PATCH] git-mv: add more path normalization
2006-08-16 14:00:12 -07:00
Junio C Hamano
6493cc09c2 builtin-grep: remove unused debugging cruft.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-16 13:58:32 -07:00
Jakub Narebski
e79ca7cc25 gitweb: Add support for per project git URLs
It is now possible for project to have individual clone/fetch URLs.
They are provided in new file 'cloneurl' added below project's
$GIT_DIR directory.

If there is no cloneurl file, concatenation of git base URLs with
project name is used.

This is merge of Jakub Narebski and David Rientjes
  gitweb: Show project's git URL on summary page
with Aneesh Kumar
  gitweb: Add support for cloneurl.
  gitweb: Support multiple clone urls
patches.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-16 13:37:40 -07:00
Johannes Schindelin
d78b0f3d6a [PATCH] git-mv: add more path normalization
We already use the normalization from get_pathspec(), but now we also
remove a trailing slash. So,

	git mv some_path/ into_some_path/

works now.

Also, move the "can not move directory into itself" test before the
subdirectory expansion.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-16 13:19:06 -07:00
Junio C Hamano
0fc82cff12 Remove the "delay writing to avoid runtime penalty of racy-git avoidance"
The work-around should not be needed.  Even if it turns out we
would want it later, git will remember the patch for us ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 22:12:54 -07:00
Martin Waitz
1c2a4f5add gitweb: consolidate action URL generation.
Use the href() function instead of string concatenation to generate
most URLs to our own CGI.
This is a work in progress, not everything has been converted yet.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:55:19 -07:00
Martin Waitz
06a9d86b49 gitweb: provide function to format the URL for an action link.
Provide a new function which can be used to generate an URL for the CGI.
This makes it possible to consolidate the URL generation in order to make
it easier to change the encoding of actions into URLs.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:55:17 -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
520cd3eca5 Documentation/technical/racy-git.txt
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:32:54 -07:00
David Rientjes
96f1e58f52 remove unnecessary initializations
[jc: I needed to hand merge the changes to the updated codebase,
 so the result needs to be checked.]

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:22:20 -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
Junio C Hamano
53e1a761be finish_connect(): thinkofix
All but one callers have ignore the return value from this
function, but the only caller, builtin-tar-tree.c::remote_tar(),
assumed it returns non-zero on failure and zero on success.  The
implementation however was returning either the waited pid
(which must be the same as its input) or -1 (an error).

Fix this thinko, while getting rid of an assignment of return
value from waitpid() into a variable of type int.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:02:16 -07:00
Johannes Schindelin
1d6249e609 git-mv: succeed even if source is a prefix of destination
As noted by Fredrik Kuivinen, without this patch, git-mv fails on

	git-mv README README-renamed

because "README" is a prefix of "README-renamed".

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:00:20 -07:00
David Rientjes
6f002f984f use appropriate typedefs
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 16:12:09 -07:00
David Rientjes
0bef57ee44 make inline is_null_sha1 global
Replace sha1 comparisons to null_sha1 with a global inline (which previously an
unused static inline in builtin-apply.c)

[jc: with a fix from Jonas Fonseca.]

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 15:06:03 -07:00
Junio C Hamano
789a09b487 avoid nanosleep(2)
On Solaris nanosleep(2) is not available in libc; you need to
link with -lrt to get it.

The purpose of the loop is to wait until the next filesystem
timestamp granularity, and the code uses subsecond sleep in the
hope that it can shorten the delay to 0.5 seconds on average
instead of a full second.  It is probably not worth depending on
an extra library for this.

We might want to yank out the whole "racy-git avoidance is
costly later at runtime, so let's delay writing the index out"
codepath later, but that is a separate issue and needs some
testing on large trees to figure it out.  After playing with the
kernel tree, I have a feeling that the whole thing may not be
worth it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 03:39:47 -07:00
Junio C Hamano
3cd4f5e8eb git-apply --binary: clean up and prepare for --reverse
This cleans up the implementation of "git-apply --binary", and
implements reverse application of binary patches (when git-diff
is converted to emit reversible binary patches).

Earlier, the types of encoding (either deflated literal or
deflated delta) were stored in is_binary field in struct patch,
which meant that we cannot store more than one fragment that
differ in the encoding for a patch.  This moves the information
to a field in struct fragment that is otherwise unused for
binary patches, and makes it possible to hang two (or more, but
two is enough) hunks for a binary patch.

The original "binary patch" output from git-diff is internally
parsed into an "is_binary" patch with one fragment.  Upcoming
reversible binary patch output will have two fragments, the
first one being the forward patch and the second one the reverse
patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 03:11:52 -07:00
Dennis Stosberg
d1b9944db8 Fix detection of ipv6 on Solaris
The configuration script detects whether linking with -lsocket is
necessary but doesn't add -lsocket to LIBS.  This lets the ipv6 test
fail.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 02:58:47 -07:00
Dennis Stosberg
ab5573ae9f Look for sockaddr_storage in sys/socket.h
On Solaris and the BSDs the definition of "struct sockaddr_storage"
is not available from "netinet/in.h".  On Solaris "sys/socket.h" is
enough, at least OpenBSD needs "sys/types.h", too.

Using "sys/types.h" and "sys/socket.h" seems to be a more portable
way.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 02:57:42 -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
Junio C Hamano
f686d03034 git-apply --reverse: simplify reverse option.
Having is_reverse in each patch did not make sense.  This will hopefully
simplify the work needed to introduce reversible binary diff format.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 23:26:51 -07:00
Junio C Hamano
6a0ebe8ced t4116 apply --reverse test
The binary patch test needs to be made more careful not to have
the postimage blob in the repository in which the patch is applied

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 23:24:55 -07:00
David Rientjes
78b713a1d0 Make sha1flush void and remove conditional return.
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 19:01:00 -07:00
David Rientjes
59076eba6e Make upload_pack void and remove conditional return.
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:59:03 -07:00
David Rientjes
74b504f671 Make track_tree_refs void.
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:59:03 -07:00
David Rientjes
aa145403da Make pack_objects void.
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:59:03 -07:00
David Rientjes
b5524c826d Make fsck_dir void.
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:59:03 -07:00
David Rientjes
f7f0fbfcf4 Make checkout_all void.
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:59:03 -07:00
David Rientjes
cf995ede2c Make show_entry void
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:43:49 -07:00
David Rientjes
eddd1c8cef Make pprint_tag void and cleans up call in cmd_cat_file.
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:43:49 -07:00
Junio C Hamano
a976b0a593 Remove combine-diff.c::uninteresting()
A patch from David Rientjes made me realize we do not have to have
this function -- just call diff_unmodified_pair() directly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:41:12 -07:00
David Rientjes
968a1d65f4 read-cache.c cleanup
Removes conditional returns.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:41:12 -07:00
David Rientjes
0bc87ffb6c http-push.c cleanup
Removes conditional return.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:41:12 -07:00
David Rientjes
8c0b2bb636 diff.c cleanup
Removes conditional return.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:38:07 -07:00
David Rientjes
9e0ec82cac builtin-push.c cleanup
Removes conditional return in builtin-push.c

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:38:07 -07:00