Commit Graph

6532 Commits

Author SHA1 Message Date
Shawn Pearce
8815788e93 Allow '(no author)' in git-svn's authors file.
When trying to import an SVN revision which has no author the Git
user may desire to relabel '(no author)' to another name and email
address with their svn.authorsfile.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 20:19:28 -07:00
Shawn Pearce
f7bae37f9a Allow 'svn fetch' on '(no date)' revisions in Subversion.
Added --ignore-nodate to allow 'git svn fetch' to import revisions
from Subversion which have '(no date)' listed as the date of the
revision.  By default 'git svn fetch' will crash with an error
when encountering such a revision.  The user may restart the fetch
operation by adding --ignore-nodate if they want to continue tracking
that repository.

I'm not entirely sure why a centralized version control system such
as Subversion permits revisions to be created with absolutely no
date/time associated with it but it apparently is possible as one
of the Subversion repositories that I'm tracking with 'git svn'
created such a revision on '(no date)' and by '(no user)'.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 20:19:22 -07:00
Jeff King
d0b353b1a7 git-repack: allow git-repack to run in subdirectory
Now that we explicitly create all tmpfiles below $GIT_DIR, there's no reason
to care about which directory we're in.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 20:16:23 -07:00
Junio C Hamano
2f60e4e9c1 Merge branch 'sk/svnimport'
* sk/svnimport:
  git-svnimport: Parse log message for Signed-off-by: lines
2006-09-24 20:00:59 -07:00
Junio C Hamano
d1cb7ac49b Merge early parts of branch 'np/pack' 2006-09-24 19:58:30 -07:00
Junio C Hamano
fd88d9c81e Remove upload-tar and make git-tar-tree a thin wrapper to git-archive
The command now issues a big deprecation warning message and runs
git-archive command with appropriate arguments.

git-tar-tree $tree_ish $base always forces $base to be the leading
directory name, so the --prefix parameter passed internally to
git-archive is a slash appended to it, i.e. "--prefix=$base/".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 19:55:08 -07:00
Rene Scharfe
3d74982f0b git-tar-tree: Move code for git-archive --format=tar to archive-tar.c
This patch doesn't change any functionality, it only moves code around.  It
makes seeing the few remaining lines of git-tar-tree code easier. ;-)

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 19:55:08 -07:00
Rene Scharfe
81b84c42d6 git-tar-tree: Remove duplicate git_config() call
generate_tar() eventually calls write_tar_archive() which does all the
"real" work and which also calls git_config(git_tar_config).  We only
need to do this once.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 19:55:07 -07:00
Junio C Hamano
b0ed9eafb3 Merge branch 'jc/filter-commit'
* jc/filter-commit:
  git log: Unify header_filter and message_filter into one.
  Update grep internal for grepping only in head/body
  git-log --author and --committer are not left-anchored by default
  rev-list: fix segfault with --{author,committer,grep}
  revision traversal: --author, --committer, and --grep.
  revision traversal: prepare for commit log match.
  builtin-grep: make pieces of it available as library.
2006-09-24 19:53:52 -07:00
Junio C Hamano
700899b624 Merge branch 'sb/branch-attributes'
* sb/branch-attributes:
  Add test for the default merges in fetch.
  fetch: get the remote branches to merge from the branch properties
  Add t5510 to test per branch configuration affecting git-fetch.
  Fetch: default remote repository from branch properties
2006-09-24 19:20:26 -07:00
Junio C Hamano
043c04107c Merge branch 'jl/daemon'
* jl/daemon:
  Add virtualization support to git-daemon
2006-09-24 16:58:34 -07:00
Santi Béjar
6cc7c36d5e Add test for the default merges in fetch.
[jc: with minor fix-ups]

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 02:00:21 -07:00
Santi Béjar
5372806a84 fetch: get the remote branches to merge from the branch properties
If in branch "foo" and this in config:

[branch "foo"]
      merge=bar

"git fetch": fetch from the default repository and program the "bar"
             branch to be merged with pull.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 00:13:49 -07:00
Junio C Hamano
7be1d62c6f Add t5510 to test per branch configuration affecting git-fetch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 00:13:49 -07:00
Santi Béjar
648ad18f50 Fetch: default remote repository from branch properties
If in branch "foo" and this in config:

