Commit graph

6928 commits

Author SHA1 Message Date
Tuncer Ayaz ddaf73141c git-fetch.sh printed protocol fix
We have supported https:// protocol for some time and in 1.4.3
added ftp:// protocol.  The transfer were still reported to be
over http.

[jc: Tuncer used substring parameter substitution ${remote%%:*}
 but I am deferring it to a later day.  We should replace
 colon-expr with substring substitution after everybody's shell
 can grok it someday, but we are not in a hurry. ]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-25 11:26:48 -07:00
Junio C Hamano a4e3bddc76 RPM package re-classification.
Grabbing anything that had *arch* in its name into git-arch
package was a wrong idea and we lost git-archive from git-core
by mistake.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-25 00:58:33 -07:00
Jakub Narebski 8256098399 gitweb: Print commit message without title in commitdiff only if there is any
Print the rest of commit message (title, i.e. first line of commit
message, is printed separately) only if there is any.

In repository which uses signoffs this shouldn't happen, because
commit message should consist of at least title and signoff.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-24 21:36:42 -07:00
Jakub Narebski 62fae51dd5 gitweb: Filter out commit ID from @difftree in git_commit and git_commitdiff
Filter out commit ID output that git-diff-tree adds when called with
only one <tree-ish> (not only for --stdin) in git_commit and
git_commitdiff.

This also works with older git versions, which doesn't have
--no-commit-id option to git-diff-tree.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-24 21:23:41 -07:00
Jakub Narebski f2069411c9 gitweb: Get rid of git_print_simplified_log
Replace calls to git_print_simplified_log with its expansion,
i.e. with calling git_print_log with appropriate options.

Remove no longer used git_print_simplified_log subroutine.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-24 21:16:44 -07:00
Junio C Hamano 04d24455ce Documentation: note about contrib/.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-24 15:16:38 -07:00
Eric Wong 9ffd652a38 git-svn: fix symlink-to-file changes when using command-line svn 1.4.0
I incorrectly thought this was hopelessly broken in svn 1.4.0,
but now it's just broken in that the old method didn't work.  It
looks like svn propdel and svn propset must be used now and the
(imho) more obvious svn rm --force && svn add no longer works.

"make -C t full-svn-test" should now work.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Acked-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-24 15:15:51 -07:00
Gerrit Pape 2eb10ac7b5 Set $HOME for selftests
Set HOME environment variable to test trash directory and export for
selftests.  This fixes the git-svn selftests with nonexistent or not
readable home, as found in at least one automated build system:

 http://buildd.debian.org/fetch.cgi?&pkg=git-core&ver=1%3A1.4.2.3-2&arch=alpha&stamp=1161537466&file=log

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-24 14:38:46 -07:00
Junio C Hamano 5d9e8ee78b t3200: git-branch testsuite update
The test expected "git branch --help" to exit successfully, but
built-ins spawn "man" when given --help, and when the test is
run, manpages may not be installed yet and "man" can legally
exit non-zero in such a case.

Also the new implementation logs "Created from master", instead
of "Created from HEAD" in the reflog, which makes a lot more
sense, so adjust the test to match that.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 22:48:45 -07:00
Junio C Hamano 694500edbd sha1_name.c: avoid compilation warnings.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 21:15:34 -07:00
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
Lars Hjemli c31820c26b Make git-branch a builtin
This replaces git-branch.sh with builtin-branch.c

The changes is basically a patch from Kristian Hgsberg, updated
to apply onto current 'next'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:43:49 -07:00
Rene Scharfe e827633a5d Built-in cherry
This replaces the shell script git-cherry with a version written in C.

The behaviour of the new version differs from the original in two
points: it has no long help any more, and it is handling the (optional)
third parameter a bit differently.  Basically, it does the equivalent
of

   ours=`git-rev-list $ours ^$limit ^$upstream`

instead of

   ours=`git-rev-list $ours ^$limit`

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:25:32 -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
Junio C Hamano aec8fa1f58 git-pickaxe: swap comparison loop used for -C
When assigning blames for code movements across file boundaries,
we used to iterate over blame entries (i.e. groups of lines to
be blamed) in the outer loop and compared each entry with paths
in the parent commit in an inner loop.  This meant that we
opened the blob data from each path number of times.

Reorganize the loop so that we read the same path only once, and
compare it against all relevant blame entries.

This should perform better, but seems to give mixed results,
though.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-21 03:30:53 -07:00
Junio C Hamano f6c0e19102 git-pickaxe: get rid of wasteful find_origin().
After finding out which path in the parent to scan to pass
blames, using get_tree_entry() to extract the blob information
again was quite wasteful, since diff-tree already gave us that
information.  Separate the function to create an origin out as
get_origin().

You'll never know what is more efficient unless you try and/or
think hard.  I somehow thought that extracting one known path
out of commit's tree is cheaper than running a diff-tree for the
current path between the commit and its parent, but it is not
the case.  In real, non-toy projects, most commits do not touch
the path you are interested in, and if the path is a few levels
away from the toplevel, whole-subdirectory comparison logic
diff-tree allows us to skip opening lower subdirectories.

This commit rewrites find_origin() function to use a single-path
diff-tree to see if the parent has the same blob as the current
suspect, which is cheaper than extracting the blob information
using get_tree_entry() and comparing it with what the current
suspect has.  This shaves about 6% overhead when annotating
kernel/sched.c in the Linux kernel repository on my machine.
The saving rises to 25% for arch/i386/kernel/Makefile.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-21 02:56:33 -07:00
Junio C Hamano 46014766bd git-pickaxe: do not confuse two origins that are the same.
It used to be that we can compare the address of the origin
structure to determine if they are the same because they are
always registered with scoreboard.  After introduction of the
loop to try finding the best split, that is not true anymore.

The current code has rather serious leaks with origin structure,
but more importantly it gets confused when two origins that
points at the same commit and same path.

We might eventually have to refcount and gc origin, but let's
fix the correctness issue first.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-21 00:41:38 -07:00
Junio C Hamano 612702e8ea git-pickaxe: do not keep commit buffer.
We need the commit buffer data while generating the final result,
but until then we do not need them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 23:49:41 -07:00
Junio C Hamano 4a0fc95f18 git-pickaxe: introduce heuristics to avoid "trivial" chunks
This adds scoring logic to blame_entry to prevent blames on very
trivial chunks (e.g. lots of empty lines, indent followed by a
closing brace) from being passed down to unrelated lines in the
parent.

The current heuristics are quite simple and may need to be
tweaked later, but we need to start somewhere.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 18:48:23 -07:00
Junio C Hamano 5ff62c3002 git-pickaxe: improve "best match" heuristics
Instead of comparing number of lines matched, look at the
matched characters and count alnums, so that we do not pass
blame on not-so-interesting lines, such as an empty line and
a line that is indentation followed by a closing brace.

Add an option --score-debug to show the score of each
blame_entry while we cook this further on the "next" branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 18:48:23 -07:00
Junio C Hamano 1ca6ca876e git-pickaxe: fix nth_line()
We would want to be able to refer to the end of the file as
"the beginning of Nth line" for a file that is N lines long.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 18:48:18 -07:00
Junio C Hamano 1617baa587 git-pickaxe: pagenate output by default.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20 18:37:10 -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