Commit graph

6621 commits

Author SHA1 Message Date
Petr Baudis 447ef09a5c gitweb: Show project's README.html if available
If the repository includes a README.html file, show it in the summary page.
The usual "this should be in the config file" argument does not apply here
since this can be larger and having such a big string in the config file
would be impractical.

I don't know if this is suitable upstream, but it's one of the repo.or.cz
custom modifications that I've thought could be interesting for others
as well.

Compared to the previous patch, this adds the '.html' extension to the
filename, so that it's clear it is, well, HTML.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:55:44 -07:00
Petr Baudis 8be2890c99 gitweb: Do not automatically append " git" to custom site name
If you customized the site name, you probably do not want the " git"
appended so that the page title is not bastardized; I want repo.or.cz pages
titled "Public Git Hosting", not "Public Git Hosting git" (what's hosting
what?).

This slightly changes the $site_name semantics but only very
insignificantly.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:55:41 -07:00
Petr Baudis 88ad729b73 gitweb: Make search type a popup menu
This makes the multiple search types actually usable by the user;
if you don't read the gitweb source, you don't even have an idea
that you can write things like that there.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:55:38 -07:00
Petr Baudis 4777b0141a gitweb: Restore object-named links in item lists
This restores the redundant links removed earlier. It supersedes my patch
to stick slashes to tree entries.

Sorry about the previous version of the patch, an unrelated snapshot link
addition to tree entries slipped through (and it it didn't even compile);
I've dropped the idea of snapshot links in tree entries in the meantime
anyway.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:55:26 -07:00
Junio C Hamano ccbb3d17ac Merge branch 'master' into jc/web
* master: (114 commits)
  gitweb: Fix setting $/ in parse_commit()
  daemon: do not die on older clients.
  xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.
  git-clone: honor --quiet
  Documentation for the [remote] config
  prune-packed: Fix uninitialized variable.
  ignore-errors requires cl
  git-send-email: do not pass custom Date: header
  Use column indexes in git-cvsserver where necessary.
  gitweb: Add '..' (up directory) to tree view if applicable
  gitweb: Improve git_print_page_path
  pager: default to LESS=FRSX not LESS=FRS
  Make prune also run prune-packed
  git-vc: better installation instructions
  gitweb: Do not esc_html $basedir argument to git_print_tree_entry
  gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)
  Fix usagestring for git-branch
  git-merge: show usage if run without arguments
  add the capability for index-pack to read from a stream
  git-clone: define die() and use it.
  ...
2006-10-23 20:53:38 -07:00
Junio C Hamano 1259404c7e Merge branch 'maint'
* maint:
  gitweb: Fix setting $/ in parse_commit()
  daemon: do not die on older clients.
  xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.
  git-clone: honor --quiet
  Documentation for the [remote] config
  prune-packed: Fix uninitialized variable.
2006-10-23 19:29:05 -07:00
Petr Baudis a153adf683 gitweb: Fix setting $/ in parse_commit()
If the commit couldn't have been read, $/ wasn't restored to \n properly,
causing random havoc like git_get_ref_list() returning the ref names with
trailing \n.

Aside of potential confusion in the body of git_search(), no other $/
surprises are hopefully hidden in the code.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 19:21:05 -07:00
Junio C Hamano 83543a24c3 daemon: do not die on older clients.
In the older times, the clients did not say which host they were trying
to connect, and the code we recently added did not quite handle the
older clients correctly.

Noticed by Simon Arlott.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 18:26:05 -07:00
Jim Meyering 67aef03455 xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.
This removes trailing blanks from git-generated diff headers
the same way a similar patch did that for GNU diff:

  http://article.gmane.org/gmane.comp.gnu.utils.bugs/13839