[branch "foo"]
       remote=bar

"git fetch" = "git fetch bar"
"git  pull" = "git pull  bar"

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 00:13:49 -07:00
Junio C Hamano
d0c25035df git-apply: second war on whitespace.
This makes --whitespace={warn,error,strip} option to also notice
the leading whitespace errors in addition to the trailing
whitespace errors.  Spaces that are followed by a tab in indent
are detected as errors, and --whitespace=strip option fixes them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 00:12:44 -07:00
Junio C Hamano
448c3ef144 diff.c: second war on whitespace.
This adds DIFF_WHITESPACE color class (default = reverse red) to
colored diff output to let you catch common whitespace errors.

 - trailing whitespaces at the end of line
 - a space followed by a tab in the indent

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 00:12:44 -07:00
Randal L. Schwartz
ed1795fcc5 builtin-upload-archive.c broken on openbsd
Looks like ctype again. Gotta be careful with that on BSD releases:

    $ gmake prefix=/opt/git all
    GIT_VERSION = 1.4.2.GIT
    gcc -o builtin-upload-archive.o -c -g -O2 -Wall -I/usr/local/include -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRCASESTR builtin-upload-archive.c
    In file included from /usr/include/sys/poll.h:54,
                     from builtin-upload-archive.c:11:
    /usr/include/ctype.h:68: error: syntax error before ']' token
    /usr/include/ctype.h:69: error: syntax error before ']' token
    ...
    /usr/include/sys/poll.h:53:1: unterminated #ifndef
    /usr/include/sys/poll.h:28:1: unterminated #ifndef
    gmake: *** [builtin-upload-archive.o] Error 1

This fixes it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 00:00:47 -07:00
Petr Baudis
a2f3db2f5d gitweb: Consolidate escaping/validation of query string
Consider:

	http://repo.or.cz/?p=glibc-cvs.git;a=tree;h=2609cb0411389325f4ee2854cc7159756eb0671e;hb=2609cb0411389325f4ee2854cc7159756eb0671e

(click on the funny =__ify file)

We ought to handle anything in filenames and I actually see no reason why
we don't, modulo very little missing escaping that this patch hopefully
also fixes.

I have also made esc_param() escape [?=&;]. Not escaping [&;] was downright
buggy and [?=] just feels better escaped. ;-) YMMV.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-23 23:53:18 -07:00
Petr Baudis
8f41db8c37 Deprecate git-resolve.sh
Seriously, is anyone still using this thing? It's collecting dust and
blocking the name for something potentially useful like a tool for
user-friendly marking of resolved conflicts or resolving index conflicts.

We've loved you when Git was young, now thank you and please go away. ;-)

This makes git-resolve.sh print a big deprecation warning and sleep a bit
for extra annoyance. It should be removed completely after the next release.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-23 23:52:53 -07:00
Petr Baudis
18b0fc1ce1 Git.pm: Kill Git.xs for now
This patch removes Git.xs from the repository for the time being. This
should hopefully enable Git.pm to finally make its way to master.

Git.xs is not going away forever. When the Git libification makes some
progress, it will hopefully return (but most likely as an optional
component, due to the portability woes) since the performance boosts are
really important for applications like Gitweb or Cogito. It needs to go
away now since it is not really reliable in case you use it for several
repositories in the scope of a single process, and that is not possible
to fix without some either very ugly or very intrusive core changes.

Rest in peace. (While you can.)

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-23 14:02:40 -07:00
Rene Scharfe
3fc8284e21 Rename builtin-zip-tree.c to archive-zip.c
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-23 14:00:32 -07:00
Rene Scharfe
31756c5da8 Remove git-zip-tree
git-zip-tree can be safely removed because it was never part of a formal
release.  This patch makes 'git-archive --format=zip' the one and only git
ZIP file creation command.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-23 14:00:27 -07:00
Nicolas Pitre
43057304c0 many cleanups to sha1_file.c
Those cleanups are mainly to set the table for the support of deltas
with base objects referenced by offsets instead of sha1.  This means
that many pack lookup functions are converted to take a pack/offset
tuple instead of a sha1.

