[PATCH 1/2] sha1_object_info_extended: provide delta base sha1s

2013-12-21 Thread Jeff King
A caller of sha1_object_info_extended technically has enough information to determine the base sha1 from the results of the call. It knows the pack, offset, and delta type of the object, which is sufficient to find the base. However, the functions to do so are not publicly available, and the code

[PATCH 0/2] cat-file --batch-check='%(deltabase)'

2013-12-21 Thread Jeff King
This series lets you query the delta base for a particular object (or set of objects), like: $ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(deltabase) %(rest)' The only other way I know of to get this information is using verify-pack (or index-pack), which is

[PATCH 2/2] cat-file: provide %(deltabase) batch format

2013-12-21 Thread Jeff King
It can be useful for debugging or analysis to see which objects are stored as delta bases on top of others. This information is available by running `git verify-pack`, but that is extremely expensive (and is harder than necessary to parse). Instead, let's make it available as a cat-file query

Re: git-mv-submodule

2013-12-21 Thread Jens Lehmann
Am 21.12.2013 10:48, schrieb fREW Schmidt: Hello all, I was on a plane, moving around some of the many (30ish) submodules in my dotfiles and got really annoyed at how much work it is (move the dir, remove old from git, add new to git, fix .gitmodules, fix .git/config, fix all the parts of

Re: git-mv-submodule

2013-12-21 Thread fREW Schmidt
On Sat, Dec 21, 2013 at 05:08:59PM +0100, Jens Lehmann wrote: Am 21.12.2013 10:48, schrieb fREW Schmidt: Thanks for sharing! Form a cursory look over your perl script it looks like it does what stock git mv will do since 1.8.5 (except for changing the name of the submodule, which I would not

Hello dear

2013-12-21 Thread annstokes78
Hello dear I will be very happy to be your friend. My name is miss. Ann Stokes. Please i will like you to write me through my email address ( ann...@yahoo.fr ) . I will send my pictures to you and also tell you more about myself when i receive your email. I will be waiting for your mail in my mail

Re: [PATCH v4 0/22] pack bitmaps

2013-12-21 Thread Thomas Rast
Jeff King p...@peff.net writes: Here's the v4 re-roll of the pack bitmap series. The changes from v3 are: - reworked add_object_entry refactoring (see patch 11, which is new, and patch 12 which builds on it in a more natural way) This now looks like this (pasting because it is hard to

Re: [PATCH] wt-status.c: disable those distracting -Wformat-zero-length warnings

2013-12-21 Thread Samuel Bronson
On Sat, Dec 21, 2013 at 4:42 AM, Jeff King p...@peff.net wrote: On Fri, Dec 20, 2013 at 10:45:01AM -0500, Samuel Bronson wrote: These warnings don't really seem to make much sense for this file. Agreed, though the advice so far has been to put -Wno-format-zero-length in your CFLAGS. Yes,

[PATCH] commit.c: make tree a const pointer in commit_tree*()

2013-12-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- commit.c | 4 ++-- commit.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commit.c b/commit.c index 5df1df7..5ff5538 100644 --- a/commit.c +++ b/commit.c @@ -1356,7 +1356,7 @@ void

Re: [PATCH v2 00/21] Support multiple worktrees

2013-12-21 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: I am not happy with the choice of main/HEAD that would squat on a good name for remote-tracking branch (i.e. s/origin/main/), though. $GIT_DIR/COMMON_HEAD perhaps? It's not just about HEAD. Anything worktree-specific of the main checkout can be accessed

Re: questions / suggestions about history simplification

2013-12-21 Thread Junio C Hamano
Adam Spiers g...@adamspiers.org writes: I doubt it. 75% of the work for such a person to understand the behaviour from such an example is to understand what kind of history the example is building. Agreed. And that's precisely why I wanted a real repository manifesting the given example:

Re: [PATCH] git-cherry.txt: cross reference git log --cherry

2013-12-21 Thread Junio C Hamano
Samuel Bronson naes...@gmail.com writes: I learned of git cherry some days ago, but only learned of --cherry and related options to git log today[1] (more-or-less by chance). If the git-cherry(1) manpage had mentioned --cherry, I would have learned of these options sooner. This proposed log

[PATCH 4/5] safe_create_leading_directories(): fix a mkdir/rmdir race

2013-12-21 Thread Michael Haggerty
It could be that some other process is trying to clean up empty directories at the same time that safe_create_leading_directories() is attempting to create them. In this case, it could happen that directory a/b was present at the end of one iteration of the loop (either it was already present or

[PATCH 2/5] safe_create_leading_directories(): reduce scope of local variable

2013-12-21 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- sha1_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sha1_file.c b/sha1_file.c index c9245a6..cc9957e 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -108,9 +108,10 @@ int mkdir_in_gitdir(const char *path) int

[PATCH 3/5] safe_create_leading_directories(): add slash pointer

2013-12-21 Thread Michael Haggerty
Keep track of the position of the slash character separately, and restore the slash character at a single place, at the end of the while loop. This makes the next change easier to implement. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- sha1_file.c | 36

[PATCH 5/5] rename_ref(): fix a mkdir()/rmdir() race

2013-12-21 Thread Michael Haggerty
When renaming a reflog file, it was possible that an empty directory that we just created using safe_create_leading_directories() might get deleted by another process before we have a chance to move the new file into it. So if the rename fails with ENOENT, then retry from the beginning. Make up

[PATCH 0/5] Fix two mkdir/rmdir races

2013-12-21 Thread Michael Haggerty
There seem to be a lot of mkdir/rmdir races in the Git code. Fix two of them. It is hard to construct test cases for races without a lot of extra test infrastructure. So I have tested them as best I can using instrumented code (not included here). Michael Haggerty (5):

[PATCH 1/5] safe_create_leading_directories(): modernize format of if chaining

2013-12-21 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- sha1_file.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index daacc0c..c9245a6 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -125,8 +125,7 @@ int safe_create_leading_directories(char

Re: [PATCH v3 07/10] builtin/replace: teach listing using short, medium or full formats

2013-12-21 Thread Christian Couder
On Thu, Dec 19, 2013 at 7:58 PM, Junio C Hamano gits...@pobox.com wrote: Christian Couder christian.cou...@gmail.com writes: I think this last one might be useful for people replacing objects with objects that have another type. ... which IIUC is strongly discouraged---didn't you have to

Re: [PATCH] wt-status.c: disable those distracting -Wformat-zero-length warnings

2013-12-21 Thread Jeff King
On Fri, Dec 20, 2013 at 10:45:01AM -0500, Samuel Bronson wrote: These warnings don't really seem to make much sense for this file. Agreed, though the advice so far has been to put -Wno-format-zero-length in your CFLAGS. +/* We have good reasons for using zero-length format strings, and + *

git-mv-submodule

2013-12-21 Thread fREW Schmidt
Hello all, I was on a plane, moving around some of the many (30ish) submodules in my dotfiles and got really annoyed at how much work it is (move the dir, remove old from git, add new to git, fix .gitmodules, fix .git/config, fix all the parts of the submodule config) so I wrote a perl script to

Re: [PATCH v3 11/21] pack-objects: use bitmaps when packing objects

2013-12-21 Thread Jeff King
On Sat, Dec 07, 2013 at 04:47:20PM +0100, Thomas Rast wrote: +static off_t write_reused_pack(struct sha1file *f) +{ + uint8_t buffer[8192]; We usually just call this 'unsigned char'. I can see why this would be more portable, but git would already fall apart badly on an architecture

Re: [PATCH v3 13/21] pack-objects: implement bitmap writing

2013-12-21 Thread Jeff King
On Sat, Dec 07, 2013 at 05:32:43PM +0100, Thomas Rast wrote: +pack.writebitmaps:: + When true, git will write a bitmap index when packing all + objects to disk (e.g., as when `git repack -a` is run). This ^^ Doesn't sound right in my ears. Remove the

Re: [PATCH v3 19/21] t: add basic bitmap functionality tests

2013-12-21 Thread Jeff King
On Sat, Dec 07, 2013 at 05:43:29PM +0100, Thomas Rast wrote: One nit: +test_expect_success JGIT 'jgit can read our bitmaps' ' + git clone . compat-us.git + ( + cd compat-us.git The name suggests a bare repo, but it is a full clone. Not that it matters. It was

Re: [PATCH v3 20/21] t/perf: add tests for pack bitmaps

2013-12-21 Thread Jeff King
On Sat, Dec 07, 2013 at 05:51:43PM +0100, Thomas Rast wrote: Jeff King p...@peff.net writes: +test_perf 'simulated fetch' ' + have=$(git rev-list HEAD --until=1.week.ago -1) This will give you HEAD if your GIT_PERF_LARGE_REPO hasn't seen any activity lately. I'd prefer something

[PATCH v4 0/22] pack bitmaps

2013-12-21 Thread Jeff King
Here's the v4 re-roll of the pack bitmap series. The changes from v3 are: - reworked add_object_entry refactoring (see patch 11, which is new, and patch 12 which builds on it in a more natural way) - better error/die reporting from write_reused_pack - added Ramsay's PRIx64 compat fix -

[PATCH v4 01/23] sha1write: make buffer const-correct

2013-12-21 Thread Jeff King
We are passed a void * and write it out without ever touching it; let's indicate that by using const. Signed-off-by: Jeff King p...@peff.net --- csum-file.c | 6 +++--- csum-file.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/csum-file.c b/csum-file.c index

[PATCH v4 06/23] sha1_file: export `git_open_noatime`

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com The `git_open_noatime` helper can be of general interest for other consumers of git's different on-disk formats. Signed-off-by: Vicent Marti tan...@gmail.com Signed-off-by: Jeff King p...@peff.net --- cache.h | 1 + sha1_file.c | 4 +--- 2 files changed,

[PATCH v4 03/23] pack-objects: Refactor the packing list

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com The hash table that stores the packing list for a given `pack-objects` run was tightly coupled to the pack-objects code. In this commit, we refactor the hash table and the underlying storage array into a `packing_data` struct. The functionality for accessing

[PATCH v4 05/23] revision: allow setting custom limiter function

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com This commit enables users of `struct rev_info` to peform custom limiting during a revision walk (i.e. `get_revision`). If the field `include_check` has been set to a callback, this callback will be issued once for each commit before it is added to the pending

[PATCH v4 07/23] compat: add endianness helpers

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com The POSIX standard doesn't currently define a `ntohll`/`htonll` function pair to perform network-to-host and host-to-network swaps of 64-bit data. These 64-bit swaps are necessary for the on-disk storage of EWAH bitmaps if they are not in native byte order.

[PATCH v4 02/23] revindex: Export new APIs

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com Allow users to efficiently lookup consecutive entries that are expected to be found on the same revindex by exporting `find_revindex_position`: this function takes a pointer to revindex itself, instead of looking up the proper revindex for a given packfile on

[PATCH v4 18/23] repack: consider bitmaps when performing repacks

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com Since `pack-objects` will write a `.bitmap` file next to the `.pack` and `.idx` files, this commit teaches `git-repack` to consider the new bitmap indexes (if they exist) when performing repack operations. This implies moving old bitmap indexes out of the way

[PATCH v4 13/23] rev-list: add bitmap mode to speed up object lists

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com The bitmap reachability index used to speed up the counting objects phase during `pack-objects` can also be used to optimize a normal rev-list if the only thing required are the SHA1s of the objects during the list (i.e., not the path names at which trees and

[PATCH v4 16/23] repack: turn exts array into array-of-struct

2013-12-21 Thread Jeff King
This is slightly more verbose, but will let us annotate the extensions with further options in future commits. Signed-off-by: Jeff King p...@peff.net --- builtin/repack.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/builtin/repack.c b/builtin/repack.c

[PATCH v4 20/23] t: add basic bitmap functionality tests

2013-12-21 Thread Jeff King
Now that we can read and write bitmaps, we can exercise them with some basic functionality tests. These tests aren't particularly useful for seeing the benefit, as the test repo is too small for it to make a difference. However, we can at least check that using bitmaps does not break anything.

[PATCH v4 15/23] repack: stop using magic number for ARRAY_SIZE(exts)

2013-12-21 Thread Jeff King
We have a static array of extensions, but hardcode the size of the array in our loops. Let's pull out this magic number, which will make it easier to change. Signed-off-by: Jeff King p...@peff.net --- builtin/repack.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v4 11/23] pack-objects: split add_object_entry

2013-12-21 Thread Jeff King
This function actually does three things: 1. Check whether we've already added the object to our packing list. 2. Check whether the object meets our criteria for adding. 3. Actually add the object to our packing list. It's a little hard to see these three phases, because they happen

[PATCH v4 08/23] ewah: compressed bitmap implementation

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com EWAH is a word-aligned compressed variant of a bitset (i.e. a data structure that acts as a 0-indexed boolean array for many entries). It uses a 64-bit run-length encoding (RLE) compression scheme, trading some compression for better processing speed. The

[PATCH v4 10/23] pack-bitmap: add support for bitmap indexes

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com A bitmap index is a `.bitmap` file that can be found inside `$GIT_DIR/objects/pack/`, next to its corresponding packfile, and contains precalculated reachability information for selected commits. The full specification of the format for these bitmap indexes can

[PATCH v4 09/23] documentation: add documentation for the bitmap format

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com This is the technical documentation for the JGit-compatible Bitmap v1 on-disk format. Signed-off-by: Vicent Marti tan...@gmail.com Signed-off-by: Jeff King p...@peff.net --- Documentation/technical/bitmap-format.txt | 131 ++ 1

[PATCH v4 12/23] pack-objects: use bitmaps when packing objects

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com In this patch, we use the bitmap API to perform the `Counting Objects` phase in pack-objects, rather than a traditional walk through the object graph. For a reasonably-packed large repo, the time to fetch and clone is often dominated by the full-object revision

[PATCH v4 17/23] repack: handle optional files created by pack-objects

2013-12-21 Thread Jeff King
We ask pack-objects to pack to a set of temporary files, and then rename them into place. Some files that pack-objects creates may be optional (like a .bitmap file), in which case we would not want to call rename(). We already call stat() and make the chmod optional if the file cannot be accessed.

[PATCH v4 22/23] pack-bitmap: implement optional name_hash cache

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com When we use pack bitmaps rather than walking the object graph, we end up with the list of objects to include in the packfile, but we do not know the path at which any tree or blob objects would be found. In a recently packed repository, this is fine. A fetch

[PATCH v4 21/23] t/perf: add tests for pack bitmaps

2013-12-21 Thread Jeff King
This adds a few basic perf tests for the pack bitmap code to show off its improvements. The tests are: 1. How long does it take to do a repack (it gets slower with bitmaps, since we have to do extra work)? 2. How long does it take to do a clone (it gets faster with bitmaps)? 3.

[PATCH v4 14/23] pack-objects: implement bitmap writing

2013-12-21 Thread Jeff King
From: Vicent Marti tan...@gmail.com This commit extends more the functionality of `pack-objects` by allowing it to write out a `.bitmap` index next to any written packs, together with the `.idx` index that currently gets written. If bitmap writing is enabled for a given repository (either by

[PATCH v4 23/23] compat/mingw.h: Fix the MinGW and msvc builds

2013-12-21 Thread Jeff King
From: Ramsay Jones ram...@ramsay1.demon.co.uk Signed-off-by: Ramsay Jones ram...@ramsay1.demon.co.uk Signed-off-by: Junio C Hamano gits...@pobox.com Signed-off-by: Jeff King p...@peff.net --- compat/mingw.h | 1 + 1 file changed, 1 insertion(+) diff --git a/compat/mingw.h b/compat/mingw.h index

Re: [PATCH v4 0/22] pack bitmaps

2013-12-21 Thread Jeff King
On Sat, Dec 21, 2013 at 08:56:51AM -0500, Jeff King wrote: Interdiff is below. [01/23]: sha1write: make buffer const-correct [02/23]: revindex: Export new APIs [03/23]: pack-objects: Refactor the packing list [04/23]: pack-objects: factor out name_hash [05/23]: revision: allow

Re: [PATCH v4 0/22] pack bitmaps

2013-12-21 Thread Jeff King
On Sat, Dec 21, 2013 at 08:56:51AM -0500, Jeff King wrote: The changes from v3 are: - reworked add_object_entry refactoring (see patch 11, which is new, and patch 12 which builds on it in a more natural way) - better error/die reporting from write_reused_pack - added Ramsay's