That is, it removes trailing blanks on the hunk header line that
shows the function name.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 14:33:54 -07:00
Jim Meyering 810799ecab git-clone: honor --quiet
I noticed that a cron-launched "git-clone --quiet" was generating
progress output to standard error -- and thus always spamming me.
The offending output was due to git-clone invoking git-read-tree with
its undocumented -v option.
This change turns off "-v" for --quiet.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 14:31:52 -07:00
Santi Béjar 0cc6d3464a Documentation for the [remote] config
Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 13:19:49 -07:00
Alexandre Julliard 2bb10fe51e prune-packed: Fix uninitialized variable.
The dryrun variable was made local instead of static by the previous
commit, and local variables aren't initialized to zero.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 13:19:18 -07:00
Karl Hasselström b4aee09e61 ignore-errors requires cl
vc-git complains that it can't find the definition of ignore-errors
unless I (require 'cl). So I guess the correct place to do that is in
the file itself.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 01:13:49 -07:00
Eric Wong 1d6a003a42 git-send-email: do not pass custom Date: header
We already generate a Date: header based on when the patch was
emailed.  git-format-patch includes the Date: header of the
patch.  Having two Date: headers is just confusing, so we
just use the current Date:

Often the mailed patches in a patch series are created over a
series of several hours or days, so the Date: header from the
original commit is incorrect for email, and often far off enough
for spam filters to complain.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 01:12:04 -07:00
Shawn Pearce 178e015c05 Use column indexes in git-cvsserver where necessary.
Tonight I found a git-cvsserver instance spending a lot of time in
disk IO while trying to process operations against a Git repository
with >30,000 objects contained in it.

Blowing away my SQLLite database and rebuilding all tables with
indexes on the attributes that git-cvsserver frequently runs queries
against seems to have resolved the issue quite nicely.

Since the indexes shouldn't hurt performance on small repositories
and always helps on larger repositories we should just always create
them when creating the revision storage tables.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 23:06:00 -07:00
Jakub Narebski b6b7fc7283 gitweb: Add '..' (up directory) to tree view if applicable
Adds '..' (up directory) link at the top of "tree" view listing,
if both $hash_base and $file_name are provided, and $file_name
is not empty string.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 22:54:08 -07:00
Jakub Narebski 4df118ed60 gitweb: Improve git_print_page_path
Add link to "tree root" (root directory) also for not defined name,
for example for "tree" action without defined "file_name" which means
"tree root".

Add " / " at the end of path when $type eq "tree".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 22:54:08 -07:00
Junio C Hamano 05eb811aa1 Merge branch 'np/pack'
* np/pack:
  add the capability for index-pack to read from a stream
  index-pack: compare only the first 20-bytes of the key.
  git-repack: repo.usedeltabaseoffset
  pack-objects: document --delta-base-offset option
  allow delta data reuse even if base object is a preferred base
  zap a debug remnant
  let the GIT native protocol use offsets to delta base when possible
  make pack data reuse compatible with both delta types
  make git-pack-objects able to create deltas with offset to base
  teach git-index-pack about deltas with offset to base
  teach git-unpack-objects about deltas with offset to base
  introduce delta objects with offset to base
2006-10-22 22:51:42 -07:00
Junio C Hamano 02a20456d2 Merge branch 'maint'
* maint:
  pager: default to LESS=FRSX not LESS=FRS
  Make prune also run prune-packed
  git-vc: better installation instructions
  gitweb: Do not esc_html $basedir argument to git_print_tree_entry
  gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)
  Fix usagestring for git-branch
  git-merge: show usage if run without arguments
2006-10-22 22:40:30 -07:00
Junio C Hamano 0abc0260fa pager: default to LESS=FRSX not LESS=FRS
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 20:28:10 -07:00
J. Bruce Fields 2eb53e65bd Make prune also run prune-packed
Both the git-prune manpage and everday.txt say that git-prune should also prune
unpacked objects that are also found in packs, by running git prune-packed.

Junio thought this was "a regression when prune was rewritten as a built-in."