This eliminates many struct pack_entry usages since this structure
carried redundent information in many cases, and it increased stack
footprint needlessly for a couple recursively called functions that used
to declare a local copy of it for every recursion loop.

In the process, packed_object_info_detail() has been reorganized as well
so to look much saner and more amenable to deltas with offset support.

Finally the appropriate adjustments have been made to functions that
depend on the above changes.  But there is no functionality changes yet
simply some code refactoring at this point.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-23 01:51:33 -07:00
Junio C Hamano
5fd6f5cffc lock_ref_sha1_basic: remove unused parameter "plen".
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 21:41:49 -07:00
Junio C Hamano
6d15987c1e pack-refs: fix git_path() usage.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 21:31:40 -07:00
Nicolas Pitre
16854571aa move pack creation to version 3
It's been quite a while now that GIT is able to read version 3 packs.
Let's create them at last.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 19:24:52 -07:00
Sasha Khapyorsky
ae35b30433 git-svnimport: Parse log message for Signed-off-by: lines
This add '-S' option. When specified svn-import will try to parse
commit message for 'Signed-off-by: ...' line, and if found will use
the name and email address extracted at first occurrence as this commit
author name and author email address. Committer name and email are
extracted in usual way.

Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 19:24:12 -07:00
Robin Rosenberg
3d5c0cc938 Quote arguments to tr in test-lib
When there are single-character filenames in the test directory,
the shell tries to expand regexps meant for tr.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 17:00:36 -07:00
Petr Baudis
5c7d2cf3d6 Fix snapshot link in tree view
It would just give HEAD snapshot instead of one of the particular tree.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 16:59:22 -07:00
Petr Baudis
74d6166751 gitweb: Fix @git_base_url_list usage
As it is now, that array was never used because the customurl accessor was
broken and ''unless @url_list'' never happenned.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 16:59:04 -07:00
Petr Baudis
d726720743 gitweb: Fix tree link associated with each commit log entry.
The link forgot to have hb parameter and the resulting tree view
failed to show the navbar for that commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 16:58:51 -07:00
Petr Baudis
7c1a278d99 Fix buggy ref recording
There is a format string vulnerability introduced with the packed refs
file format.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 16:53:31 -07:00
Petr Baudis
26d0a976e8 Make path in tree view look nicer
Based on talk on the IRC with Junio some evenings ago, I've updated the
path showing in tree view to look better and sent updated patches
privately, but it seems the old version ended up being used, so here's
the new one again.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22 16:49:36 -07:00
Petr Baudis
f35274dad8 gitweb: Relabel "head" as "HEAD"
"head" is a reference in refs/heads/, while those labels mean HEAD,
the latest revision of the default branch.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 21:21:04 -07:00
Petr Baudis
35329cc1cc gitweb: Rename "plain" labels to "raw"
I don't have much preference either way and as far as I'm concerned, it may
go the other way as well. Consistency is what is important.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 21:18:26 -07:00
Petr Baudis
6ef4cb2e8d gitweb: Link to associated tree from a particular log item in full log view
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 21:01:28 -07:00
Petr Baudis
1d62be25ed gitweb: Link to latest tree from the head line in heads list
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 21:00:51 -07:00
Petr Baudis
35749ae566 gitweb: Link to tree instead of snapshot in shortlog
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 20:58:50 -07:00
Petr Baudis
cae1862a3b gitweb: More per-view navigation bar links
Navigation bars in various views were empty or missed important items that
should have been there, e.g. getting a snapshot in tree view or log of
ancestry in commit view...

This feeble patch attempts to consolidate that.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 20:57:43 -07:00
Petr Baudis
609ff267fb gitweb: Link (HEAD) tree for each project from projects list
Current projects list is oriented on easily getting "what's new"
information. But when already using gitweb as an interface to something,
I personally find myself to _much_ more frequently wanting to rather
see "what's in" (or "what's new in") and it's quite annoying to have to
go through the summary page (which is also rather expensive to generate)
just to get there.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 20:56:33 -07:00
Johannes Schindelin
afdcec7366 show-branch: mark active branch with a '*' again
This was lost in the packed-ref updates. The original test was a bit
dubious, so I cleaned that up, too. It fixes the case when the current HEAD
is refs/heads/bla/master: the original test was true for both bla/master
_and_ master.

