[PATCH v4 2/2] diff: don't read index when --no-index is given

2013-12-11 Thread Thomas Gummerer
git diff --no-index ... currently reads the index, during setup, when calling gitmodules_config(). This results in worse performance when the index is not actually needed. This patch avoids calling gitmodules_config() when the --no-index option is given. The times for executing git diff

[PATCH v4 1/2] diff: move no-index detection to builtin/diff.c

2013-12-11 Thread Thomas Gummerer
Currently the --no-index option is parsed in diff_no_index(). Move the detection if a no-index diff should be executed to builtin/diff.c, where we can use it for executing diff_no_index() conditionally. This will also allow us to execute other operations conditionally, which will be done in the

Re: Unexpected cherry-pick behaviour

2013-12-11 Thread Paulo Matos
On 10/12/2013 19:34, Junio C Hamano wrote: Perhaps immediately after cherry-pick stopped and asked your help to resolve the conflicts, running $ git checkout --conflicts=diff3 gcc/tree-ssa-threadedge.c and looking at the file again may show you what is going on better. I don't know

Re: Unexpected cherry-pick behaviour

2013-12-11 Thread Antoine Pelisse
On Wed, Dec 11, 2013 at 11:04 AM, Paulo Matos pa...@matos-sorge.com wrote: On 10/12/2013 19:34, Junio C Hamano wrote: Perhaps immediately after cherry-pick stopped and asked your help to resolve the conflicts, running $ git checkout --conflicts=diff3 gcc/tree-ssa-threadedge.c and

Re: Unexpected cherry-pick behaviour

2013-12-11 Thread Paulo Matos
On 11/12/2013 11:09, Antoine Pelisse wrote: I don't know how to interpret the fact that the line you sent (with the obvious --conflicts being --conflict) outputs nothing... That is expected. git-checkout with this option [1] will reset the conflict on gcc/tree-ssa-threadedge.c file to the

[PATCH v7 0/4] Show extra branch refs in gitweb

2013-12-11 Thread Krzesimir Nowak
First patch splits some code to a function. Second patch fixes validation functions to return either 0 or 1, instead of undef or passed $input. Third patch adds the extra-branch-feature and some documentation. Fourth patch adds some visual differentation of branches from non-standard ref

[PATCH v7 1/4] gitweb: Move check-ref-format code into separate function

2013-12-11 Thread Krzesimir Nowak
This check will be used in more than one place later. Signed-off-by: Krzesimir Nowak krzesi...@endocode.com --- gitweb/gitweb.perl | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 68c77f6..46bd6ac 100755 ---

[PATCH v7 3/4] gitweb: Add a feature for adding more branch refs

2013-12-11 Thread Krzesimir Nowak
Allow extra-branch-refs feature to tell gitweb to show refs from additional hierarchies in addition to branches in the list-of-branches view. Signed-off-by: Krzesimir Nowak krzesi...@endocode.com --- Documentation/gitweb.conf.txt | 37 gitweb/gitweb.perl| 80

Re: [BUG] echo HEAD | git cat-file --batch='' fails catastrophically

2013-12-11 Thread Jeff King
On Tue, Dec 10, 2013 at 11:37:14PM -0500, Samuel Bronson wrote: % echo HEAD | git cat-file --batch= fatal: object fde075cb72fc0773d8e8ca93d55a35d77bb6688b changed type!? Without the =, it works fine; with a string that has both %(objecttype) and %(objectsize), it's fine; but when you

[PATCH v7 4/4] gitweb: Denote non-heads, non-remotes branches

2013-12-11 Thread Krzesimir Nowak
Given two branches residing in refs/heads/master and refs/wip/feature the list-of-branches view will present them in following way: master feature (wip) When getting a snapshot of a 'feature' branch, the tarball is going to have name like 'project-wip-feature-short hash.tgz'. Signed-off-by:

[PATCH v7 2/4] gitweb: Return 1 on validation success instead of passed input

2013-12-11 Thread Krzesimir Nowak
Users of validate_* passing 0 might get failures on correct name because of coercion of 0 to false in code like: die_error(500, invalid ref) unless (check_ref_format (0)); Also, the validate_foo subs are renamed to is_valid_foo. Signed-off-by: Krzesimir Nowak krzesi...@endocode.com ---