So modify prune to call prune-packed again.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2006-10-22 16:39:58 -07:00
Karl Hasselström 474a90fef9 git-vc: better installation instructions
Provide some more detailed installation instructions, for the
elisp-challenged among us.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 16:38:32 -07:00
Jakub Narebski 300454feab gitweb: Do not esc_html $basedir argument to git_print_tree_entry
In git_tree, rename $base variable (which is passed as $basedir
argument to git_print_tree_entry) to $basedir. Do not esc_html
$basedir, as it is part of file_name ('f') argument in link and not
printed. Add '/' at the end only if $basedir is not empty (it is empty
for top directory) and doesn't end in '/' already.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 13:24:37 -07:00
Jakub Narebski e7fb022a42 gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)
Code should be aligned the same way, regardless of tab size.
Use tabs for indent, but spaces for align.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 12:56:41 -07:00
Lars Hjemli 5ea0921cbe Fix usagestring for git-branch
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 12:26:21 -07:00
Rene Scharfe fc61e313da git-merge: show usage if run without arguments
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 12:15:55 -07:00
Nicolas Pitre 2d477051ef add the capability for index-pack to read from a stream
This patch only adds the streaming capability to index-pack.  Although
the code is different it has the exact same functionality as before to
make sure nothing broke.

This is in preparation for receiving packs over the net, parse them on
the fly, fix them up if they are "thin" packs, and keep the resulting
pack instead of exploding it into loose objects.  But such functionality
should come separately.

One immediate advantage of this patch is that index-pack can now deal
with packs up to 4GB in size even on 32-bit architectures since the pack
is not entirely mmap()'d all at once anymore.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 16:51:46 -07:00
Dmitry V. Levin 87b787ac77 git-clone: define die() and use it.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 16:51:15 -07:00
Junio C Hamano 7a6a5e4062 Merge branch 'maint'
* maint:
  Fix typo in show-index.c
  pager: default to LESS=FRS
2006-10-20 16:51:05 -07:00
Lars Hjemli 0b92f1a9d2 Fix typo in show-index.c
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 16:50:36 -07:00
Junio C Hamano 96a035d1db pager: default to LESS=FRS
Recent change to paginate "git diff" by default is often irritating
when you do not have any change (or very small change) in your working
tree.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 16:37:49 -07:00
Junio C Hamano e19343ad54 Merge branch 'maint'
* maint:
  git-apply: prepare for upcoming GNU diff -u format change.
