Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jeff King
On Thu, Feb 25, 2016 at 02:00:36AM -0500, Jeff King wrote: > I think something like this would work: > [...] > but it does not seem to pass with your patch (even after I fixed up the > weird "local" thing). I think the problem is that we ask > submodule--helper to do the clone, and it uses

Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jeff King
On Wed, Feb 24, 2016 at 10:23:28PM -0800, Jacob Keller wrote: > >> +# Sanitize the local git environment for use within a submodule. We > >> +# can't simply use clear_local_git_env since we want to preserve some > >> +# of the settings from GIT_CONFIG_PARAMETERS. > >> +sanitize_local_git_env() >

Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jacob Keller
On Wed, Feb 24, 2016 at 10:23 PM, Jeff King wrote: > On Wed, Feb 24, 2016 at 10:19:05PM -0800, Jacob Keller wrote: > >> >> + /* combined all the values before we quote them */ >> > >> > Comment repeats what the code already says, thus not terribly useful. >> > >> >

Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jacob Keller
On Wed, Feb 24, 2016 at 5:41 PM, Jeff King wrote: > On Wed, Feb 24, 2016 at 03:59:12PM -0800, Jacob Keller wrote: > >> +int sanitize_submodule_config(const char *var, const char *value, void >> *data) >> +{ >> + struct strbuf quoted = STRBUF_INIT; >> + struct strbuf *out =

Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jeff King
On Wed, Feb 24, 2016 at 10:19:05PM -0800, Jacob Keller wrote: > >> + /* combined all the values before we quote them */ > > > > Comment repeats what the code already says, thus not terribly useful. > > > > Also: s/combined/combine/ > > > I tend to make comments like this when I

Re: [RFC/PATCH 0/5] Make README more pleasant to read

2016-02-24 Thread Junio C Hamano
Jeff King writes: >> > I do not overly care, but I wonder if it would be nice to keep README as >> > a symlink. >> >> I can add it if people want to see it, but we already have so many files >> at the root, I'd rather avoid adding duplicates through symlinks. > > That's

Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jacob Keller
On Wed, Feb 24, 2016 at 4:27 PM, Eric Sunshine wrote: >> --- >> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c >> @@ -255,6 +255,61 @@ static int module_clone(int argc, const char **argv, >> const char *prefix) >> +/* Rules to sanitize

Re: [RFC/PATCH 0/5] Make README more pleasant to read

2016-02-24 Thread Jeff King
On Wed, Feb 24, 2016 at 02:37:05PM +0100, Matthieu Moy wrote: > Jeff King writes: > > > On Tue, Feb 23, 2016 at 06:40:24PM +0100, Matthieu Moy wrote: > > > >> README => README.md | 54 > >> - > >> t/t7001-mv.sh | 2 +- >

Re: Rebase performance

2016-02-24 Thread Junio C Hamano
Duy Nguyen writes: > On Thu, Feb 25, 2016 at 5:09 AM, Christian Couder > wrote: >> Another possibility would be to libify the "git apply" functionality >> and then to use the libified "git apply" in run_apply() instead of >> launching a separate

Re: Rebase performance

2016-02-24 Thread Duy Nguyen
On Thu, Feb 25, 2016 at 10:02 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Thu, Feb 25, 2016 at 5:09 AM, Christian Couder >> wrote: >>> Another possibility would be to libify the "git apply" functionality >>> and then

[PATCHv17 08/11] run_processes_parallel: correctly terminate callbacks with an LF

2016-02-24 Thread Stefan Beller
As the strbufs passed around collect all output to the user, and there is no post processing involved we need to care about the line ending ourselves. Reviewed-by: Jonathan Nieder Signed-off-by: Stefan Beller --- run-command.c | 2 ++ 1 file changed, 2

[PATCHv17 06/11] run-command: expose default_{start_failure, task_finished}

2016-02-24 Thread Stefan Beller
We want to reuse the error reporting facilities in a later patch. Reviewed-by: Jonathan Nieder Signed-off-by: Stefan Beller --- run-command.c | 18 +- run-command.h | 19 +++ 2 files changed, 28 insertions(+), 9

[PATCHv17 07/11] run_processes_parallel: rename parameters for the callbacks

2016-02-24 Thread Stefan Beller
The refs code has a similar pattern of passing around 'struct strbuf *err', which is strictly used for error reporting. This is not the case here, as the strbuf is used to accumulate all the output (whether it is error or not) for the user. Rename it to 'out'. Suggested-by: Jonathan Nieder

[PATCHv17 04/11] submodule update: direct error message to stderr

2016-02-24 Thread Stefan Beller
Reroute the error message for specified but initialized submodules to stderr instead of stdout. Reviewed-by: Jonathan Nieder Signed-off-by: Stefan Beller --- git-submodule.sh | 4 ++-- t/t7400-submodule-basic.sh | 4 ++-- 2 files changed, 4

[PATCHv17 03/11] fetching submodules: respect `submodule.fetchJobs` config option

2016-02-24 Thread Stefan Beller
This allows to configure fetching and updating in parallel without having the command line option. This moved the responsibility to determine how many parallel processes to start from builtin/fetch to submodule.c as we need a way to communicate "The user did not specify the number of parallel

[PATCHv17 02/11] submodule-config: drop check against NULL

2016-02-24 Thread Stefan Beller
Adhere to the common coding style of Git and not check explicitly for NULL throughout the file. There are still other occurrences in the code base but that is usually inside of conditions with side effects. Reviewed-by: Jonathan Nieder Signed-off-by: Stefan Beller

[PATCHv17 11/11] clone: allow an explicit argument for parallel submodule clones

2016-02-24 Thread Stefan Beller
Just pass it along to "git submodule update", which may pick reasonable defaults if you don't specify an explicit number. Reviewed-by: Jonathan Nieder Signed-off-by: Stefan Beller --- Documentation/git-clone.txt | 6 +- builtin/clone.c |

[PATCHv17 05/11] run_processes_parallel: treat output of children as byte array

2016-02-24 Thread Stefan Beller
We do not want the output to be interrupted by a NUL byte, so we cannot use raw fputs. Introduce strbuf_write to avoid having long arguments in run-command.c. Reviewed-by: Jonathan Nieder Signed-off-by: Stefan Beller --- run-command.c | 8

[PATCHv17 00/11] Expose submodule parallelism to the user

2016-02-24 Thread Stefan Beller
This replaces origin/sb/submodule-parallel-update and applies on origin/sb/submodule-parallel-fetch. Thanks Jonathan for review! * fixing all the small nits of v16 found by Jonathan! Thanks, Stefan Interdiff to v15: (current origin/sb/submodule-parallel-update) diff --git

[PATCHv17 01/11] submodule-config: keep update strategy around

2016-02-24 Thread Stefan Beller
Currently submodule..update is only handled by git-submodule.sh. C code will start to need to make use of that value as more of the functionality of git-submodule.sh moves into library code in C. Add the update field to 'struct submodule' and populate it so it can be read as sm->update or from

[PATCHv17 10/11] submodule update: expose parallelism to the user

2016-02-24 Thread Stefan Beller
Expose possible parallelism either via the "--jobs" CLI parameter or the "submodule.fetchJobs" setting. By having the variable initialized to -1, we make sure 0 can be passed into the parallel processing machine, which will then pick as many parallel workers as there are CPUs. Reviewed-by:

[PATCHv17 09/11] git submodule update: have a dedicated helper for cloning

2016-02-24 Thread Stefan Beller
This introduces a new helper function in git submodule--helper which takes care of cloning all submodules, which we want to parallelize eventually. Some tests (such as empty URL, update_mode=none) are required in the helper to make the decision for cloning. These checks have been moved into the C

Re: [PATCHv15 2/5] run_processes_parallel: add LF when caller is sloppy

2016-02-24 Thread Junio C Hamano
Jonathan Nieder writes: > Stefan Beller wrote: >> On Wed, Feb 24, 2016 at 1:19 PM, Jonathan Nieder wrote: >> > Stefan Beller wrote: > When the callers of parallel processing machine are sloppy with their messages, make sure the output is

Re: using git-diff as a diff replacement?

2016-02-24 Thread Jacob Keller
On Wed, Feb 24, 2016 at 6:38 PM, Duy Nguyen wrote: > On Thu, Feb 25, 2016 at 5:21 AM, Jacob Keller wrote: >> Hey, >> >> I know that running "git diff " when outside a git >> project will result in a normal diff being run. I happen to prefer the >> diff

Re: using git-diff as a diff replacement?

2016-02-24 Thread Duy Nguyen
On Thu, Feb 25, 2016 at 5:21 AM, Jacob Keller wrote: > Hey, > > I know that running "git diff " when outside a git > project will result in a normal diff being run. I happen to prefer the > diff algorithm and diff output of "git diff" but there does not seem > to be a way

[PATCH] fetch: mark a file-local symbol as static

2016-02-24 Thread Ramsay Jones
Signed-off-by: Ramsay Jones --- Hi Duy, If you need to re-roll your 'nd/shallow-deepen' branch, could you please squash this into the relevant patch (ie "fetch: define shallow boundary with --shallow-exclude", 23-02-2016). Thanks! ATB, Ramsay Jones

Re: [PATCHv16 0/7] Expose submodule parallelism to the user

2016-02-24 Thread Jonathan Nieder
Stefan Beller wrote: > This build on top of 163b9b1f919c762a4bfb693b3aa05ef1aa627fee > (origin/sb/submodule-parallel-update~5) and replace the series from there on. Except for the comments in patch 3, Reviewed-by: Jonathan Nieder Thanks for writing it and sorry it took so

Re: [PATCH 3/7] run_processes_parallel: rename parameters for the callbacks

2016-02-24 Thread Jonathan Nieder
Stefan Beller wrote: > +++ b/run-command.h > @@ -159,7 +159,7 @@ typedef int (*get_next_task_fn)(struct child_process *cp, > * the negative signal number. > */ > typedef int (*start_failure_fn)(struct child_process *cp, > - struct strbuf *err, > +

Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jeff King
On Wed, Feb 24, 2016 at 07:27:23PM -0500, Eric Sunshine wrote: > > diff --git a/git-submodule.sh b/git-submodule.sh > > @@ -192,6 +192,16 @@ isnumber() > > +# Sanitize the local git environment for use within a submodule. We > > +# can't simply use clear_local_git_env since we want to preserve

[PATCH 7/7] clone: allow an explicit argument for parallel submodule clones

2016-02-24 Thread Stefan Beller
Just pass it along to "git submodule update", which may pick reasonable defaults if you don't specify an explicit number. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 6 +- builtin/clone.c |

[PATCH 3/7] run_processes_parallel: rename parameters for the callbacks

2016-02-24 Thread Stefan Beller
The refs code has a similar pattern of passing around 'struct strbuf *err', which is strictly used for error reporting. This is not the case here, as the strbuf is used to accumulate all the output (whether it is error or not) for the user. Rename it to 'out'. Suggested-by: Jonathan Nieder

[PATCH 5/7] git submodule update: have a dedicated helper for cloning

2016-02-24 Thread Stefan Beller
This introduces a new helper function in git submodule--helper which takes care of cloning all submodules, which we want to parallelize eventually. Some tests (such as empty URL, update_mode=none) are required in the helper to make the decision for cloning. These checks have been moved into the C

[PATCH 6/7] submodule update: expose parallelism to the user

2016-02-24 Thread Stefan Beller
Expose possible parallelism either via the "--jobs" CLI parameter or the "submodule.fetchJobs" setting. By having the variable initialized to -1, we make sure 0 can be passed into the parallel processing machine, which will then pick as many parallel workers as there are CPUs. Signed-off-by:

[PATCHv16 0/7] Expose submodule parallelism to the user

2016-02-24 Thread Stefan Beller
This build on top of 163b9b1f919c762a4bfb693b3aa05ef1aa627fee (origin/sb/submodule-parallel-update~5) and replace the series from there on. Thanks Jonathan and Junio for discussion! * instead of sophisticatedly adding \n's, require the callbacks to be sane. * rename strbuf 'err' to 'out'. * no

[PATCH 1/7] run_processes_parallel: treat output of children as byte array

2016-02-24 Thread Stefan Beller
We do not want the output to be interrupted by a NUL byte, so we cannot use raw fputs. Introduce strbuf_write to avoid having long arguments in run-command.c. Signed-off-by: Stefan Beller --- run-command.c | 8 strbuf.c | 6 ++ strbuf.h | 6 ++ 3

[PATCH 2/7] run-command: expose default_{start_failure, task_finished}

2016-02-24 Thread Stefan Beller
We want to reuse the error reporting facilities in a later patch. Signed-off-by: Stefan Beller --- run-command.c | 18 +- run-command.h | 19 +++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/run-command.c b/run-command.c

[PATCH 4/7] run_processes_parallel: correctly terminate callbacks with an LF

2016-02-24 Thread Stefan Beller
As the strbufs passed around collect all output to the user, and there is no post processing involved we need to care about the line ending ourselves. Signed-off-by: Stefan Beller --- run-command.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run-command.c

Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jeff King
On Wed, Feb 24, 2016 at 03:59:12PM -0800, Jacob Keller wrote: > +int sanitize_submodule_config(const char *var, const char *value, void *data) > +{ > + struct strbuf quoted = STRBUF_INIT; > + struct strbuf *out = data; > + > + if (submodule_config_ok(var)) { > + if

Re: [PATCHv15 2/5] run_processes_parallel: add LF when caller is sloppy

2016-02-24 Thread Jonathan Nieder
Stefan Beller wrote: > On Wed, Feb 24, 2016 at 1:19 PM, Jonathan Nieder wrote: > > Stefan Beller wrote: >>> When the callers of parallel processing machine are sloppy with their >>> messages, make sure the output is terminated with LF after one child >>> process is handled.

Re: [PATCH v6 03/32] files-backend: break out ref reading

2016-02-24 Thread Junio C Hamano
Junio C Hamano writes: > ... > You can of course standardize on signed int, but because this is a > collection of flag bits, there is no reason not to choose unsigned. > > I _think_ I can fix everything up before pushing out, so please > check what will appear on 'pu' before

Re: Rebase performance

2016-02-24 Thread Duy Nguyen
On Thu, Feb 25, 2016 at 5:09 AM, Christian Couder wrote: > Another possibility would be to libify the "git apply" functionality > and then to use the libified "git apply" in run_apply() instead of > launching a separate "git apply" process. One benefit from this is >

Re: reflog: weird options

2016-02-24 Thread Junio C Hamano
David Turner writes: > The manual for git reflog says it takes "[log-options]". And it does, > sort-of. For instance, you can give a path, and it will only show you > reflog entries that touch that path (I'm not sure why you would want to > do that, but you can!).

Re: [PATCH] git: submodule honor -c credential.* from command line

2016-02-24 Thread Junio C Hamano
Jacob Keller writes: Add a git submodule--helper function which can be used to sanitize the GIT_CONFIG_PARAMETERS value to only allow certain settings. For now, restrict this to only credential.* settings. >>> >>> I guess for now that subset is fine and

Re: [PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Eric Sunshine
On Wed, Feb 24, 2016 at 6:59 PM, Jacob Keller wrote: > Due to the way that the git-submodule code works, it clears all local > git environment variables before entering submodules. This is normally > a good thing since we want to clear settings such as GIT_WORKTREE and >

Re: Rebase performance

2016-02-24 Thread Stefan Beller
On Wed, Feb 24, 2016 at 4:15 PM, Jacob Keller wrote: > On Wed, Feb 24, 2016 at 2:09 PM, Christian Couder > wrote: >> Hi, >> Another possibility would be to libify the "git apply" functionality >> and then to use the libified "git apply" in

Re: [PATCH v6 04/32] refs: move resolve_ref_unsafe into common code

2016-02-24 Thread Junio C Hamano
David Turner writes: > + for (symref_count = 0; symref_count < SYMREF_MAXDEPTH; symref_count++) { > + int read_flags = 0; Continuing from the previous one, this becomes "unsigned int". -- To unsubscribe from this list: send the line "unsubscribe git" in

Re: [PATCH v6 03/32] files-backend: break out ref reading

2016-02-24 Thread Junio C Hamano
David Turner writes: > Refactor resolve_ref_1 in terms of a new function read_raw_ref, which > is responsible for reading ref data from the ref storage. > > Later, we will make read_raw_ref a pluggable backend function, and make > resolve_ref_unsafe common. > > Testing

Re: Rebase performance

2016-02-24 Thread Jacob Keller
On Wed, Feb 24, 2016 at 2:09 PM, Christian Couder wrote: > Hi, > Another possibility would be to libify the "git apply" functionality > and then to use the libified "git apply" in run_apply() instead of > launching a separate "git apply" process. One benefit from this

Re: [PATCH v6 00/32] refs backend

2016-02-24 Thread Ramsay Jones
On 24/02/16 22:58, David Turner wrote: > This version incorporates fixes for function scope from Ramsay Jones. > > It breaks patches down a bit more, to make them easier to review and > understand. Michael Haggerty had some suggestions here. > > As suggested by Duy Nguyen, it replaces the

Re: git mv messed up file mapping if folders contain identical files

2016-02-24 Thread Bill Okara
following are the steps to help illustrate the issue. its actually quite common to have projects include identical placeholder files before update/refactoring... // Create in master branch > mkdir gittest > cd gittest > init > mkdir -p gitmvtest/resources > mkdir -p gitmvtest/resources/demo >

reflog: weird options

2016-02-24 Thread David Turner
The manual for git reflog says it takes "[log-options]". And it does, sort-of. For instance, you can give a path, and it will only show you reflog entries that touch that path (I'm not sure why you would want to do that, but you can!). But you can also give --merges, which will silently give

[PATCH v2] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jacob Keller
From: Jacob Keller Due to the way that the git-submodule code works, it clears all local git environment variables before entering submodules. This is normally a good thing since we want to clear settings such as GIT_WORKTREE and other variables which would affect the

Re: git mv messed up file mapping if folders contain identical files

2016-02-24 Thread Bill Okara
it actually does matter in the following scenario: 1) master branch has identical content.txt files in the folder structure 2) do the git mv in a new branch 3) master branch updated the context.txt to contain new data (more relevant to the containing folder) 4) new branch need to merge the

Re: [PATCH] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jacob Keller
On Wed, Feb 24, 2016 at 3:36 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Wed, Feb 24, 2016 at 12:09 PM, Jacob Keller >> wrote: >>> From: Jacob Keller >>> >>> Due to the way that the

Re: [PATCH] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jacob Keller
Hi, On Wed, Feb 24, 2016 at 3:27 PM, Stefan Beller wrote: > On Wed, Feb 24, 2016 at 12:09 PM, Jacob Keller > wrote: >> From: Jacob Keller >> Add a git submodule--helper function which can be used to sanitize the >>

Re: git mv messed up file mapping if folders contain identical files

2016-02-24 Thread Junio C Hamano
Bill Okara writes: > just want to see if this is a bug, user error (on my end), or?? Not a bug, not a user error, just "it does not matter", I think. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org

git mv messed up file mapping if folders contain identical files

2016-02-24 Thread Bill Okara
Hi, I noticed the following 'git mv' issue with: git version 2.6.4 If there are identical files in different subfolders, 'git mv' the root folder (and/or each file individually) will mess up the file path mapping. that is, if having identical 'content.txt' file under gitmvtest

Re: [PATCH] git: submodule honor -c credential.* from command line

2016-02-24 Thread Junio C Hamano
Stefan Beller writes: > On Wed, Feb 24, 2016 at 12:09 PM, Jacob Keller > wrote: >> From: Jacob Keller >> >> Due to the way that the git-submodule code works, it clears all local >> git environment variables before entering

Re: [PATCH] git: submodule honor -c credential.* from command line

2016-02-24 Thread Stefan Beller
On Wed, Feb 24, 2016 at 12:09 PM, Jacob Keller wrote: > From: Jacob Keller > > Due to the way that the git-submodule code works, it clears all local > git environment variables before entering submodules. This is normally > a good thing since we

Re: [PATCH] unpack-trees: do not delete i-t-a entries in worktree even when forced

2016-02-24 Thread Junio C Hamano
Junio C Hamano writes: > Nguyễn Thái Ngọc Duy writes: > >> Intent-to-add entries are basically "I may want to commit these files >> later, but for now they are untracked". As such, when the user does "git >> reset --hard ", which removes i-t-a entries from

[PATCH] git: submodule honor -c credential.* from command line

2016-02-24 Thread Jacob Keller
From: Jacob Keller Due to the way that the git-submodule code works, it clears all local git environment variables before entering submodules. This is normally a good thing since we want to clear settings such as GIT_WORKTREE and other variables which would affect the

RE: Some strange behavior of git

2016-02-24 Thread Randall S. Becker
On February 24, 2016 5:43 PM, Olga Pshenichnikova wrote > What can be cause for further confusing behavior? > > git@ip5server:~$ git status > On branch master > Untracked files: >(use "git add ..." to include in what will be committed) > > app/addons/arliteks/ >

[PATCH v6 17/32] refs: move duplicate check to common code

2016-02-24 Thread David Turner
The check for duplicate refnames in a transaction is needed for all backends, so move it to the common code. ref_transaction_commit_fn gains a new argument, the sorted string_list of affected refnames. Signed-off-by: David Turner --- refs.c | 69

[PATCH v6 22/32] refs: always handle non-normal refs in files backend

2016-02-24 Thread David Turner
Always handle non-normal (per-worktree or pseudo) refs in the files backend instead of alternate backends. Sometimes a ref transaction will update both a per-worktree ref and a normal ref. For instance, an ordinary commit might update refs/heads/master and HEAD (or at least HEAD's reflog).

[PATCH v6 28/32] config: read ref storage config on startup

2016-02-24 Thread David Turner
This sets up the existing backend early, so that other code which reads refs is reading from the right place. Signed-off-by: David Turner --- config.c | 24 1 file changed, 24 insertions(+) diff --git a/config.c b/config.c index

[PATCH v6 13/32] refs: add methods to init refs db

2016-02-24 Thread David Turner
Alternate refs backends might not need the refs/heads directory and so on, so we make ref db initialization part of the backend. Signed-off-by: David Turner --- builtin/init-db.c| 20 ++-- refs.c | 5 + refs.h | 2

[PATCH v6 01/32] refs: move head_ref{,_submodule} to the common code

2016-02-24 Thread David Turner
These don't use any backend-specific functions. These were previously defined in terms of the do_head_ref helper function, but since they are otherwise identical, we don't need that function. Signed-off-by: David Turner --- refs.c | 23

[PATCH v6 10/32] refs: add methods for reflog

2016-02-24 Thread David Turner
In the file-based backend, the reflog piggybacks on the ref lock. Since other backends won't have the same sort of ref lock, ref backends must also handle reflogs. Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner --- refs.c

[PATCH v6 32/32] tests: add ref-storage argument

2016-02-24 Thread David Turner
Add a --ref-storage argument to make it easy to test alternate ref storage backends. This means that every test that calls git init or git clone must use the new ref storage argument. Modify many tests to work under alternate ref storage backends. Introduce abstractions for raw ref/reflog

[PATCH v6 29/32] refs: break out resolve_ref_unsafe_submodule

2016-02-24 Thread David Turner
It will soon be useful for resolve_ref_unsafe to support submodules. But since it is called from so many places, changing it would have been painful. Fortunately, it's just a thin wrapper around (the former) resolve_ref_1. So now resolve_ref_1 becomes resolve_ref_unsafe_submodule, and it passes

[PATCH v6 09/32] refs: add do_for_each_per_worktree_ref

2016-02-24 Thread David Turner
Alternate refs backends might still use files to store per-worktree refs. So the files backend's ref-loading infrastructure should be available to those backends, just for use on per-worktree refs. Add do_for_each_per_worktree_ref, which iterates over per-worktree refs. Signed-off-by: David

[PATCH v6 21/32] refs: resolve symbolic refs first

2016-02-24 Thread David Turner
Before committing ref updates, split symbolic ref updates into two parts: an update to the underlying ref, and a log-only update to the symbolic ref. This ensures that both references are locked correctly while their reflogs are updated. It is still possible to confuse git by concurrent updates,

[PATCH v6 24/32] refs: check submodules' ref storage config

2016-02-24 Thread David Turner
All submodules must have the same ref storage (for now). Confirm that this is so before attempting to do anything with submodule refs. Signed-off-by: David Turner --- refs.c | 54 refs.h

[PATCH v6 02/32] refs: move for_each_*ref* functions into common code

2016-02-24 Thread David Turner
Make do_for_each_ref take a submodule as an argument instead of a ref_cache. Since all for_each_*ref* functions are defined in terms of do_for_each_ref, we can then move them into the common code. Later, we can simply make do_for_each_ref into a backend function. Signed-off-by: David Turner

[PATCH v6 07/32] refs: add method for do_for_each_ref

2016-02-24 Thread David Turner
Add a ref backend method for do_for_each_ref. Signed-off-by: David Turner --- refs.c | 8 refs/files-backend.c | 7 +-- refs/refs-internal.h | 5 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index

[PATCH v6 16/32] refs: make lock generic

2016-02-24 Thread David Turner
Instead of using a files-backend-specific struct ref_lock, the generic ref_transaction struct should provide a void pointer that backends can use for their own lock data. Signed-off-by: David Turner --- refs/files-backend.c | 29 -

[PATCH v6 20/32] refs: on symref reflog expire, lock symref not referrent

2016-02-24 Thread David Turner
When locking a symbolic ref to expire a reflog, lock the symbolic ref (using REF_NODEREF) instead of its referent. Add a test for this. Signed-off-by: David Turner --- refs/files-backend.c | 3 ++- t/t1410-reflog.sh| 10 ++ 2 files changed, 12

[PATCH v6 15/32] refs: handle non-normal ref renames

2016-02-24 Thread David Turner
Forbid cross-backend ref renames. This would be pretty weird, but since it will break, we should prevent it. Also make the files backend deal with all non-normal ref renames. Signed-off-by: David Turner --- refs.c | 12 +++- 1 file changed, 11 insertions(+),

[PATCH v6 23/32] init: allow alternate ref strorage to be set for new repos

2016-02-24 Thread David Turner
git init learns a new argument --ref-storage. Presently, only "files" is supported, but later we will add other storage backends. When this argument is used, the repository's extensions.refStorage configuration value is set (as well as core.repositoryformatversion), and the ref storage backend's

[PATCH v6 27/32] refs: register ref storage backends

2016-02-24 Thread David Turner
Add new function register_ref_storage_backends(). This new function registers all known ref storage backends... once there are any other than the default. For now, it just registers the files backend. Call the function before calling set_ref_storage_backend. Signed-off-by: David Turner

[PATCH v6 11/32] refs: add method for initial ref transaction commit

2016-02-24 Thread David Turner
Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner --- refs.c | 6 ++ refs/files-backend.c | 5 +++-- refs/refs-internal.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index

[PATCH v6 30/32] refs: add LMDB refs storage backend

2016-02-24 Thread David Turner
Add a database backend for refs using LMDB. This backend runs git for-each-ref about 30% faster than the files backend with fully-packed refs on a repo with ~120k refs. It's also about 4x faster than using fully-unpacked refs. In addition, and perhaps more importantly, it avoids case-conflict

[PATCH v6 14/32] refs: add method to rename refs

2016-02-24 Thread David Turner
Signed-off-by: David Turner --- refs.c | 5 + refs/files-backend.c | 4 +++- refs/refs-internal.h | 8 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index baf83ac..3a2ad5e 100644 --- a/refs.c +++ b/refs.c @@

[PATCH v6 08/32] refs: reduce the visibility of do_for_each_ref()

2016-02-24 Thread David Turner
From: Ramsay Jones Now that we have moved do_for_each_ref into refs.c, it no longer needs to be public. Signed-off-by: Ramsay Jones --- refs.c | 19 +++ refs/refs-internal.h | 6 -- 2 files changed,

[PATCH v6 12/32] refs: add method for delete_refs

2016-02-24 Thread David Turner
In the file-based backend, delete_refs has some special optimization to deal with packed refs. In other backends, we might be able to make ref deletion faster by putting all deletions into a single transaction. So we need a special backend function for this. Signed-off-by: David Turner

[PATCH v6 25/32] clone: allow ref storage backend to be set for clone

2016-02-24 Thread David Turner
Add a new option, --ref-storage, to allow the ref storage backend to be set on new clones. Submodules must use the same ref storage as the parent repository, so we also pass the --ref-storage option option when cloning submodules. Signed-off-by: David Turner

[PATCH v6 31/32] refs: tests for lmdb backend

2016-02-24 Thread David Turner
Add tests for the database backend. Signed-off-by: David Turner Helped-by: Dennis Kaarsemaker --- t/t1460-refs-lmdb-backend.sh| 1109 +++ t/t1470-refs-lmdb-backend-reflog.sh | 359

[PATCH v6 26/32] svn: learn ref-storage argument

2016-02-24 Thread David Turner
git svn learns to pass the ref-storage command-line argument (to init and clone) through to git init. Signed-off-by: David Turner Signed-off-by: SZEDER Gábor Signed-off-by: Eric Wong --- contrib/completion/git-completion.bash

[PATCH v6 19/32] refs: don't dereference on rename

2016-02-24 Thread David Turner
When renaming refs, don't dereference either the origin or the destination before renaming. The origin does not need to be dereferenced because it is presently forbidden to rename symbolic refs. Not dereferencing the destination fixes a bug where renaming on top of a broken symref would use the

[PATCH v6 18/32] refs: allow log-only updates

2016-02-24 Thread David Turner
The refs infrastructure learns about log-only ref updates, which only update the reflog. Later, we will use this to separate symbolic reference resolution from ref updating. Signed-off-by: David Turner --- refs/files-backend.c | 15 ++-

[PATCH v6 06/32] refs: add methods for misc ref operations

2016-02-24 Thread David Turner
From: Ronnie Sahlberg Add ref backend methods for: read_raw_ref, verify_refname_available, pack_refs, peel_ref, create_symref, resolve_gitlink_ref. read_raw_ref becomes static because it's not used outside refs.c Signed-off-by: Ronnie Sahlberg

[PATCH v6 03/32] files-backend: break out ref reading

2016-02-24 Thread David Turner
Refactor resolve_ref_1 in terms of a new function read_raw_ref, which is responsible for reading ref data from the ref storage. Later, we will make read_raw_ref a pluggable backend function, and make resolve_ref_unsafe common. Testing done: Hacked in code to run both old and new version of

[PATCH v6 04/32] refs: move resolve_ref_unsafe into common code

2016-02-24 Thread David Turner
Now that resolve_ref_unsafe's only interaction with the backend is through read_raw_ref, we can move it into the common code. Later, we'll replace read_raw_ref with a backend function. Signed-off-by: David Turner --- refs.c | 104

[PATCH v6 05/32] refs: add a backend method structure with transaction functions

2016-02-24 Thread David Turner
From: Ronnie Sahlberg Add a ref structure for storage backend methods. Start by adding a method pointer for the transaction commit function. Add a function set_refs_backend to switch between storage backends. The files based storage backend is the default. Signed-off-by:

[PATCH v6 00/32] refs backend

2016-02-24 Thread David Turner
This version incorporates fixes for function scope from Ramsay Jones. It breaks patches down a bit more, to make them easier to review and understand. Michael Haggerty had some suggestions here. As suggested by Duy Nguyen, it replaces the resolve_ref_unsafe backend method with read_raw_ref,

Re: [PATCH] unpack-trees: do not delete i-t-a entries in worktree even when forced

2016-02-24 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Intent-to-add entries are basically "I may want to commit these files > later, but for now they are untracked". As such, when the user does "git > reset --hard ", which removes i-t-a entries from the index, i-t-a > entries in worktree should be

Re: Some strange behavior of git

2016-02-24 Thread Stefan Beller
On Wed, Feb 24, 2016 at 2:43 PM, Olga Pshenichnikova wrote: > Hello, > we use git in our project. > What can be cause for further confusing behavior? > > git@ip5server:~$ git status > On branch master > Untracked files: > (use "git add ..." to include in what will

Some strange behavior of git

2016-02-24 Thread Olga Pshenichnikova
Hello, we use git in our project. What can be cause for further confusing behavior? git@ip5server:~$ git status On branch master Untracked files: (use "git add ..." to include in what will be committed) app/addons/arliteks/ nothing added to commit but untracked

Re: [PATCH v2] git config: report when trying to modify a non-existing repo config

2016-02-24 Thread Junio C Hamano
Junio C Hamano writes: > Johannes Schindelin writes: > >> diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh >> index 91235b7..f62409e 100755 >> --- a/t/t1308-config-set.sh >> +++ b/t/t1308-config-set.sh >> @@ -218,4 +218,13 @@

using git-diff as a diff replacement?

2016-02-24 Thread Jacob Keller
Hey, I know that running "git diff " when outside a git project will result in a normal diff being run. I happen to prefer the diff algorithm and diff output of "git diff" but there does not seem to be a way to have this behavior from within a git tree. Is there a way to pass an option to

  1   2   >