However, it shares a hard-to-fix bug with the original test: if the current
HEAD is refs/heads/master, and there is a branch refs/heads/heads/master,
then both are marked active.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 20:54:43 -07:00
Johannes Schindelin
913c983e04 Fix git-update-index --again
It called read_ref(git_path(..)..), where read_ref does the git_path()
stuff itself.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 20:54:41 -07:00
Jakub Narebski
1d782b03b0 gitweb: Make git_get_hash_by_path check type if provided
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 12:55:51 -07:00
Andy Whitcroft
1729fa9878 git-for-each-ref: improve the documentation on scripting modes
When reading the synopsis for git-for-each-ref it is easy to miss
the obvious power of --shell and family.  Call this feature out in
the primary paragragh.  Also add more description to the examples
to indicate which features we are demonstrating.  Finally add a
very simple eval based example in addition to the very complex one
to give a gentler introduction.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 12:38:38 -07:00
Petr Baudis
16fdb4882e Fix showing of path in tree view
This patch fixes two things - links to all path elements except the last
one were broken since gitweb does not like the trailing slash in them, and
the root tree was not reachable from the subdirectory view.

To compensate for the one more slash in the front, the trailing slash is
not there anymore. ;-) I don't care if it stays there though.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 01:16:45 -07:00
Martin Waitz
053d62bb5b gitweb: fix display of trees via PATH_INFO.
When adding a / to the URL, git should display the corresponding
tree object, but it has to remove the / first.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 01:15:23 -07:00
Junio C Hamano
eaf12a8c7d Merge branch 'lt/refs' into jc/lt-ref2-with-lt-refs
* lt/refs: (58 commits)
  git-pack-refs --prune
  pack-refs: do not pack symbolic refs.
  Tell between packed, unpacked and symbolic refs.
  Add callback data to for_each_ref() family.
  symbolit-ref: fix resolve_ref conversion.
  Fix broken sha1 locking
  fsck-objects: adjust to resolve_ref() clean-up.
  gitignore: git-pack-refs is a generated file.
  wt-status: use simplified resolve_ref to find current branch
  Fix t1400-update-ref test minimally
  Enable the packed refs file format
  Make ref resolution saner
  Add support for negative refs
  Start handling references internally as a sorted in-memory list
  gitweb fix validating pg (page) parameter
  git-repack(1): document --window and --depth
  git-apply(1): document --unidiff-zero
  gitweb: fix warnings in PATH_INFO code and add export_ok/strict_export
  upload-archive: monitor child communication even more carefully.
  gitweb: export options
  ...
2006-09-21 00:40:28 -07:00
Junio C Hamano
340adb8bcc Merge branch 'lt/refs' into jc/for-each-ref-with-lt-refs
* lt/refs: (58 commits)
  git-pack-refs --prune
  pack-refs: do not pack symbolic refs.
  Tell between packed, unpacked and symbolic refs.
  Add callback data to for_each_ref() family.
  symbolit-ref: fix resolve_ref conversion.
  Fix broken sha1 locking
  fsck-objects: adjust to resolve_ref() clean-up.
  gitignore: git-pack-refs is a generated file.
  wt-status: use simplified resolve_ref to find current branch
  Fix t1400-update-ref test minimally
  Enable the packed refs file format
  Make ref resolution saner
  Add support for negative refs
  Start handling references internally as a sorted in-memory list
  gitweb fix validating pg (page) parameter
  git-repack(1): document --window and --depth
  git-apply(1): document --unidiff-zero
  gitweb: fix warnings in PATH_INFO code and add export_ok/strict_export
  upload-archive: monitor child communication even more carefully.
  gitweb: export options
  ...
2006-09-21 00:29:37 -07:00
Junio C Hamano
9688460152 git-pack-refs --prune
"git pack-refs --prune", after successfully packing the existing
refs, removes the loose ref files.  It tries to protect against
race by doing the usual lock_ref_sha1() which makes sure the
contents of the ref has not changed since we last looked at.

Also we do not bother trying to prune what was already packed, and
we do not try pruning symbolic refs.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21 00:06:54 -07:00