[PATCH 1/2] cat-file: pass expand_data to print_object_or_die

2013-12-11 Thread Jeff King
We currently individually pass the sha1, type, and size fields calculated by sha1_object_info. However, if we pass the whole struct, the called function can make more intelligent decisions about which fields were actualled filled by sha1_object_info. As a side effect, we can rename the local

[PATCH 2/2] cat-file: handle --batch format with missing type/size

2013-12-11 Thread Jeff King
Commit 98e2092 taught cat-file to stream blobs with --batch, which requires that we look up the object type before loading it into memory. As a result, we now print the object header from information in sha1_object_info, and the actual contents from the read_sha1_file. We double-check that the

[PATCH/POC 0/7] Support multiple worktrees

2013-12-11 Thread Nguyễn Thái Ngọc Duy
This is what I imagine multi worktree support (aka git-new-workdir) looks like. Basically two variables will control access to the repo: $GIT_SUPER_DIR for worktree specific stuff and $GIT_DIR for the rest. I like the idea of using git_path() to hide path relocation caused by GIT_SUPER_DIR, but I

[PATCH/POC 1/7] Make git_path() beware of file relocation in $GIT_DIR

2013-12-11 Thread Nguyễn Thái Ngọc Duy
We allow the user to relocate certain paths out of $GIT_DIR via environment variables, e.g. GIT_OBJECT_DIRECTORY, GIT_INDEX_FILE and GIT_GRAFT_FILE. All callers are not supposed to use git_path() or git_pathdup() to get those paths. Instead they must use get_object_directory(), get_index_file()

[PATCH/POC 3/7] setup.c: add split-repo support to .git files

2013-12-11 Thread Nguyễn Thái Ngọc Duy
If a .git file contains gitsuper: path gitdir: id then we set GIT_SUPER_DIR to path and GIT_DIR to $GIT_SUPER_DIR/repos/id. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h | 1 + setup.c | 40 +--- 2 files changed, 34 insertions(+), 7

[PATCH/POC 2/7] Add new environment variable $GIT_SUPER_DIR

2013-12-11 Thread Nguyễn Thái Ngọc Duy
This is the base for git-new-workdir integration. The git-new-workdir script creates a separate worktree that shares everything except worktree-related stuff. The sharing is eanbled by this new env variable. In the new worktree, both variables are set at the same time, GIT_DIR and GIT_SUPER_DIR.

[PATCH/POC 5/7] setup.c: reduce cleanup sites in setup_explicit_git_dir()

2013-12-11 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- setup.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/setup.c b/setup.c index 43f56fb..dfe9d08 100644 --- a/setup.c +++ b/setup.c @@ -388,16 +388,13 @@ static const char

[PATCH/POC 4/7] setup.c: add split-repo support to is_git_directory()

2013-12-11 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- setup.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/setup.c b/setup.c index 84362a6..43f56fb 100644 --- a/setup.c +++ b/setup.c @@ -182,28 +182,31 @@ void verify_non_filename(const char *prefix,

[PATCH/POC 7/7] init: add --split-repo with the same functionality as git-new-workdir

2013-12-11 Thread Nguyễn Thái Ngọc Duy
git init --split-repo abc will create abc/.git file with the content gitsuper: `git rev-parse --git-dir` gitdir: abc and a new directory in current .git/repos/abc with a valid HEAD. This is enough to start checking out and do stuff. We should probably take a branch name and check that branch

[PATCH/POC 6/7] setup.c: add split-repo support to setup_git_directory*

2013-12-11 Thread Nguyễn Thái Ngọc Duy
XXX bare repos probably not worth supporting.. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h | 1 + environment.c | 19 -- setup.c | 62 +++ trace.c | 1 + 4 files changed, 60

[Question] Git recovery with HEAD commit broken

2013-12-11 Thread Shilong Wang
I am not a developer for git, but i am a regular user with git, i came the following problem: A power off cause my top commit broken, and then git branch/log/reflog..etc won't work. I do a hack that i change the HEAD commit to the one that i can make sure is right, and then i do: # git reset

Re: [Question] Git recovery with HEAD commit broken

2013-12-11 Thread Matthieu Moy
Shilong Wang wangshilong1...@gmail.com writes: A power off cause my top commit broken, and then git branch/log/reflog..etc won't work. With a bit of luck, the reflog actually contain useful information. Look at .git/logs/HEAD (or refs/heads/* instead of HEAD for branches' reflog). It's a

