Hi all,
Here are my patches to extend Wim's extension. I'm only including in this
bundle those of his that my patches depend on, but you also need at least
some of the others, including Juliusz' patch, to make this actually work.
When included with those, one now can just stick a git directory (or a
symlink to one) in the darcs source and configure --enable-git. I've
verified that darcs changes works with the git repository.
Alas, darcs changes --summary is horribly slow, due to the cost of merging.
Unless we come up with some other trick, we *really* will want to look into
faster commutation tricks (e.g. sorting patches according to what files
they modify, so a commute is cheaper than O(N*M) where N and M are the
number of primitive patches in each of the two patches being commuted.
This is definitely both possible and practical, but there hasn't been a
compelling need to implement the code to do so, which might get a bit
ugly.
I'll be applying this stuff directly to darcs-stable. My current policy is
that git stuff that can't mess up non-git code goes quickly into
darcs-stable (since git isn't ready for prime time anyways, may as well
provide as nice support as possible). Also, build changes go there more
quickly than code changes, since build stuff doesn't get much tested in
darcs-unstable anyways.
David.
Sun Jul 31 01:02:59 EDT 2005 Wim Lewis <[EMAIL PROTECTED]>
* Do autoconf substitution on git.h
Sun Jul 31 01:03:41 EDT 2005 Wim Lewis <[EMAIL PROTECTED]>
* Autoconf support for linking against libgit.a
Allow (actually, require) the user to specify the location of the Git
implementation when including Git support. Attempt to discover whether
Git was compiled to require OpenSSL's implementation of SHA1.
Sun Jul 31 06:56:56 EDT 2005 David Roundy <[EMAIL PROTECTED]>
* remove the now-unneeded git/.
Sun Jul 31 07:27:40 EDT 2005 David Roundy <[EMAIL PROTECTED]>
* check for a git/ in current directory (when --enable-git).
New patches:
[Do autoconf substitution on git.h
Wim Lewis <[EMAIL PROTECTED]>**20050731050259]
<
> {
move ./git.h ./git.h.in
hunk ./configure.ac 456
dnl Write results
OUTPUT_WORKAROUND
-AC_OUTPUT([autoconf.mk Autoconf.lhs ThisVersion.lhs
+AC_OUTPUT([autoconf.mk git.h Autoconf.lhs ThisVersion.lhs
cgi/darcs.cgi cgi/README cgi/cgi.conf])
cat <<[EOF]
}
[Autoconf support for linking against libgit.a
Wim Lewis <[EMAIL PROTECTED]>**20050731050341
Allow (actually, require) the user to specify the location of the Git
implementation when including Git support. Attempt to discover whether
Git was compiled to require OpenSSL's implementation of SHA1.
]
<
[cosmetic changes
Peter Simons <[EMAIL PROTECTED]>**20050719135834]
[Include autoconf-detected libs in LDFLAGS
Joshua J. Berry <[EMAIL PROTECTED]>**20050728031609
Autoconf uses @LIBS@ -- not @LDFLAGS@ -- for libraries it detects (e.g. using
AC_SEARCH_LIBS).
]
[Do autoconf substitution on git.h
Wim Lewis <[EMAIL PROTECTED]>**20050731050259]
> {
hunk ./autoconf.mk.in 39
GIT_SRCS := @GIT_SRCS@
GIT_C_OBJS := @GIT_C_OBJS@
+GHCFLAGS_Git.o = $(GHCFLAGS) @GIT_GHC_FLAGS@
all : config @TARGETS@
hunk ./autoconf.mk.in 60
Context.hs: stringify
test -f \$@ || echo unknown | ./stringify Context context > \$@
endif
+
+# Weird and wonderful GNU Make "target-specific variable" syntax
+ifneq (,'@GIT_C_OBJS@')
+$(GIT_C_OBJS) : OPTCCFLAGS+= @GIT_GHC_FLAGS@
+endif
darcs-stable.tar.gz: dist
ln -sf "darcs-$(DARCS_VERSION).tar.gz" $@
hunk ./configure.ac 399
[AC_MSG_WARN([Cannot find term.h, disabling color.])]
)
fi
-
AC_SUBST(HAVE_CURSES)
dnl look for zlib library and header.
hunk ./configure.ac 413
])
])
-dnl Check for libssl
-
-HAVE_LIBSSL=False
-AC_CHECK_HEADER(openssl/sha.h,
- [AC_SEARCH_LIBS(SHA1_Init, crypto ssl, [HAVE_LIBSSL=True])])
dnl Check whether Git support was requested
hunk ./configure.ac 423
AC_MSG_RESULT($git)
if test "$git" = yes; then
+ AC_ARG_WITH(git-core, AS_HELP_STRING([--with-git-core=path],
+ [path to Git-core source directory]),[
+ GIT_LDFLAGS="-L$withval"
+ GIT_CPPFLAGS="-I$withval"
+ if test -d "$withval" -a -r "$withval/cache.h" ; then true; else
+ AC_MSG_WARN([`$withval' does not look like git-core directory!])
+ fi])
+ AC_ARG_WITH(git-includes, AS_HELP_STRING([--with-git-includes=-Ipath],
+ [extra CPP options needed to use Git headers]),
+ [GIT_CPPFLAGS="$withval $GIT_CPPFLAGS"])
+
+ for shatype in none fake openssl ; do
+ case $shatype in
+ none)
+ SHA_HEADER_DEFINE=
+ try=true
+ ;;
+ fake)
+ SHA_HEADER_DEFINE='#define SHA1_HEADER <stdio.h>'
+ try=true
+ ;;
+ openssl)
+ try=false
+ AC_CHECK_HEADER(openssl/sha.h,
+ [SHA_HEADER_DEFINE='#define SHA1_HEADER <openssl/sha.h>'
+ AC_SEARCH_LIBS(SHA1_Init, crypto ssl, [try=true])])
+ ;;
+ esac
+ LIBS_save="$LIBS"
+ CPPFLAGS_save="$CPPFLAGS"
+ LDFLAGS_save="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $GIT_CPPFLAGS"
+ LIBS="-lgit $LIBS"
+ LDFLAGS="$GIT_LDFLAGS $LDFLAGS"
+ if $try ; then
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+$SHA_HEADER_DEFINE
+#include "cache.h"]],
+ [[int j = read_cache();
+ j = j + write_sha1_file(NULL, 0, NULL, NULL);
+ ]])],,[try=false])
+ fi
+ CPPFLAGS="$CPPFLAGS_save"
+ if $try ; then
+ AC_MSG_NOTICE([Using Git SHA1 type: $shatype])
+ break
+ else
+ LDFLAGS="$LDFLAGS_save"
+ LIBS="$LIBS_save"
+ fi
+ done
+
+ if $try ; then
+ git=yes
+ else
+ git=no
+ AC_MSG_FAILURE([Unable to link against git library.])
+ fi
+fi
+
+GIT_GHC_FLAGS=
+if test "$git" = yes; then
GIT_SRCS="GitRepo.lhs Git.lhs"
GIT_C_OBJS="git.o"
GHCFLAGS="$GHCFLAGS -DENABLE_GIT"
hunk ./configure.ac 488
+ for gitflag in $GIT_CPPFLAGS ; do
+ case "$gitflag" in
+ -D*) GIT_GHC_FLAGS="$GIT_GHC_FLAGS '$gitflag'" ;;
+ *) GIT_GHC_FLAGS="$GIT_GHC_FLAGS '-optc$gitflag'" ;;
+ esac
+ done
else
GIT_SRCS="GitRepo.lhs"
GIT_C_OBJS=
hunk ./configure.ac 497
+ GIT_GHC_FLAGS=
fi
AC_SUBST(GIT_SRCS)
hunk ./configure.ac 502
AC_SUBST(GIT_C_OBJS)
+AC_SUBST(GIT_GHC_FLAGS)
+AC_SUBST(SHA_HEADER_DEFINE)
dnl Look for a suitable diff command
hunk ./configure.ac 536
libexecdir = $libexecdir
Build Manual = $BUILDDOC
+ Git support = $git
If you want to adjust any of these values, edit autoconf.mk and
Autoconf.lhs -- or run configure with appropriate settings.
hunk ./git.h.in 19
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "git/cache.h"
[EMAIL PROTECTED]@
hunk ./git.h.in 21
-void die(const char *err, ...);
+#include "cache.h"
struct git_file {
unsigned char *data;
}
[remove the now-unneeded git/.
David Roundy <[EMAIL PROTECTED]>**20050731105656]
<
> {
hunk ./git/Makefile 1
-# -DCOLLISION_CHECK if you believe that SHA1's
-# 1461501637330902918203684832716283019655932542976 hashes do not give you
-# enough guarantees about no collisions between objects ever hapenning.
-#
-# -DNSEC if you want git to care about sub-second file mtimes and ctimes.
-# Note that you need some new glibc (at least >2.2.4) for this, and it will
-# BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
-# break unless your underlying filesystem supports those sub-second times
-# (my ext3 doesn't).
-CFLAGS=-g -O2 -Wall
-
-CC=gcc
-AR=ar
-
-
-PROG= update-cache show-diff init-db write-tree read-tree commit-tree \
- cat-file fsck-cache checkout-cache diff-tree rev-tree show-files \
- check-files ls-tree merge-base merge-cache unpack-file git-export \
- diff-cache convert-cache
-
-all: $(PROG)
-
-install: $(PROG)
- install $(PROG) $(HOME)/bin/
-
-LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o
-LIB_FILE=libgit.a
-LIB_H=cache.h object.h
-
-$(LIB_FILE): $(LIB_OBJS)
- $(AR) rcs $@ $(LIB_OBJS)
-
-LIBS= $(LIB_FILE) -lssl -lz
-
-init-db: init-db.o
-
-fsck-cache: fsck-cache.o $(LIB_FILE) object.o commit.o tree.o blob.o
- $(CC) $(CFLAGS) -o fsck-cache fsck-cache.o $(LIBS)
-
-rev-tree: rev-tree.o $(LIB_FILE) object.o commit.o tree.o blob.o
- $(CC) $(CFLAGS) -o rev-tree rev-tree.o $(LIBS)
-
-merge-base: merge-base.o $(LIB_FILE) object.o commit.o tree.o blob.o
- $(CC) $(CFLAGS) -o merge-base merge-base.o $(LIBS)
-
-%: %.o $(LIB_FILE)
- $(CC) $(CFLAGS) -o $@ $< $(LIBS)
-
-blob.o: $(LIB_H)
-cat-file.o: $(LIB_H)
-check-files.o: $(LIB_H)
-checkout-cache.o: $(LIB_H)
-commit.o: $(LIB_H)
-commit-tree.o: $(LIB_H)
-convert-cache.o: $(LIB_H)
-diff-cache.o: $(LIB_H)
-diff-tree.o: $(LIB_H)
-fsck-cache.o: $(LIB_H)
-git-export.o: $(LIB_H)
-init-db.o: $(LIB_H)
-ls-tree.o: $(LIB_H)
-merge-base.o: $(LIB_H)
-merge-cache.o: $(LIB_H)
-object.o: $(LIB_H)
-read-cache.o: $(LIB_H)
-read-tree.o: $(LIB_H)
-rev-tree.o: $(LIB_H)
-sha1_file.o: $(LIB_H)
-show-diff.o: $(LIB_H)
-show-files.o: $(LIB_H)
-tree.o: $(LIB_H)
-update-cache.o: $(LIB_H)
-usage.o: $(LIB_H)
-unpack-file.o: $(LIB_H)
-write-tree.o: $(LIB_H)
-
-clean:
- rm -f *.o $(PROG) $(LIB_FILE)
-
-backup: clean
- cd .. ; tar czvf dircache.tar.gz dir-cache
rmfile ./git/Makefile
hunk ./git/cache.h 1
-/*
- * GIT - The information manager from hell
- *
- * Copyright (C) Linus Torvalds, 2005
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- */
-
-#ifndef CACHE_H
-#define CACHE_H
-
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/mman.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-
-#include <openssl/sha.h>
-#include <zlib.h>
-
-/*
- * Basic data structures for the directory cache
- *
- * NOTE NOTE NOTE! This is all in the native CPU byte format. It's
- * not even trying to be portable. It's trying to be efficient. It's
- * just a cache, after all.
- */
-
-#define CACHE_SIGNATURE 0x44495243 /* "DIRC" */
-struct cache_header {
- unsigned int hdr_signature;
- unsigned int hdr_version;
- unsigned int hdr_entries;
-};
-
-/*
- * The "cache_time" is just the low 32 bits of the
- * time. It doesn't matter if it overflows - we only
- * check it for equality in the 32 bits we save.
- */
-struct cache_time {
- unsigned int sec;
- unsigned int nsec;
-};
-
-/*
- * dev/ino/uid/gid/size are also just tracked to the low 32 bits
- * Again - this is just a (very strong in practice) heuristic that
- * the inode hasn't changed.
- *
- * We save the fields in big-endian order to allow using the
- * index file over NFS transparently.
- */
-struct cache_entry {
- struct cache_time ce_ctime;
- struct cache_time ce_mtime;
- unsigned int ce_dev;
- unsigned int ce_ino;
- unsigned int ce_mode;
- unsigned int ce_uid;
- unsigned int ce_gid;
- unsigned int ce_size;
- unsigned char sha1[20];
- unsigned short ce_flags;
- char name[0];
-};
-
-#define CE_NAMEMASK (0x0fff)
-#define CE_STAGEMASK (0x3000)
-#define CE_STAGESHIFT 12
-
-#define create_ce_flags(len, stage) htons((len) | ((stage) << CE_STAGESHIFT))
-#define ce_namelen(ce) (CE_NAMEMASK & ntohs((ce)->ce_flags))
-#define ce_size(ce) cache_entry_size(ce_namelen(ce))
-#define ce_stage(ce) ((CE_STAGEMASK & ntohs((ce)->ce_flags)) >> CE_STAGESHIFT)
-
-#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
-#define create_ce_mode(mode) htonl(S_IFREG | ce_permissions(mode))
-
-#define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)
-
-extern const char *sha1_file_directory;
-extern struct cache_entry **active_cache;
-extern unsigned int active_nr, active_alloc;
-
-#define DB_ENVIRONMENT "SHA1_FILE_DIRECTORY"
-#define DEFAULT_DB_ENVIRONMENT ".git/objects"
-
-#define get_object_directory() (getenv(DB_ENVIRONMENT) ? : DEFAULT_DB_ENVIRONMENT)
-
-#define INDEX_ENVIRONMENT "GIT_INDEX_FILE"
-#define DEFAULT_INDEX_ENVIRONMENT ".git/index"
-
-#define get_index_file() (getenv(INDEX_ENVIRONMENT) ? : DEFAULT_INDEX_ENVIRONMENT)
-
-#define alloc_nr(x) (((x)+16)*3/2)
-
-/* Initialize and use the cache information */
-extern int read_cache(void);
-extern int write_cache(int newfd, struct cache_entry **cache, int entries);
-extern int cache_name_pos(const char *name, int namelen);
-extern int add_cache_entry(struct cache_entry *ce, int ok_to_add);
-extern int remove_file_from_cache(char *path);
-extern int cache_match_stat(struct cache_entry *ce, struct stat *st);
-
-#define MTIME_CHANGED 0x0001
-#define CTIME_CHANGED 0x0002
-#define OWNER_CHANGED 0x0004
-#define MODE_CHANGED 0x0008
-#define INODE_CHANGED 0x0010
-#define DATA_CHANGED 0x0020
-
-/* Return a statically allocated filename matching the sha1 signature */
-extern char *sha1_file_name(const unsigned char *sha1);
-
-/* Write a memory buffer out to the sha file */
-extern int write_sha1_buffer(const unsigned char *sha1, void *buf, unsigned int size);
-
-/* Read and unpack a sha1 file into memory, write memory to a sha1 file */
-extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size);
-extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size);
-extern void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size);
-extern int write_sha1_file(char *buf, unsigned len, unsigned char *return_sha1);
-extern int check_sha1_signature(unsigned char *sha1, void *buf, unsigned long size, const char *type);
-
-/* Convert to/from hex/sha1 representation */
-extern int get_sha1_hex(const char *hex, unsigned char *sha1);
-extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */
-
-/* General helper functions */
-extern void usage(const char *err);
-extern void die(const char *err, ...);
-extern int error(const char *err, ...);
-
-extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2);
-
-extern void *read_tree_with_tree_or_commit_sha1(const unsigned char *sha1,
- unsigned long *size,
- unsigned char *tree_sha1_ret);
-
-#endif /* CACHE_H */
rmfile ./git/cache.h
hunk ./git/read-cache.c 1
-/*
- * GIT - The information manager from hell
- *
- * Copyright (C) Linus Torvalds, 2005
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- */
-
-#include <stdarg.h>
-#include "cache.h"
-
-struct cache_entry **active_cache = NULL;
-unsigned int active_nr = 0, active_alloc = 0;
-
-int cache_match_stat(struct cache_entry *ce, struct stat *st)
-{
- unsigned int changed = 0;
-
- if (ce->ce_mtime.sec != htonl(st->st_mtime))
- changed |= MTIME_CHANGED;
- if (ce->ce_ctime.sec != htonl(st->st_ctime))
- changed |= CTIME_CHANGED;
-
-#ifdef NSEC
- /*
- * nsec seems unreliable - not all filesystems support it, so
- * as long as it is in the inode cache you get right nsec
- * but after it gets flushed, you get zero nsec.
- */
- if (ce->ce_mtime.nsec != htonl(st->st_mtim.tv_nsec))
- changed |= MTIME_CHANGED;
- if (ce->ce_ctime.nsec != htonl(st->st_ctim.tv_nsec))
- changed |= CTIME_CHANGED;
-#endif
-
- if (ce->ce_uid != htonl(st->st_uid) ||
- ce->ce_gid != htonl(st->st_gid))
- changed |= OWNER_CHANGED;
- /* We consider only the owner x bit to be relevant for "mode changes" */
- if (0100 & (ntohl(ce->ce_mode) ^ st->st_mode))
- changed |= MODE_CHANGED;
- if (ce->ce_dev != htonl(st->st_dev) ||
- ce->ce_ino != htonl(st->st_ino))
- changed |= INODE_CHANGED;
- if (ce->ce_size != htonl(st->st_size))
- changed |= DATA_CHANGED;
- return changed;
-}
-
-int cache_name_compare(const char *name1, int flags1, const char *name2, int flags2)
-{
- int len1 = flags1 & CE_NAMEMASK;
- int len2 = flags2 & CE_NAMEMASK;
- int len = len1 < len2 ? len1 : len2;
- int cmp;
-
- cmp = memcmp(name1, name2, len);
- if (cmp)
- return cmp;
- if (len1 < len2)
- return -1;
- if (len1 > len2)
- return 1;
- if (flags1 < flags2)
- return -1;
- if (flags1 > flags2)
- return 1;
- return 0;
-}
-
-int cache_name_pos(const char *name, int namelen)
-{
- int first, last;
-
- first = 0;
- last = active_nr;
- while (last > first) {
- int next = (last + first) >> 1;
- struct cache_entry *ce = active_cache[next];
- int cmp = cache_name_compare(name, namelen, ce->name, htons(ce->ce_flags));
- if (!cmp)
- return next;
- if (cmp < 0) {
- last = next;
- continue;
- }
- first = next+1;
- }
- return -first-1;
-}
-
-/* Remove entry, return true if there are more entries to go.. */
-static int remove_entry_at(int pos)
-{
- active_nr--;
- if (pos >= active_nr)
- return 0;
- memmove(active_cache + pos, active_cache + pos + 1, (active_nr - pos) * sizeof(struct cache_entry *));
- return 1;
-}
-
-int remove_file_from_cache(char *path)
-{
- int pos = cache_name_pos(path, strlen(path));
- if (pos < 0)
- pos = -pos-1;
- while (pos < active_nr && !strcmp(active_cache[pos]->name, path))
- remove_entry_at(pos);
- return 0;
-}
-
-static int same_name(struct cache_entry *a, struct cache_entry *b)
-{
- int len = ce_namelen(a);
- return ce_namelen(b) == len && !memcmp(a->name, b->name, len);
-}
-
-int add_cache_entry(struct cache_entry *ce, int ok_to_add)
-{
- int pos;
-
- pos = cache_name_pos(ce->name, htons(ce->ce_flags));
-
- /* existing match? Just replace it */
- if (pos >= 0) {
- active_cache[pos] = ce;
- return 0;
- }
- pos = -pos-1;
-
- /*
- * Inserting a merged entry ("stage 0") into the index
- * will always replace all non-merged entries..
- */
- if (pos < active_nr && ce_stage(ce) == 0) {
- while (same_name(active_cache[pos], ce)) {
- ok_to_add = 1;
- if (!remove_entry_at(pos))
- break;
- }
- }
-
- if (!ok_to_add)
- return -1;
-
- /* Make sure the array is big enough .. */
- if (active_nr == active_alloc) {
- active_alloc = alloc_nr(active_alloc);
- active_cache = realloc(active_cache, active_alloc * sizeof(struct cache_entry *));
- }
-
- /* Add it in.. */
- active_nr++;
- if (active_nr > pos)
- memmove(active_cache + pos + 1, active_cache + pos, (active_nr - pos - 1) * sizeof(ce));
- active_cache[pos] = ce;
- return 0;
-}
-
-static int verify_hdr(struct cache_header *hdr, unsigned long size)
-{
- SHA_CTX c;
- unsigned char sha1[20];
-
- if (hdr->hdr_signature != htonl(CACHE_SIGNATURE))
- return error("bad signature");
- if (hdr->hdr_version != htonl(2))
- return error("bad index version");
- SHA1_Init(&c);
- SHA1_Update(&c, hdr, size - 20);
- SHA1_Final(sha1, &c);
- if (memcmp(sha1, (void *)hdr + size - 20, 20))
- return error("bad index file sha1 signature");
- return 0;
-}
-
-int read_cache(void)
-{
- int fd, i;
- struct stat st;
- unsigned long size, offset;
- void *map;
- struct cache_header *hdr;
-
- errno = EBUSY;
- if (active_cache)
- return error("more than one cachefile");
- errno = ENOENT;
- sha1_file_directory = getenv(DB_ENVIRONMENT);
- if (!sha1_file_directory)
- sha1_file_directory = DEFAULT_DB_ENVIRONMENT;
- if (access(sha1_file_directory, X_OK) < 0)
- return error("no access to SHA1 file directory");
- fd = open(get_index_file(), O_RDONLY);
- if (fd < 0)
- return (errno == ENOENT) ? 0 : error("open failed");
-
- size = 0; // avoid gcc warning
- map = (void *)-1;
- if (!fstat(fd, &st)) {
- size = st.st_size;
- errno = EINVAL;
- if (size >= sizeof(struct cache_header) + 20)
- map = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
- }
- close(fd);
- if (-1 == (int)(long)map)
- return error("mmap failed");
-
- hdr = map;
- if (verify_hdr(hdr, size) < 0)
- goto unmap;
-
- active_nr = ntohl(hdr->hdr_entries);
- active_alloc = alloc_nr(active_nr);
- active_cache = calloc(active_alloc, sizeof(struct cache_entry *));
-
- offset = sizeof(*hdr);
- for (i = 0; i < active_nr; i++) {
- struct cache_entry *ce = map + offset;
- offset = offset + ce_size(ce);
- active_cache[i] = ce;
- }
- return active_nr;
-
-unmap:
- munmap(map, size);
- errno = EINVAL;
- return error("verify header failed");
-}
-
-#define WRITE_BUFFER_SIZE 8192
-static char write_buffer[WRITE_BUFFER_SIZE];
-static unsigned long write_buffer_len;
-
-static int ce_write(SHA_CTX *context, int fd, void *data, unsigned int len)
-{
- while (len) {
- unsigned int buffered = write_buffer_len;
- unsigned int partial = WRITE_BUFFER_SIZE - buffered;
- if (partial > len)
- partial = len;
- memcpy(write_buffer + buffered, data, partial);
- buffered += partial;
- if (buffered == WRITE_BUFFER_SIZE) {
- SHA1_Update(context, write_buffer, WRITE_BUFFER_SIZE);
- if (write(fd, write_buffer, WRITE_BUFFER_SIZE) != WRITE_BUFFER_SIZE)
- return -1;
- buffered = 0;
- }
- write_buffer_len = buffered;
- len -= partial;
- data += partial;
- }
- return 0;
-}
-
-static int ce_flush(SHA_CTX *context, int fd)
-{
- unsigned int left = write_buffer_len;
-
- if (left) {
- write_buffer_len = 0;
- SHA1_Update(context, write_buffer, left);
- }
-
- /* Append the SHA1 signature at the end */
- SHA1_Final(write_buffer + left, context);
- left += 20;
- if (write(fd, write_buffer, left) != left)
- return -1;
- return 0;
-}
-
-int write_cache(int newfd, struct cache_entry **cache, int entries)
-{
- SHA_CTX c;
- struct cache_header hdr;
- int i;
-
- hdr.hdr_signature = htonl(CACHE_SIGNATURE);
- hdr.hdr_version = htonl(2);
- hdr.hdr_entries = htonl(entries);
-
- SHA1_Init(&c);
- if (ce_write(&c, newfd, &hdr, sizeof(hdr)) < 0)
- return -1;
-
- for (i = 0; i < entries; i++) {
- struct cache_entry *ce = cache[i];
- if (ce_write(&c, newfd, ce, ce_size(ce)) < 0)
- return -1;
- }
- return ce_flush(&c, newfd);
-}
rmfile ./git/read-cache.c
hunk ./git/sha1_file.c 1
-/*
- * GIT - The information manager from hell
- *
- * Copyright (C) Linus Torvalds, 2005
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This handles basic git sha1 object files - packing, unpacking,
- * creation etc.
- */
-
-#include <stdarg.h>
-#include "cache.h"
-
-const char *sha1_file_directory = NULL;
-
-static unsigned hexval(char c)
-{
- if (c >= '0' && c <= '9')
- return c - '0';
- if (c >= 'a' && c <= 'f')
- return c - 'a' + 10;
- if (c >= 'A' && c <= 'F')
- return c - 'A' + 10;
- return ~0;
-}
-
-int get_sha1_hex(const char *hex, unsigned char *sha1)
-{
- int i;
- for (i = 0; i < 20; i++) {
- unsigned int val = (hexval(hex[0]) << 4) | hexval(hex[1]);
- if (val & ~0xff)
- return -1;
- *sha1++ = val;
- hex += 2;
- }
- return 0;
-}
-
-char * sha1_to_hex(const unsigned char *sha1)
-{
- static char buffer[50];
- static const char hex[] = "0123456789abcdef";
- char *buf = buffer;
- int i;
-
- for (i = 0; i < 20; i++) {
- unsigned int val = *sha1++;
- *buf++ = hex[val >> 4];
- *buf++ = hex[val & 0xf];
- }
- return buffer;
-}
-
-/*
- * NOTE! This returns a statically allocated buffer, so you have to be
- * careful about using it. Do a "strdup()" if you need to save the
- * filename.
- */
-char *sha1_file_name(const unsigned char *sha1)
-{
- int i;
- static char *name, *base;
-
- if (!base) {
- char *sha1_file_directory = getenv(DB_ENVIRONMENT) ? : DEFAULT_DB_ENVIRONMENT;
- int len = strlen(sha1_file_directory);
- base = malloc(len + 60);
- memcpy(base, sha1_file_directory, len);
- memset(base+len, 0, 60);
- base[len] = '/';
- base[len+3] = '/';
- name = base + len + 1;
- }
- for (i = 0; i < 20; i++) {
- static char hex[] = "0123456789abcdef";
- unsigned int val = sha1[i];
- char *pos = name + i*2 + (i > 0);
- *pos++ = hex[val >> 4];
- *pos = hex[val & 0xf];
- }
- return base;
-}
-
-int check_sha1_signature(unsigned char *sha1, void *map, unsigned long size, const char *type)
-{
- char header[100];
- unsigned char real_sha1[20];
- SHA_CTX c;
-
- SHA1_Init(&c);
- SHA1_Update(&c, header, 1+sprintf(header, "%s %lu", type, size));
- SHA1_Update(&c, map, size);
- SHA1_Final(real_sha1, &c);
- return memcmp(sha1, real_sha1, 20) ? -1 : 0;
-}
-
-void *map_sha1_file(const unsigned char *sha1, unsigned long *size)
-{
- char *filename = sha1_file_name(sha1);
- int fd = open(filename, O_RDONLY);
- struct stat st;
- void *map;
-
- if (fd < 0) {
- perror(filename);
- return NULL;
- }
- if (fstat(fd, &st) < 0) {
- close(fd);
- return NULL;
- }
- map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
- close(fd);
- if (-1 == (int)(long)map)
- return NULL;
- *size = st.st_size;
- return map;
-}
-
-void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size)
-{
- int ret, bytes;
- z_stream stream;
- char buffer[8192];
- char *buf;
-
- /* Get the data stream */
- memset(&stream, 0, sizeof(stream));
- stream.next_in = map;
- stream.avail_in = mapsize;
- stream.next_out = buffer;
- stream.avail_out = sizeof(buffer);
-
- inflateInit(&stream);
- ret = inflate(&stream, 0);
- if (sscanf(buffer, "%10s %lu", type, size) != 2)
- return NULL;
-
- bytes = strlen(buffer) + 1;
- buf = malloc(*size);
- if (!buf)
- return NULL;
-
- memcpy(buf, buffer + bytes, stream.total_out - bytes);
- bytes = stream.total_out - bytes;
- if (bytes < *size && ret == Z_OK) {
- stream.next_out = buf + bytes;
- stream.avail_out = *size - bytes;
- while (inflate(&stream, Z_FINISH) == Z_OK)
- /* nothing */;
- }
- inflateEnd(&stream);
- return buf;
-}
-
-void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size)
-{
- unsigned long mapsize;
- void *map, *buf;
-
- map = map_sha1_file(sha1, &mapsize);
- if (map) {
- buf = unpack_sha1_file(map, mapsize, type, size);
- munmap(map, mapsize);
- return buf;
- }
- return NULL;
-}
-
-void *read_tree_with_tree_or_commit_sha1(const unsigned char *sha1,
- unsigned long *size,
- unsigned char *tree_sha1_return)
-{
- char type[20];
- void *buffer;
- unsigned long isize;
- int was_commit = 0;
- unsigned char tree_sha1[20];
-
- buffer = read_sha1_file(sha1, type, &isize);
-
- /*
- * We might have read a commit instead of a tree, in which case
- * we parse out the tree_sha1 and attempt to read from there.
- * (buffer + 5) is because the tree sha1 is always at offset 5
- * in a commit record ("tree ").
- */
- if (buffer &&
- !strcmp(type, "commit") &&
- !get_sha1_hex(buffer + 5, tree_sha1)) {
- free(buffer);
- buffer = read_sha1_file(tree_sha1, type, &isize);
- was_commit = 1;
- }
-
- /*
- * Now do we have something and if so is it a tree?
- */
- if (!buffer || strcmp(type, "tree")) {
- free(buffer);
- return NULL;
- }
-
- *size = isize;
- if (tree_sha1_return)
- memcpy(tree_sha1_return, was_commit ? tree_sha1 : sha1, 20);
- return buffer;
-}
-
-int write_sha1_file(char *buf, unsigned len, unsigned char *returnsha1)
-{
- int size;
- char *compressed;
- z_stream stream;
- unsigned char sha1[20];
- SHA_CTX c;
- char *filename;
- int fd;
-
- /* Sha1.. */
- SHA1_Init(&c);
- SHA1_Update(&c, buf, len);
- SHA1_Final(sha1, &c);
-
- if (returnsha1)
- memcpy(returnsha1, sha1, 20);
-
- filename = sha1_file_name(sha1);
- fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0666);
- if (fd < 0) {
- if (errno != EEXIST)
- return -1;
-
- /*
- * We might do collision checking here, but we'd need to
- * uncompress the old file and check it. Later.
- */
- return 0;
- }
-
- /* Set it up */
- memset(&stream, 0, sizeof(stream));
- deflateInit(&stream, Z_BEST_COMPRESSION);
- size = deflateBound(&stream, len);
- compressed = malloc(size);
-
- /* Compress it */
- stream.next_in = buf;
- stream.avail_in = len;
- stream.next_out = compressed;
- stream.avail_out = size;
- while (deflate(&stream, Z_FINISH) == Z_OK)
- /* nothing */;
- deflateEnd(&stream);
- size = stream.total_out;
-
- if (write(fd, compressed, size) != size)
- die("unable to write file");
- close(fd);
-
- return 0;
-}
-
-static inline int collision_check(char *filename, void *buf, unsigned int size)
-{
-#ifdef COLLISION_CHECK
- void *map;
- int fd = open(filename, O_RDONLY);
- struct stat st;
- int cmp;
-
- /* Unreadable object, or object went away? Strange. */
- if (fd < 0)
- return -1;
-
- if (fstat(fd, &st) < 0 || size != st.st_size)
- return -1;
-
- map = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
- close(fd);
- if (map == MAP_FAILED)
- return -1;
- cmp = memcmp(buf, map, size);
- munmap(map, size);
- if (cmp)
- return -1;
-#endif
- return 0;
-}
-
-int write_sha1_buffer(const unsigned char *sha1, void *buf, unsigned int size)
-{
- char *filename = sha1_file_name(sha1);
- int fd;
-
- fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0666);
- if (fd < 0) {
- if (errno != EEXIST)
- return -1;
- if (collision_check(filename, buf, size))
- return error("SHA1 collision detected!"
- " This is bad, bad, BAD!\a\n");
- return 0;
- }
- write(fd, buf, size);
- close(fd);
- return 0;
-}
rmfile ./git/sha1_file.c
rmdir ./git
}
[check for a git/ in current directory (when --enable-git).
David Roundy <[EMAIL PROTECTED]>**20050731112740]
<
> {
hunk ./configure.ac 429
GIT_CPPFLAGS="-I$withval"
if test -d "$withval" -a -r "$withval/cache.h" ; then true; else
AC_MSG_WARN([`$withval' does not look like git-core directory!])
- fi])
+ fi],[
+ AC_MSG_CHECKING([if there is a git/ in the current directory])
+ if test -d "git" -a -r "git/cache.h" ; then
+ GIT_LDFLAGS="-Lgit"
+ GIT_CPPFLAGS="-Igit"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ])
AC_ARG_WITH(git-includes, AS_HELP_STRING([--with-git-includes=-Ipath],
[extra CPP options needed to use Git headers]),
[GIT_CPPFLAGS="$withval $GIT_CPPFLAGS"])
}
Context:
[remove TODO annotation for two tests that now pass.
David Roundy <[EMAIL PROTECTED]>**20050728115034]
[Merge changes
Ian Lynagh <[EMAIL PROTECTED]>**20050728230858]
[Don't die on sigALRM (linking with -threaded means we see loads of them)
Ian Lynagh <[EMAIL PROTECTED]>**20050728131023]
[Give help for 'c' in selectchanges
Ian Lynagh <[EMAIL PROTECTED]>**20050728125910]
[Update QueryManifest with the Repository changes
Ian Lynagh <[EMAIL PROTECTED]>**20050728185646]
[Merge changes
Florian Weimer <[EMAIL PROTECTED]>**20050607203225]
[Fix typo
Florian Weimer <[EMAIL PROTECTED]>**20050510113824]
[Test case for "query manifest"
Florian Weimer <[EMAIL PROTECTED]>**20050510113803]
[Remove the "query changes" and "query annotate" subcommands
Florian Weimer <[EMAIL PROTECTED]>**20050510060221]
[Do not mention file name in error message for disabled commands
Florian Weimer <[EMAIL PROTECTED]>**20050510054931
We have multiple configuration files, and we do not know tat this point which
file contains the "disable" option.
]
[Remove --disable on supercommands
Florian Weimer <[EMAIL PROTECTED]>**20050510054744]
[Resolve conflict
Florian Weimer <[EMAIL PROTECTED]>**20050510054405]
[Add --help in command_options, like --disable
Florian Weimer <[EMAIL PROTECTED]>**20050510053348
--list-options is still separate, to keep it undocumented.
]
[Resolve conflict
Florian Weimer <[EMAIL PROTECTED]>**20050510052119]
[Move --disable to the end of the option list
Florian Weimer <[EMAIL PROTECTED]>**20050510051905]
[Include the query subcommand documentation in Query.lhs
Florian Weimer <[EMAIL PROTECTED]>**20050510051533]
[Print usage information if the subcommand is missing
Florian Weimer <[EMAIL PROTECTED]>**20050509101427
Add a separating line to the invalid subcommand error message.
]
[Fix empty lines in "darcs query --help" output
Florian Weimer <[EMAIL PROTECTED]>**20050509100509]
[Resolve conflicts
Florian Weimer <[EMAIL PROTECTED]>**20050509094729]
[Add the --disable option in command_options, not in run_the_command
Florian Weimer <[EMAIL PROTECTED]>**20050509093929
This change makes it possible to specialize the list of default commands
(such as --disable) on different DarcsCommand constructors.
]
[Add --pending option to "query manifest"
Florian Weimer <[EMAIL PROTECTED]>**20050508080502]
[Add the --files and --directories options to "query manifest"
Florian Weimer <[EMAIL PROTECTED]>**20050507223327]
[Implement list_slurpy_dirs
Florian Weimer <[EMAIL PROTECTED]>**20050507223257]
[Add --null flag to the "query manifest" command
Florian Weimer <[EMAIL PROTECTED]>**20050507213547]
[Add "query manifest" command
Florian Weimer <[EMAIL PROTECTED]>**20050507163125]
[Implement the \haskell command for subcommands
Florian Weimer <[EMAIL PROTECTED]>**20050507160607]
[Mention the structure of subcommands in the documentation
Florian Weimer <[EMAIL PROTECTED]>**20050507151003]
[Handle subcommands in the preprocessor
Florian Weimer <[EMAIL PROTECTED]>**20050507150829
You can use "\options{SUPER SUB}" to document the options of a
subcommand.
]
[Do not include the "query" command in the manual
Florian Weimer <[EMAIL PROTECTED]>**20050507150707
The commands will be documented individually, in the relevant section.
]
[Mention "query" subcommands in the man page
Florian Weimer <[EMAIL PROTECTED]>**20050507135756
"changes" is now documented as "query changes". "query annotate" is
mentioned, too.
]
[add subcommand infrastructure and (currently useless) query command.
David Roundy <[EMAIL PROTECTED]>**20050507115457
The idea of course is that this can be readily extended to add nice new
simple subcommands under query.
]
[Include autoconf-detected libs in LDFLAGS
Joshua J. Berry <[EMAIL PROTECTED]>**20050728031609
Autoconf uses @LIBS@ -- not @LDFLAGS@ -- for libraries it detects (e.g. using
AC_SEARCH_LIBS).
]
[Small tweaks to the with_new_pending patch
Ian Lynagh <[EMAIL PROTECTED]>**20050727025308]
[fix bug introduced in 208 fix which messed up --list-options output.
David Roundy <[EMAIL PROTECTED]>**20050729121804
We need to make sure that drop_paths doesn't do anything to an absolute
path or URL.
]
[Removed an unused reference to Slurpy
Ian Lynagh <[EMAIL PROTECTED]>**20050709114603]
[resolve conflict with myself...
David Roundy <[EMAIL PROTECTED]>**20050727100745]
[new changelog entries.
David Roundy <[EMAIL PROTECTED]>**20050726123329]
[make make_changelog ignore boring files (emacs backups) in changelog.in/entries/.
David Roundy <[EMAIL PROTECTED]>**20050726121455]
[scrunch up the tla/cvs tables a bit in the manual.
David Roundy <[EMAIL PROTECTED]>**20050724181011]
[another alternative formatting for cvs/tla tables.
Erik Schnetter <[EMAIL PROTECTED]>**20050724134656]
[alternative formatting for cvs/tla tables.
Erik Schnetter <[EMAIL PROTECTED]>**20050724113905]
[make add/remove --list-options not output preceding ./
David Roundy <[EMAIL PROTECTED]>**20050723134758
We were treating the repository root differently from subdirectories
because the file paths didn't need to get "fixed". Addresses bug #158.
]
[fix unit test that prompts for input
Will <[EMAIL PROTECTED]>**20050722181028]
[put configure.ac back in the public domain.
David Roundy <[EMAIL PROTECTED]>**20050720115702]
[advance DARCS_VERSION to 1.0.4pre2.
David Roundy <[EMAIL PROTECTED]>**20050720115536
In the new tradition of changing the version after a release rather than
before a release (although when the release type changes to rc or actual
release it'll have to be done before the release).
]
[drop $srcdir use; build-directories aren't supported anyway
Peter Simons <[EMAIL PROTECTED]>**20050719140044]
[clean generated manual files at realclean
Peter Simons <[EMAIL PROTECTED]>**20050719135935]
[cosmetic changes
Peter Simons <[EMAIL PROTECTED]>**20050719135834]
[move comment to the right place
Peter Simons <[EMAIL PROTECTED]>**20050719135818]
[let config.status generate config.command
Peter Simons <[EMAIL PROTECTED]>**20050719135733]
[make use of autoconf 2.5x's AC_INIT macro
Peter Simons <[EMAIL PROTECTED]>**20050719135611]
[use ./config.status to re-configure build after autoconf changes
Peter Simons <[EMAIL PROTECTED]>**20050719135435]
[update distclean and realclean targets
Peter Simons <[EMAIL PROTECTED]>**20050719135415]
[canonize [EMAIL PROTECTED]
Peter Simons <[EMAIL PROTECTED]>**20050719134834]
[cosmetic change
Peter Simons <[EMAIL PROTECTED]>**20050719134816]
[update test suite to work with Peter's makefile changes.
David Roundy <[EMAIL PROTECTED]>**20050721102319]
[clean up formatting in Depends.
David Roundy <[EMAIL PROTECTED]>**20050723130807]
[add changelog entry for get --partial fix.
David Roundy <[EMAIL PROTECTED]>**20050723130715]
[fix bug in get_patches_beyond_tag that broke get --partial.
David Roundy <[EMAIL PROTECTED]>**20050723125507
The bug was that we sometimes looked at patches that weren't strictly
necesary. This was because of the concat in get_patches_beyond_tag, which
loses information about tag dependencies. A clean implementation of a
get_extra that accepts a true PatchSet would be a nicer fix (since it might
fix other similar problems), but this fix is also correct and simple.
]
[Make DarcsRepo.add_to_inventory take a list.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050720174029
This avoids opening the inventory multiple times. Thanks to Ian for the hint.
]
[Use mapM_ instead of the comprehensible alternative.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050720164258
Mentioning mapM_ always impresses people at dinner parties. Thanks to
Ian for the hint.
]
[Move iterateGitTree out of the IO monad.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050720162841
We're reading immutable on-disk data, it's safe to do it unsafely.
]
[Clean up usage of interleaveIO in Git.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050720162251]
[replace write_pending with "with_new_pending".
David Roundy <[EMAIL PROTECTED]>**20050722125725
This patch is basically an extension of Ian's earlier patch that created a
"write_pending_then" function. This one creates two functions,
with_new_pending and add_to_pending.
The idea is that we can't check if a new pending is valid until after we've
updated the pristine cache. But it's possible that the pending patch
itself was lazily generated with get_unrecorded, in which case it's not
safe to modify the pristine cache until after we've written pending. This
new interface makes it much harder to make this kind of mistake. I also
think it's pretty intuitive.
]
[changelog entry for fix to RT#208.
David Roundy <[EMAIL PROTECTED]>**20050722113803]
[make make_changelog a bit more flexible in its parsing.
David Roundy <[EMAIL PROTECTED]>**20050722113701
One can now have blank lines between the match: lines and the actual
comments.
]
[fix error in name of --reorder-patches flag.
David Roundy <[EMAIL PROTECTED]>**20050722110752]
[give better error message when dealing with a non-repository.
David Roundy <[EMAIL PROTECTED]>**20050722105908]
[fix pulling from a relative defaultrepo from within a subdirectory.
David Roundy <[EMAIL PROTECTED]>**20050722105708
This is a fix for bug #208. It is perhaps a tad more invasive than
necesary, and introduces a FilePathUtils module that is perhaps
overkill... especially since it doesn't do much.
]
[TAG 1.0.4pre1
David Roundy <[EMAIL PROTECTED]>**20050718112234]
[make configure automatically guess the release state based on defaultrepo and tags.
David Roundy <[EMAIL PROTECTED]>**20050718112222]
[Push and pull can now show the detailed diffs of patches
Jim Radford <[EMAIL PROTECTED]>**20050717042645
The same distinction is now made between --summary and --verbose
as changes makes.
]
[TAG 2005-07-18
Ian Lynagh <[EMAIL PROTECTED]>**20050718193534]
[fix write_problem to show all problems.
David Roundy <[EMAIL PROTECTED]>**20050717110628]
[Rename bound variable in fromJust macro.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050716221705
Avoids ``shadows existing variable'' warnings which for some reason are
errors.
Could we please use Lisp macros instead?
]
[bugfix, make _darcs/prefs/defaults really override $HOME/.darcs/defaults
Tommy Pettersson <[EMAIL PROTECTED]>**20050612174925
Variants of the same flag from the two defaults files where just merged,
and an ALL in the local defaults could not override an explicit command
in the global defaults, as would be expected.
]
[use AC_SEARCH_LIBS instead of AC_CHECK_LIB
Wim Lewis <[EMAIL PROTECTED]>**20050707181811]
[Update AC_PREREQ to 2.54
Wim Lewis <[EMAIL PROTECTED]>**20050707181631
The form of AC_C_BIGENDIAN used here didn't show up until 2.53 or 2.54.
Also, no need to specify the third arg, since it defaults to erroring out anyway.
]
[TAG 2005-007-16
Ian Lynagh <[EMAIL PROTECTED]>**20050716181541]
[don't import head and tail, which are in the prelude.
David Roundy <[EMAIL PROTECTED]>**20050716143547]
[Keep file modes in dirty Git slurpies.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050716071846
This prevents Darcs from resetting Git file permissions.
]
[Update HEAD in place.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050716071116]
[Generalise write_pending.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050716002145
I missed this, which breaks add and remove.
]
[Use emptyGitSlurpy in gitCommitToPatch'.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050715234115]
[Fix parsing of Git merges with no common ancestor.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050715233226]
[Implement emptyGitSlurpy.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050715233211]
[Fix typo in applyF_direct (Git).
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050715233140]
[Don't include ./ when generating patches from Git.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050715203248]
[Generalise rollback.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050715194322]
[Make histories that come from Git lazy in the presence of merges.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050715193440
Use the fact that we know the length of the result of a merge to produce a
spine-lazy list of patches. This makes ``darcs changes'' never touch
a blob.
]
[Make darcs understand Git n-ary merges.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050715192333]
[move read/write format checks into identifyRepository and withRepoLock.
David Roundy <[EMAIL PROTECTED]>**20050714105840]
[Generalise Pull and Apply.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050712145643]
[Generate Git PatchInfos from scratch.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050712123945
patchtopatchinfo is not lazy enough.
]
[Replace frobPatchFile with patchTokenToPatchFile.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050711045246]
[Make writing of patches work in arbitrary directories.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050711021014]
[Use impossible.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050711015640]
[Make patch tokens opaque.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050711014829]
[cleanups in RepoFormat as suggested by Ian.
David Roundy <[EMAIL PROTECTED]>**20050711125711]
[fix typo in git prefsUrl.
David Roundy <[EMAIL PROTECTED]>**20050711100531]
[generalize Revert and Unrevert.
David Roundy <[EMAIL PROTECTED]>**20050711100429]
[fix bug where we failed to convert sha1 to hex.
David Roundy <[EMAIL PROTECTED]>**20050711092602]
[Only read darcs/cgi.conf once.
Wim Lewis <[EMAIL PROTECTED]>**20050623081319
Modified read_conf() so it caches the parsed configuration values
in a hash, instead of re-opening and re-reading the configuration
file several times per CGI invocation. (A probably-unimportant side
effect of this is that flag names can no longer contain spaces, but
that shouldn't affect anybody.)
]
[Make record repository-format agnostic.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710034630]
[Implement polymorphic write support.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710034310]
[Make withRepoLock polymorphic.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710023802]
[Make writePatch and updateInventory polymorphic.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710021543]
[Make sync_repo polymorphic.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710021426]
[Import GitRepo from darcs-git.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710015221
This version has write support and support for reverse-engineering
Darcs merges from Git merges.
]
[Add ``lax'' argument to applyToGitSlurpy.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710014814
When lax is true, we apply merger_equivalent to mergers.
]
[Make read/write_pending polymorphic.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710012515]
[don't go through shell when execing darcs
Wim Lewis <[EMAIL PROTECTED]>**20050710062743
Use the LIST variant of exec to avoid exposing the arguments of the darcs
command to shell interpretation. Also, pipe the output directly to where
it's going instead of reading it in and writing it out again.
]
[fix incorrectly quoted regexp
Wim Lewis <[EMAIL PROTECTED]>**20050710051424
Unquoted regexp evaluated to 0 or 1, which didn't immediately break the cgi
because most hashes have those characters in them. Also fixed a bogus
initializer caught by "perl -w".
]
[update comments in darcs.cgi
Wim Lewis <[EMAIL PROTECTED]>**20050710050226]
[Use a pipe instead of a temp file
Wim Lewis <[EMAIL PROTECTED]>**20050710005052
Instead of storing the intermediate XML in a temporary file and then invoking
xsltproc, just pipe the XML directly into the xslt processor on the fly.
]
[use darcs_xml() where it simplifies things
Wim Lewis <[EMAIL PROTECTED]>**20050709023659]
[Fix make_changelog to work with David's new identifyRepository.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710002419]
[Fix typo in import of malloc.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050710001235]
[Add comment about immutability of Git trees.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050709215815]
[Fix location of HEAD in Git.updateHead.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050709215408]
[implement missing DarcsIO methods in SlurpMonad.
David Roundy <[EMAIL PROTECTED]>**20050709192216]
[clean up GitTreeIterator.
David Roundy <[EMAIL PROTECTED]>**20050709174440]
[eliminate excess touching in Git.
David Roundy <[EMAIL PROTECTED]>**20050709170954]
[make GitFileInfo a cleaner more haskellish data type.
David Roundy <[EMAIL PROTECTED]>**20050709170457]
[add some typesafety to haskell cache_entry-related Git code.
David Roundy <[EMAIL PROTECTED]>**20050709153935]
[add a bit of type safety to the pointers to git_tree_iterator.
David Roundy <[EMAIL PROTECTED]>**20050709153337]
[make GitFile use the ffi more nicely.
David Roundy <[EMAIL PROTECTED]>**20050709152131]
[replace fromSingleton with gitSingleCommitValue which gives better error message.
David Roundy <[EMAIL PROTECTED]>**20050709145616]
[implement CString utility functions in FastPackedString.
David Roundy <[EMAIL PROTECTED]>**20050709145549]
[use withSlurpy to implement apply_to_slurpy.
David Roundy <[EMAIL PROTECTED]>**20050709145517]
[make darcs send look in the right place for target email address.
David Roundy <[EMAIL PROTECTED]>**20050709121505]
[fix bug in Repository abstraction code that broke remote pulls.
David Roundy <[EMAIL PROTECTED]>**20050709120518
This change adds to the Repository data object the URL of the repository in
question, allowing us to use this abstraction with both remote and local
repositories.
]
[add support for repository format checking.
David Roundy <[EMAIL PROTECTED]>**20050709112017
The idea being to be forward-compatible with repository format changes.
]
[add an unused RepoFormat module.
David Roundy <[EMAIL PROTECTED]>**20050430123937]
[Documentation nits & typos
Wim Lewis <[EMAIL PROTECTED]>**20050618193852]
[Merge conflicts in configure.ac, and add blank line to try to avoid future conflicts
Ian Lynagh <[EMAIL PROTECTED]>**20050707160658]
[TAG 1.0.3
Tomasz Zielonka <[EMAIL PROTECTED]>**20050524215127]
[bump version to 1.0.3
Tomasz Zielonka <[EMAIL PROTECTED]>**20050524215115]
[Revert an accidental Repository -> DarcsRepo change in a string
Ian Lynagh <[EMAIL PROTECTED]>**20050707160431]
[Revert "Cache pristine directory within NoPristine"
Ian Lynagh <[EMAIL PROTECTED]>**20050707153500]
[fixed a few typos in docs & comments
Wim Lewis <[EMAIL PROTECTED]>**20050624070640]
[make git support configurable (copied from Juliusz's patch).
David Roundy <[EMAIL PROTECTED]>**20050701135046]
[TAG another version that works in the git-merge saga.
David Roundy <[EMAIL PROTECTED]>**20050701133252]
[fix errors from merging more darcs-git stuff.
David Roundy <[EMAIL PROTECTED]>**20050701133228]
[resolve some more conflicts.
David Roundy <[EMAIL PROTECTED]>**20050701132446]
[TAG working version in middle of darcs-git merge.
David Roundy <[EMAIL PROTECTED]>**20050701125730]
[resolve conflicts between git and darcs-unstable.
David Roundy <[EMAIL PROTECTED]>**20050701125706]
[Cache pristine directory within NoPristine.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426172006]
[eliminate unnecesary unsafePerformIOs in Git.
David Roundy <[EMAIL PROTECTED]>**20050701142312]
[Move gitIsTree to C code.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050509235651]
[Simplify gitBlobToPatches.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050509234445]
[Remove obsolete comment.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050507195543]
[Make ordering of trees Linus-compatible.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050507184412]
[Don't sort when purifying Git slurpies.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050507024134
The new ordering is preserved by purification.
]
[Replace the definition of Ord on GitSlurpy with one that works.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050507023832
This is still not Linus-compliant, as Haskell and C use different ordering
conventions.
]
[Fix typo in noname.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050506222328]
[Make gitFooToPatches work with dirty trees.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050506200939]
[Export GitSlurpy.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050506181048]
[Implement a variant of gitCommitToPatch that takes a GitSlurpy reference.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050506180031]
[Get rid of gitCommitToPIMP.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050505181603]
[Move reading git commits out of the IO monad.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050505180609]
[Simplify generation of PatchSets from Git repos.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050505170207]
[Fix parsing of multiple parents in Git commits.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050505153025
Multiple parents come in separate parent lines, not a single line as I
thought.
]
[Fix Git date handling.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504233745]
[Fix formatting of Git files.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504211643]
[Fix formatting of Git records.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504210607]
[Only free those names that were allocated in git_write_tree_done.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504204933]
[Free the right buffer in git_write_tree_done.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504204910]
[Estimate the size of a new tree correctly.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504204850]
[Actually create new .git/HEAD (blush).
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504204825]
[Use "." as root of GitSlurpies.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504203304]
[Implement updateHead.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504193546]
[Implement git_update_head.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504193529]
[Implement writeGitCommit.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504192232]
[Add type argument to writeGitFile.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504185421]
[Make slurpGitCommit return a GitSlurpy after all.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504143935]
[Implement make_git_file_info.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504142613]
[Implement purification of Git trees.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504142042]
[Actually implement purification of blobs.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504125709]
[Add repo argument to purify.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050503234432]
[Partial implementation of purifyGitSlurpy.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050503232848]
[Generalise trackdown.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426233012]
[Make whatsnew go through Repository.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426162106
This won't work for Git repositories until they implement slurp_recorded
and get_recorded.
]
[Implement git_format_time.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504192053]
[Export Slurpy constructors.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426195817]
[Export applyBinary and applyHunkLines.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050503224204]
[Really don't include directories in slurpies.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050429235609]
[Make dist work with git repositories.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426203906]
[Fix merge conflicts.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425194100]
[Remove unsafeConstructPS.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050509233129]
[Declare Git's global variables as extern.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050507224710
Silly GHCi doesn't grok common symbols.
]
[Use RepoPrefs.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050506220257]
[Implement repoPrefs.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050506220152]
[Export PatchInfo constructor.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050504190531]
[Implement applyToGitSlurpy.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050503231941]
[Basic implementation of dirty Git slurpies.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050503222642]
[Use the cache when slurping the pristine state.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050430000813]
[Restructure patch generation from Git repos.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050427213320]
[Don't store directories in slurpies.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050427000833]
[Instance Show Slurpy.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426235914]
[Start slurping at ".".
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426203853]
[Implement slurping from git repositories.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426195957]
[Make pattern exhaustive.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426195941]
[Check for presence of .git/HEAD.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426195914]
[Move slurp_pending and slurp_recorded into Repository.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426185425]
[Move get_unrecorded to Repository.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426175527]
[Implement send for git repositories.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425210728]
[Implement changes for git repositories.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425205329]
[Use ForeignPtrs instead of raw pointers when useful.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425180449
Now I remember why I hate Haskell.
]
[Some less IO monad hacking.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425180207]
[Fix handling of subtrees.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425162405]
[Implement subtrees.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425063228]
[Parse new-style git dates.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425001902]
[Initial implementation of pulling from git.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050424213832]
[Add licence statements to Linus' files.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050426161330]
[Implement constructPS.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050425180306
I use touchForeignPtr in the finaliser when building a PS from a
ForeignPtr.
]
[Import parts of Linus' git 0.6.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050424213310]
[Implement unsafeConstructPS.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050424212204]
[Export diff_files from Diff.lhs.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050424212113]
[Export emptyFileContents from SlurpDirectory.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050424212051]
[First cut at remodularising repo access.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050424145002]
[Change Repository to DarcsRepo.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050424140132]
[TAG 2005-07-07
Ian Lynagh <[EMAIL PROTECTED]>**20050707144607]
Patch bundle hash:
28b469afbf20b8c2cfbb89ea161c47d1fd4da63d
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel