[PATCH 1/3] grep: generalize header grep code to accept arbitrary headers

2012-09-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- On Fri, Sep 28, 2012 at 12:09 AM, Junio C Hamano gits...@pobox.com wrote: enum grep_header_field { GREP_HEADER_AUTHOR = 0, - GREP_HEADER_COMMITTER + GREP_HEADER_COMMITTER, + GREP_HEADER_REFLOG, +

[PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-28 Thread Nguyễn Thái Ngọc Duy
Similar to --author/--committer which filters commits by author and committer header fields. --grep-reflog adds a fake reflog header to commit and a grep filter to search on that line. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- On Fri, Sep 28, 2012 at 12:09 AM, Junio C Hamano

Re: git gui does not open bare repositories

2012-09-28 Thread Frans Klaver
On Fri, Sep 28, 2012 at 9:50 AM, Angelo Borsotti angelo.borso...@gmail.com wrote: I have created a bare repository: $ mkdir remote.git angelo@ANGELO-PC /d/gtest (master) $ git init --bare Initialized empty Git repository in d:/gtest/ This creates a bare repository in d:/gtest, not in

Re: git gui does not open bare repositories

2012-09-28 Thread Frans Klaver
Hi, Please remember to reply to all when discussing things on the git mailing list. On Fri, Sep 28, 2012 at 10:29 AM, Angelo Borsotti angelo.borso...@gmail.com wrote: Hello I apologise for having used the wrong script to reproduce the error. This is the right one: angelo@ANGELO-PC

Re: git gui does not open bare repositories

2012-09-28 Thread Stefan Näwe
Am 28.09.2012 10:35, schrieb Frans Klaver: Hi, Please remember to reply to all when discussing things on the git mailing list. On Fri, Sep 28, 2012 at 10:29 AM, Angelo Borsotti angelo.borso...@gmail.com wrote: Hello I apologise for having used the wrong script to reproduce the error.

[PATCH 1/5] completion: fix non-critical bugs in __gitcomp() tests

2012-09-28 Thread SZEDER Gábor
When invoking __gitcomp() the $cur variable should hold the word to be completed, but two tests (checking the handling of prefix and suffix) set it to a bogus value. Luckily the bogus values haven't influenced the tests' correctness, because these two tests pass the word-to-be-matched as argument

[PATCH 3/5] completion: add tests for the __gitcomp_nl() completion helper function

2012-09-28 Thread SZEDER Gábor
Test __gitcomp_nl()'s basic functionality, i.e. that trailing space, prefix, and suffix are added correctly. Signed-off-by: SZEDER Gábor sze...@ira.uka.de --- t/t9902-completion.sh | 47 +++ 1 file changed, 47 insertions(+) diff --git

[PATCH 2/5] completion: fix args of run_completion() test helper

2012-09-28 Thread SZEDER Gábor
To simulate the the user hit 'git TAB, one of the completion tests sets up the rather strange command line git i.e. the second word on the command line consists of two double quotes. However, this is not what happens for real, because after 'git TAB' the second word on the command line is

[PATCH 4/5] completion: test __gitcomp() and __gitcomp_nl() with expandable words

2012-09-28 Thread SZEDER Gábor
compgen performs expansion on all words in the list given to its -W option. This breaks completion in various ways if one of those words can be expanded. The funniest breakage is probably this, as the command_not_found_handle kicks in: $ git branch '$(foo)' $ git branch TABNo command 'foo'

[POC PATCH 5/5] completion: avoid compgen to fix expansion issues in __gitcomp_nl()

2012-09-28 Thread SZEDER Gábor
compgen performs expansion on all words in the list given to its -W option. This breaks completion in various ways if one of those words can be expanded, as demonstrated by failing tests added in a previous commit. In __gitcomp_nl() we use only a small subset of compgen's functionality: to

Re: Stopping git-svn pulling a particular branch

2012-09-28 Thread Jon Seymour
On Fri, Sep 28, 2012 at 2:58 PM, Jon Seymour jon.seym...@gmail.com wrote: G'day An svn developer created a branch from a subdirectory of the trunk rather than by copying trunk itself. I want to avoid pulling this branch into my git repo with git svn fetch because the re-rooting pulls in too

[PATCH] Add __git_ps1_pc to use as PROMPT_COMMAND

2012-09-28 Thread Simon Oosthoek
Hi again After the previous comments, I decided to attempt it using PROMPT_COMMAND rather than calling a function from command substitution in PS1. This new code works and doesn't have the wrapping issue anymore. I've simplified some of the coloring stuff and for now there's no parameters to

Re: Using bitmaps to accelerate fetch and clone

2012-09-28 Thread Nguyen Thai Ngoc Duy
On Thu, Sep 27, 2012 at 7:47 AM, Shawn Pearce spea...@spearce.org wrote: * https://git.eclipse.org/r/7939 Defines the new E003 index format and the bit set implementation logic. Quote from the patch's message: Currently, the new index format can only be used with pack files that contain

[PATCH 00/21] git p4: work on cygwin

2012-09-28 Thread Pete Wyckoff
This series fixes problems in git-p4, and its tests, so that git-p4 works on the cygwin platform. See the wiki for info on how to get started on cygwin: https://git.wiki.kernel.org/index.php/GitP4 Testing by people who use cygwin would be appreciated. It would be good to support cygwin

[PATCH 01/21] git p4: temp branch name should use / even on windows

2012-09-28 Thread Pete Wyckoff
Commit fed2369 (git-p4: Search for parent commit on branch creation, 2012-01-25) uses temporary branches to help find the parent of a new p4 branch. The temp branches are of the form git-p4-tmp/%d for some p4 change number. Mistakenly, this string was made using os.path.join() instead of just

[PATCH 02/21] git p4: remove unused imports

2012-09-28 Thread Pete Wyckoff
Found by pyflakes checker tool. Modules shelve, getopt were unused. Module os.path is exported by os. Reformat one-per-line as is PEP008 suggested style. Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git

[PATCH 03/21] git p4: generate better error message for bad depot path

2012-09-28 Thread Pete Wyckoff
Depot paths must start with //. Exit with a better explanation when a bad depot path is supplied. Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 1 + t/t9800-git-p4-basic.sh | 5 + 2 files changed, 6 insertions(+) diff --git a/git-p4.py b/git-p4.py index

[PATCH 04/21] git p4: fix error message when describe -s fails

2012-09-28 Thread Pete Wyckoff
The output was a bit nonsensical, including a bare %d. Fix it to make it easier to understand. Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index eef5c94..d7ee4b4 100755 --- a/git-p4.py +++

[PATCH 05/21] git p4 test: use client_view to build the initial client

2012-09-28 Thread Pete Wyckoff
Simplify the code a bit by using an existing function. Signed-off-by: Pete Wyckoff p...@padd.com --- t/lib-git-p4.sh | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh index 7061dce..890ee60 100644 --- a/t/lib-git-p4.sh +++

[PATCH 06/21] git p4 test: use client_view in t9806

2012-09-28 Thread Pete Wyckoff
Use the standard client_view function from lib-git-p4.sh instead of building one by hand. This requires a bit of rework, using the current value of $P4CLIENT for the client name. It also reorganizes the test to isolate changes to $P4CLIENT and $cli in a subshell. Signed-off-by: Pete Wyckoff

[PATCH 07/21] git p4 test: start p4d inside its db dir

2012-09-28 Thread Pete Wyckoff
This will avoid having to do native path conversion for windows. Also may be a bit cleaner always to know that p4d has that working directory, instead of wherever the function was called from. Signed-off-by: Pete Wyckoff p...@padd.com --- t/lib-git-p4.sh | 7 +-- 1 file changed, 5

[PATCH 08/21] git p4 test: translate windows paths for cygwin

2012-09-28 Thread Pete Wyckoff
Native windows binaries do not understand posix-like path mapping offered by cygwin. Convert paths to native using cygpath --windows before presenting them to p4d. This is done using the AltRoots mechanism of p4. Both the posix and windows forms are put in the client specification, allowing p4

[PATCH 09/21] git p4: remove unreachable windows \r\n conversion code

2012-09-28 Thread Pete Wyckoff
Replacing \r\n with \n on windows was added in c1f9197 (Replace \r\n with \n when importing from p4 on Windows, 2007-05-24), to work around an oddity with p4 print on windows. Text files are printed with \r\r\n endings, regardless of whether they were created on unix or windows, and regardless of

[PATCH 10/21] git p4: scrub crlf for utf16 files on windows

2012-09-28 Thread Pete Wyckoff
Files of type utf16 are handled with p4 print instead of the normal p4 -G print interface due to how the latter does not produce correct output. See 55aa571 (git-p4: handle utf16 filetype properly, 2011-09-17) for details. On windows, though, p4 print can not be told which line endings to use,

[PATCH 11/21] git p4 test: newline handling

2012-09-28 Thread Pete Wyckoff
P4 stores newlines in the depos as \n. By default, git does this too, both on unix and windows. Test to make sure that this stays true. Both git and p4 have mechanisms to use \r\n in the working directory. Exercise these. Signed-off-by: Pete Wyckoff p...@padd.com ---

[PATCH 12/21] git p4 test: use LineEnd unix in windows tests too

2012-09-28 Thread Pete Wyckoff
In all clients, even those created on windows, use unix line endings. This makes it possible to verify file contents without doing OS-specific comparisons in all the tests. Tests in t9802-git-p4-filetype.sh are used to make sure that the other LineEnd options continue to work. Signed-off-by:

[PATCH 13/21] git p4 test: avoid wildcard * in windows

2012-09-28 Thread Pete Wyckoff
This character is not valid in windows filenames, even though it can appear in p4 depot paths. Avoid using it in tests on windows, both mingw and cygwin. Signed-off-by: Pete Wyckoff p...@padd.com --- t/t9809-git-p4-client-view.sh | 10 -- t/t9812-git-p4-wildcards.sh | 37

[PATCH 14/21] git p4: cygwin p4 client does not mark read-only

2012-09-28 Thread Pete Wyckoff
There are some old version of p4, compiled for cygwin, that treat read-only files differently. Normally, a file that is not open is read-only, meaning that test -w on the file is false. This works on unix, and it works on windows using the NT version of p4. The cygwin version of p4, though,

Re: git gui does not open bare repositories

2012-09-28 Thread Angelo Borsotti
I have removed the Italian localization so as to make git gui use the English one. The result is the same as I have found before. The message is: Not a Git repository: remote.git. Thus, the misleading message is there. -Angelo -- To unsubscribe from this list: send the line unsubscribe git in

[PATCH 15/21] git p4 test: disable chmod test for cygwin

2012-09-28 Thread Pete Wyckoff
It does not notice chmod +x or -x; there is nothing for this test to do. Signed-off-by: Pete Wyckoff p...@padd.com --- t/t9815-git-p4-submit-fail.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/t9815-git-p4-submit-fail.sh b/t/t9815-git-p4-submit-fail.sh index

[PATCH 16/21] git p4: disable read-only attribute before deleting

2012-09-28 Thread Pete Wyckoff
On windows, p4 marks un-edited files as read-only. Not only are they read-only, but also they cannot be deleted. Remove the read-only attribute before deleting in both the copy and rename cases. This also happens in the RCS cleanup code, where a file is marked to be deleted, but must first be

[PATCH 17/21] git p4: avoid shell when mapping users

2012-09-28 Thread Pete Wyckoff
The extra quoting and double-% are unneeded, just to work around the shell. Instead, avoid the shell indirection. Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index a6806bc..a92d84f 100755 ---

[PATCH 18/21] git p4: avoid shell when invoking git rev-list

2012-09-28 Thread Pete Wyckoff
Invoke git rev-list directly, avoiding the shell, in P4Submit and P4Sync. The overhead of starting extra processes is significant in cygwin; this speeds things up on that platform. Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[PATCH 19/21] git p4: avoid shell when invoking git config --get-all

2012-09-28 Thread Pete Wyckoff
Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index 9c33af4..c0c738a 100755 --- a/git-p4.py +++ b/git-p4.py @@ -525,7 +525,8 @@ def gitConfig(key, args = None): # set args to --bool, for

[PATCH 20/21] git p4: avoid shell when calling git config

2012-09-28 Thread Pete Wyckoff
Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/git-p4.py b/git-p4.py index c0c738a..007ef6b 100755 --- a/git-p4.py +++ b/git-p4.py @@ -514,13 +514,16 @@ def gitBranchExists(branch): return

[PATCH 21/21] git p4: introduce gitConfigBool

2012-09-28 Thread Pete Wyckoff
Make the intent of --bool more obvious by returning a direct True or False value. Convert a couple non-bool users with obvious bool intent. Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 45 ++--- 1 file changed, 26 insertions(+), 19

Re: What's cooking in git.git (Sep 2012, #09; Thu, 27)

2012-09-28 Thread Marc Branchaud
On 12-09-27 11:38 PM, Junio C Hamano wrote: * mb/remote-default-nn-origin (2012-07-11) 6 commits - Teach get_default_remote to respect remote.default. - Test that plain git fetch uses remote.default when on a detached HEAD. - Teach clone to set remote.default. - Teach git remote about

Re: git gui does not open bare repositories

2012-09-28 Thread Ben Smith-Mannschott
Hi Angelo, On Fri, Sep 28, 2012 at 2:09 PM, Angelo Borsotti angelo.borso...@gmail.com wrote: I have removed the Italian localization so as to make git gui use the English one. The result is the same as I have found before. The message is: Not a Git repository: remote.git. Thus, the

Re: [POC PATCH 5/5] completion: avoid compgen to fix expansion issues in __gitcomp_nl()

2012-09-28 Thread SZEDER Gábor
On Fri, Sep 28, 2012 at 12:09:35PM +0200, SZEDER Gábor wrote: __gitcomp_nl () { local IFS=$'\n' - COMPREPLY=($(compgen -P ${2-} -S ${4- } -W $1 -- ${3-$cur})) + COMPREPLY=($(echo $1 |sed -n /^${3-$cur}/ { $cur can be a path, so it can contain /, which then breaks this sed

Question About joshrobb.com

2012-09-28 Thread Mike Juba
Hi there! My team is helping to spread the word about a really great resource page your customers and/or readers would probably appreciate called: 43 Free Cloud Services for Application Developers http://xeround.com/blog/2012/08/43-free-cloud-resources-for-application-developers When

Re: git gui does not open bare repositories

2012-09-28 Thread Angelo Borsotti
Hi Ben, I am running git gui on Windows 7. Are you running it on Linux? -Angelo -- 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

Re: What's cooking in git.git (Sep 2012, #09; Thu, 27)

2012-09-28 Thread Junio C Hamano
Marc Branchaud marcn...@xiplink.com writes: On 12-09-27 11:38 PM, Junio C Hamano wrote: * mb/remote-default-nn-origin (2012-07-11) 6 commits - Teach get_default_remote to respect remote.default. - Test that plain git fetch uses remote.default when on a detached HEAD. - Teach clone to

Re: [PATCH 3/3] revision: make --grep search in notes too if shown

2012-09-28 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: Notes are shown after commit body. From user perspective it looks pretty much like commit body and they may assume --grep would search in that part too. Make it so. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- On Fri, Sep 28,

Re: [PATCH] Add __git_ps1_pc to use as PROMPT_COMMAND

2012-09-28 Thread Junio C Hamano
Simon Oosthoek soosth...@nieuwland.nl writes: +# __git_ps1_pc accepts 0 arguments (for now) +# It is meant to be used as PROMPT_COMMAND, it sets PS1 +__git_ps1_pc () +{ + local g=$(__gitdir) + if [ -n $g ]; then +... + fi +} This looks awfully similar to the existing code in

Re: [RFC PATCH] add t3420-rebase-topology

2012-09-28 Thread Martin von Zweigbergk
On Thu, Sep 27, 2012 at 5:20 AM, Chris Webb ch...@arachsys.com wrote: You're right that rebase --root without --onto always creates a brand new root as a result of the implementation using a sentinel commit. Clearly this is what's wanted with --interactive That's not as clear as one might

Re: [PATCH 2/5] completion: fix args of run_completion() test helper

2012-09-28 Thread Junio C Hamano
SZEDER Gábor sze...@ira.uka.de writes: To simulate the the user hit 'git TAB, one of the completion tests sets up the rather strange command line git i.e. the second word on the command line consists of two double quotes. However, this is not what happens for real, because after 'git

Re: git gui does not open bare repositories

2012-09-28 Thread Angelo Borsotti
Hi Ben, I run the same test on Linux, and have got the same results as you did. So the problem is only on Windows. -Angelo -- 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

Re: [PATCH 2/5] completion: fix args of run_completion() test helper

2012-09-28 Thread SZEDER Gábor
On Fri, Sep 28, 2012 at 11:04:05AM -0700, Junio C Hamano wrote: SZEDER Gábor sze...@ira.uka.de writes: To simulate the the user hit 'git TAB, one of the completion tests s/the the/that the/ sets up the rather strange command line git i.e. the second word on the command line

Re: [PATCH 06/21] git p4 test: use client_view in t9806

2012-09-28 Thread Junio C Hamano
Pete Wyckoff p...@padd.com writes: Use the standard client_view function from lib-git-p4.sh instead of building one by hand. This requires a bit of rework, using the current value of $P4CLIENT for the client name. It also reorganizes the test to isolate changes to $P4CLIENT and $cli in a

Re: [PATCH 05/21] git p4 test: use client_view to build the initial client

2012-09-28 Thread Junio C Hamano
Pete Wyckoff p...@padd.com writes: Simplify the code a bit by using an existing function. Signed-off-by: Pete Wyckoff p...@padd.com --- t/lib-git-p4.sh | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh index 7061dce..890ee60

Re: [PATCH 04/21] git p4: fix error message when describe -s fails

2012-09-28 Thread Junio C Hamano
Pete Wyckoff p...@padd.com writes: The output was a bit nonsensical, including a bare %d. Fix it to make it easier to understand. Signed-off-by: Pete Wyckoff p...@padd.com --- git-p4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index

Re: [PATCH 2/5] completion: fix args of run_completion() test helper

2012-09-28 Thread Junio C Hamano
SZEDER Gábor sze...@ira.uka.de writes: On Fri, Sep 28, 2012 at 11:04:05AM -0700, Junio C Hamano wrote: SZEDER Gábor sze...@ira.uka.de writes: To simulate the the user hit 'git TAB, one of the completion tests s/the the/that the/ sets up the rather strange command line git

Re: [PATCH 15/21] git p4 test: disable chmod test for cygwin

2012-09-28 Thread Johannes Sixt
Am 28.09.2012 14:04, schrieb Pete Wyckoff: It does not notice chmod +x or -x; there is nothing for this test to do. Signed-off-by: Pete Wyckoff p...@padd.com --- t/t9815-git-p4-submit-fail.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

Re: [PATCH 2/5] completion: fix args of run_completion() test helper

2012-09-28 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Fri, Sep 28, 2012 at 12:23:47PM -0700, Junio C Hamano wrote: @@ -57,7 +57,7 @@ run_completion () test_completion () { test $# -gt 1 echo $2 expected - run_completion $@ + run_completion $1 test_cmp

Re: [PATCH 2/5] completion: fix args of run_completion() test helper

2012-09-28 Thread SZEDER Gábor
On Fri, Sep 28, 2012 at 12:23:47PM -0700, Junio C Hamano wrote: SZEDER Gábor sze...@ira.uka.de writes: On Fri, Sep 28, 2012 at 11:04:05AM -0700, Junio C Hamano wrote: SZEDER Gábor sze...@ira.uka.de writes: To simulate the the user hit 'git TAB, one of the completion tests s/the

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Junio C Hamano
Jeff King p...@peff.net writes: Potentially the reload command should reset the need_index_refresh flag, too. Yeah, I think that is a sane enhancement to think about. gitk | 10 ++ 1 file changed, 10 insertions(+) diff --git a/gitk b/gitk index 379582a..561be23 100755 ---

Re: Git diff-file bug?

2012-09-28 Thread Jeff King
On Fri, Sep 28, 2012 at 07:55:10PM +0100, Scott Batchelor wrote: I'm fairly new to git and am witnessing some strange behavior with git that I suspect may be a bug. Can anyone set my mind at rest. It's not a bug. Every so often (I've not quite figured out the exact set of circumstances yet)

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Andreas Schwab
Jeff King p...@peff.net writes: +proc refresh_index {} { +global need_index_refresh +if { $need_index_refresh } { + exec sh -c git update-index --refresh /dev/null 21 || true I think the usual idiom for ignoring errors is to use catch around exec, avoiding the extra shell

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Jeff King
On Sat, Sep 29, 2012 at 12:11:58AM +0200, Andreas Schwab wrote: Jeff King p...@peff.net writes: +proc refresh_index {} { +global need_index_refresh +if { $need_index_refresh } { + exec sh -c git update-index --refresh /dev/null 21 || true I think the usual idiom for

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Sat, Sep 29, 2012 at 12:11:58AM +0200, Andreas Schwab wrote: Jeff King p...@peff.net writes: +proc refresh_index {} { +global need_index_refresh +if { $need_index_refresh } { + exec sh -c git update-index --refresh /dev/null 21 || true I

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Jeff King
On Fri, Sep 28, 2012 at 04:02:32PM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: +proc refresh_index {} { +global need_index_refresh +if { $need_index_refresh } { +exec sh -c git update-index --refresh /dev/null 21 || true I think the usual

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Junio C Hamano
Jeff King p...@peff.net writes: I think the weird tcl-catches-stderr thing kicks in (at least it did for me in a simple experiment). But like I said, I am not an expert. OK, I'll believe you ;-) -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Andreas Schwab
Junio C Hamano gits...@pobox.com writes: Jeff King p...@peff.net writes: On Sat, Sep 29, 2012 at 12:11:58AM +0200, Andreas Schwab wrote: Jeff King p...@peff.net writes: +proc refresh_index {} { +global need_index_refresh +if { $need_index_refresh } { + exec sh -c git

Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-28 Thread Nguyễn Thái Ngọc Duy
On Sat, Sep 29, 2012 at 12:55 AM, Junio C Hamano gits...@pobox.com wrote: For that to happen, the code _must_ know what kind of headers we would support; discarding the existing enum is going in a wrong direction. Or what kind of manipulation is required for a header. The caller can decide if

[PATCH 1/3] grep: prepare for new header field filter

2012-09-28 Thread Nguyễn Thái Ngọc Duy
grep supports only author and committer headers, which have the same special treatment that later headers may or may not have. Check for field type and only strip_timestamp() when the field is either author or committer. GREP_HEADER_FIELD_MAX is put in the grep_header_field enum to be calculated

[PATCH 3/3] revision: make --grep search in notes too if shown

2012-09-28 Thread Nguyễn Thái Ngọc Duy
Notes are shown after commit body. From user perspective it looks pretty much like commit body and they may assume --grep would search in that part too. Make it so. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- revision.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-28 Thread Nguyễn Thái Ngọc Duy
Similar to --author/--committer which filters commits by author and committer header fields. --grep-reflog adds a fake reflog header to commit and a grep filter to search on that line. All rules to --author/--committer apply except no timestamp stripping. Signed-off-by: Nguyễn Thái Ngọc Duy

Re: [PATCH 1/8] Introduce new static function real_path_internal()

2012-09-28 Thread Michael Haggerty
On 09/27/2012 11:27 PM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: @@ -54,20 +73,36 @@ const char *real_path(const char *path) } if (*buf) { -if (!*cwd !getcwd(cwd, sizeof(cwd))) -

Re: [PATCH 1/3] grep: prepare for new header field filter

2012-09-28 Thread Jeff King
On Sat, Sep 29, 2012 at 11:41:27AM +0700, Nguyen Thai Ngoc Duy wrote: diff --git a/grep.c b/grep.c index 898be6e..8d73995 100644 --- a/grep.c +++ b/grep.c @@ -720,7 +720,14 @@ static int match_one_pattern(struct grep_pat *p, char *bol, char *eol, if (strncmp(bol, field,

Re: [PATCH 3/8] longest_ancestor_length(): use string_list_split()

2012-09-28 Thread Michael Haggerty
On 09/28/2012 12:48 AM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: -for (colon = ceil = prefix_list; *colon; ceil = colon+1) { -for (colon = ceil; *colon *colon != PATH_SEP; colon++); -len = colon - ceil; +string_list_split(prefixes,

Re: [PATCH 1/8] Introduce new static function real_path_internal()

2012-09-28 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: The patch makes sense, but while you are touching this code, I have to wonder if there is an easy way to tell, before entering the loop, if we have to chdir() around in the loop. That would allow us to hoist the getcwd() that is done only so that

Re: [PATCH 3/8] longest_ancestor_length(): use string_list_split()

2012-09-28 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: On 09/28/2012 12:48 AM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: - for (colon = ceil = prefix_list; *colon; ceil = colon+1) { - for (colon = ceil; *colon *colon != PATH_SEP; colon++); - len =

Re: [PATCH 7/8] longest_ancestor_length(): resolve symlinks before comparing paths

2012-09-28 Thread Michael Haggerty
On 09/28/2012 12:51 AM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: longest_ancestor_length() relies on a textual comparison of directory parts to find the part of path that overlaps with one of the paths in prefix_list. But this doesn't work if any of the prefixes

Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-28 Thread Junio C Hamano
Jeff King p...@peff.net writes: +if (opt-reflog_info) { +strbuf_addstr(buf, reflog ); +get_reflog_message(buf, opt-reflog_info); +strbuf_addch(buf, '\n'); +strbuf_addstr(buf, commit-buffer); +} +if (buf.len) +retval =