Re: [PATCH] t5541: Improve push test

2013-12-11 Thread Torsten Bögershausen
On 2013-12-09 23.10, Junio C Hamano wrote: Torsten Bögershausen tbo...@web.de writes: The old log-line looked like this: + 9d498b0...8598732 master - master (forced update) And the new one like this: 9d498b0..8598732 master - master - Loosen the grep pattern by not demanding (forced

Re: [PATCH v7 2/4] gitweb: Return 1 on validation success instead of passed input

2013-12-11 Thread Jakub Narębski
On Wed, Dec 11, 2013 at 12:54 PM, Krzesimir Nowak krzesi...@endocode.com wrote: Users of validate_* passing 0 might get failures on correct name because of coercion of 0 to false in code like: die_error(500, invalid ref) unless (check_ref_format (0)); Very minor issue: there is no

Re: [Question] Git recovery with HEAD commit broken

2013-12-11 Thread Joey Hess
Matthieu Moy wrote: Not as far as I know. But git fsck has a --lost-found option that can help recovering unreachable (dangling) commits. You may have a look at http://hackage.haskell.org/package/git-repair but I do not think it would solve your particular case. Well, let's find out.. I

gitk Parent is wrong

2013-12-11 Thread Stepan Kasal
Hello. I noticed a bug in gitk (as delivered with Git for Windows 1.8.4.msysgit.0). The description of the current commit (left down quarter) does contain items Parent: and Child:. This is not true if gitk is called with a path parameter. These should actually be labeled Previous and Next, as

git gui clone bug

2013-12-11 Thread Stepan Kasal
Hello, I tried to use git gui in an empty dir (via Git Cheetah). I selected to clone from a file:///Y:/subdir/foo.git The result differed from the usual git clone URL, as the newly created master branch was not set to track origin/master. git pull failed. When I start by git clone, I can

Re: [Question] Git recovery with HEAD commit broken

2013-12-11 Thread Jonathan Nieder
Joey Hess wrote: [2] A particularly annoying one is that git branch -d cannot be used to remove a branch that is directly pointing to a corrupted commit! It's generally considered okay for everyday commands like git branch -d not to cope well with corrupted repositories, but we try to keep

Re: [PATCH 1/2] cat-file: pass expand_data to print_object_or_die

2013-12-11 Thread Jonathan Nieder
Hi, Jeff King wrote: However, if we pass the whole struct, the called function can make more intelligent decisions about which fields were actualled filled by sha1_object_info. Thanks. s/actualled/actually/, I think. At first I thought this patch was

Re: [PATCH 2/2] cat-file: handle --batch format with missing type/size

2013-12-11 Thread Jonathan Nieder
Jeff King wrote: We could do the same for the type. However, besides our consistency check, we also care about the type in deciding whether to stream or not. We therefore make sure to always trigger a type lookup when we are printing, so that This We make sure is the behavior after this

Re: Publishing filtered branch repositories - workflow / recommendations?

2013-12-11 Thread Jens Lehmann
Am 10.12.2013 00:56, schrieb Junio C Hamano: Heiko Voigt hvo...@hvoigt.net writes: On Fri, Dec 06, 2013 at 02:40:15PM -0500, Martin Langhoff wrote: On Fri, Dec 6, 2013 at 3:48 AM, Jens Lehmann jens.lehm...@web.de wrote: Right you are, we need tutorials for the most prominent use cases. In

Re: git-submodule.sh respects submodule.$name.update in .git/config but not .gitmodules

2013-12-11 Thread Jens Lehmann
Am 10.12.2013 00:40, schrieb Junio C Hamano: Heiko Voigt hvo...@hvoigt.net writes: This notion has changed in a way that only the url (by that the name) should be copied on init. The default for everything else should come from .gitmodules or gits own default. I think you need to be a bit

Re: [git] Re: git-submodule.sh respects submodule.$name.update in .git/config but not .gitmodules

2013-12-11 Thread W. Trevor King
On Wed, Dec 11, 2013 at 11:26:17PM +0100, Jens Lehmann wrote: Am 10.12.2013 00:40, schrieb Junio C Hamano: Heiko Voigt hvo...@hvoigt.net writes: This notion has changed in a way that only the url (by that the name) should be copied on init. The default for everything else should come from

Re: [PATCH 1/2] cat-file: pass expand_data to print_object_or_die

2013-12-11 Thread Jeff King
On Wed, Dec 11, 2013 at 12:11:12PM -0800, Jonathan Nieder wrote: However, if we pass the whole struct, the called function can make more intelligent decisions about which fields were actualled filled by sha1_object_info. Thanks.

Re: [PATCH 2/2] cat-file: handle --batch format with missing type/size

2013-12-11 Thread Jeff King
On Wed, Dec 11, 2013 at 12:42:00PM -0800, Jonathan Nieder wrote: We could do the same for the type. However, besides our consistency check, we also care about the type in deciding whether to stream or not. We therefore make sure to always trigger a type lookup when we are printing, so

Re: Publishing filtered branch repositories - workflow / recommendations?

2013-12-11 Thread Junio C Hamano
Jens Lehmann jens.lehm...@web.de writes: I think this is closely related to Martin's list of wishes we earlier saw in the thread: remind the user to push necessary submodule tip before the top-level commit that needs that commit in the submodule is pushed out. Giving projects a way to

Re: [PATCH 2/2] cat-file: handle --batch format with missing type/size

2013-12-11 Thread Jonathan Nieder
Jeff King wrote: Updated patch is below. Thanks! v2 of both patches looks good. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[RFC] HACK: use anchor mark instead of sel tag

2013-12-11 Thread Max Kirillov
--- I hacked somehow around this. It seems that just usilg the anchor mark should be enough to implement almost the same behavior. The hard part is that I don't know which feature is intentional and which is just random consequence of using sel for search highlight. One thing which seems to me

I have end-of-lifed cvsps

2013-12-11 Thread Eric S. Raymond
On the git tools wiki, the first paragraph of the entry for cvsps now reads: Warning: this code has been end-of-lifed by its maintainer in favor of cvs-fast-export. Several attempts over the space of a year to repair its deficient branch analysis and tag assignment have failed. Do not

Re: git-submodule.sh respects submodule.$name.update in .git/config but not .gitmodules

2013-12-11 Thread Junio C Hamano
W. Trevor King wk...@tremily.us writes: For safety, maybe the default `init` should copy *everything* into .git/config, after which users can remove stuff they'd like to delegate to .gitmodules. Copying everything into config is be unsafe and inconvenient by default for everybody, isn't it?

Re: [PATCH 1/2] cat-file: pass expand_data to print_object_or_die

2013-12-11 Thread Junio C Hamano
Jeff King p...@peff.net writes: It technically does typo-fix the error message, which I guess is a functional change. But I didn't count that. :) Here it is with the commit message fixes and your reviewed-by. Thanks, both. Will queue, to eventually merge to 'maint'. -- 8 -- Subject:

Re: [PATCH 2/2] cat-file: handle --batch format with missing type/size

2013-12-11 Thread Junio C Hamano
Jeff King p...@peff.net writes: Yes. The loss of the optimization was a small thing compared to being totally broken. :) ... Reviewed-by: Jonathan Nieder jrnie...@gmail.com Thanks. Updated patch is below. ;-) I like it when I see patches are polished between the submitter and reviewer(s)

Re: I have end-of-lifed cvsps

2013-12-11 Thread Martin Langhoff
On Wed, Dec 11, 2013 at 7:17 PM, Eric S. Raymond e...@thyrsus.com wrote: I tried very hard to salvage this program - the ability to remote-fetch CVS repos without rsync access was appealing Is that the only thing we lose, if we abandon cusps? More to the point, is there today an incremental

Re: I have end-of-lifed cvsps

2013-12-11 Thread Eric S. Raymond
Martin Langhoff martin.langh...@gmail.com: On Wed, Dec 11, 2013 at 7:17 PM, Eric S. Raymond e...@thyrsus.com wrote: I tried very hard to salvage this program - the ability to remote-fetch CVS repos without rsync access was appealing Is that the only thing we lose, if we abandon cusps? More