2006-10-19 21:28:12 -07:00
Linus Torvalds b507b465f7 git-apply: prepare for upcoming GNU diff -u format change.
The latest GNU diff from CVS emits an empty line to express
an empty context line, instead of more traditional "single
white space followed by a newline".  Do not get broken by it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-19 21:28:06 -07:00
Jim Meyering 7768e27e1d Don't use $author_name undefined when $from contains no /\s</.
I noticed a case not handled in a recent patch.
Demonstrate it like this:

  $ touch new-file
  $ git-send-email --dry-run --from j --to k new-file 2>err
  new-file
  OK. Log says:
  Date: Thu, 19 Oct 2006 10:26:24 +0200
  Sendmail: /usr/sbin/sendmail
  From: j
  Subject:
  Cc:
  To: k

  Result: OK
  $ cat err
  Use of uninitialized value in pattern match (m//) at /p/bin/git-send-email line 416.
  Use of uninitialized value in concatenation (.) or string at /p/bin/git-send-email line 420.
  Use of uninitialized value in concatenation (.) or string at /p/bin/git-send-email line 468.

There's a patch for the $author_name part below.

The example above shows that $subject may also be used uninitialized.
That should be easy to fix, too.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-19 01:49:26 -07:00
Junio C Hamano 72bbc38b0a Merge branch 'mw/pathinfo'
* mw/pathinfo:
  gitweb: Fix search form when PATH_INFO is enabled
  gitweb: Document features better
  gitweb: warn if feature cannot be overridden.
  gitweb: start to generate PATH_INFO URLs.

Conflicts:

	gitweb/README
2006-10-18 22:09:11 -07:00
Junio C Hamano 65606f3530 Merge branch 'js/diff'
* js/diff:
  Turn on recursive with --summary
2006-10-18 22:09:03 -07:00
Junio C Hamano 2dcd3ce8d3 Merge branch 'jc/send-email'
* jc/send-email:
  Make git-send-email detect mbox-style patches more readily
  git-send-email: real name with period need to be dq-quoted on From: line
  git-send-email: do not drop custom headers the user prepared
2006-10-18 22:09:00 -07:00
Junio C Hamano 9100c9dce1 Merge branch 'jc/grep'
* jc/grep:
  teach revision walker about --all-match.
  grep --all-match
2006-10-18 22:08:58 -07:00
Junio C Hamano 17250ac172 Merge early part of branch 'jc/diff-apply-patch' 2006-10-18 22:08:46 -07:00
Junio C Hamano f73a5e8976 Merge branch 'jc/diff-numstat'
* jc/diff-numstat:
  diff --numstat
2006-10-18 22:08:42 -07:00
Junio C Hamano 8719f93b56 Merge branch 'pb/bisect'
* pb/bisect:
  bisect reset: Leave the tree in usable state if git-checkout failed
2006-10-18 22:08:39 -07:00
Junio C Hamano 32788ad6f8 Merge branch 'mw/send-email'
* mw/send-email:
  Add --dry-run option to git-send-email
2006-10-18 22:08:37 -07:00
Junio C Hamano a420585f38 Merge branch 'rs/rebase'
* rs/rebase:
  git-rebase: Add a -v option to show a diffstat of the changes upstream at the start of a rebase.
  git-rebase: Use --ignore-if-in-upstream option when executing git-format-patch.
2006-10-18 22:08:31 -07:00
Junio C Hamano a4c6ae5a76 Merge branch 'sb/fetch'
* sb/fetch:
  merge and resolve: Output short hashes and .. in "Updating ..."
  fetch: Misc output cleanup
2006-10-18 22:08:29 -07:00
Junio C Hamano 170487fbc3 Merge branch 'sk/svn'
* sk/svn:
  git-svnimport.perl: copying directory from original SVN place
2006-10-18 22:08:26 -07:00
Junio C Hamano 6847e56c9e Merge branch 'rs/zip'
* rs/zip:
  git-archive --format=zip: add symlink support
  git-archive --format=zip: use default version ID
2006-10-18 22:08:24 -07:00
pclouds@gmail.com 6b09c7883f Add revspec documentation for ':path', ':[0-3]:path' and git-describe
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-18 21:43:30 -07:00
pclouds@gmail.com 8a83157e04 Reject hexstring longer than 40-bytes in get_short_sha1()
Such a string can never be a valid object name.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-18 21:21:50 -07:00
Nicolas Pitre 1a3b55c6b4 reduce delta head inflated size
Supposing that both the base and result sizes were both full size 64-bit
values, their encoding would occupy only 9.2 bytes each.  Therefore
inflating 64 bytes is way overkill.  Limit it to 20 bytes instead which
should be plenty enough for a couple years to come.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-18 21:18:42 -07:00
Nicolas Pitre 3c552873c6 index-pack: compare only the first 20-bytes of the key.
The "union delta_base" is a strange beast.  It is a 20-byte
binary blob key to search a binary searchable deltas[] array,
each element of which uses it to represent its base object with
either a full 20-byte SHA-1 or an offset in the pack.  Which
representation is used is determined by another field of the
deltas[] array element, obj->type, so there is no room for
confusion, as long as we make sure we compare the keys for the
same type only with appropriate length.  The code compared the
full union with memcmp().

When storing the in-pack offset, the union was first cleared
before storing an unsigned long, so comparison worked fine.

On 64-bit architectures, however, the union typically is 24-byte
long; the code did not clear the remaining 4-byte alignment
padding when storing a full 20-byte SHA-1 representation.  Using
memcmp() to compare the whole union was wrong.

This fixes the comparison to look at the first 20-bytes of the
union, regardless of the architecture.  As long as ulong is
smaller than 20-bytes this works fine.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-18 10:07:49 -07:00