[PATCH v8 0/5] git log -L

2013-02-28 Thread Thomas Rast
Here's another shot :-) For an instructive example, apply it and run git log -L:archiver:archive.h in your git.git. Last time around, apart from some minor issues, there was one main point discussed[1]: it should be possible to do the line-log in two separate steps, one for filtering and one

[PATCH v8 2/5] blame: introduce $ as end of file in -L syntax

2013-02-28 Thread Thomas Rast
To save the user a lookup of the last line number, introduce $ as a shorthand for the last line. This is mostly useful to spell until the end of the file as '-Lbegin,$'. Signed-off-by: Thomas Rast tr...@student.ethz.ch --- Documentation/line-range-format.txt | 6 ++ line-log.c

[PATCH v8 3/5] Export rewrite_parents() for 'log -L'

2013-02-28 Thread Thomas Rast
From: Bo Yang struggleyb@gmail.com The function rewrite_one is used to rewrite a single parent of the current commit, and is used by rewrite_parents to rewrite all the parents. Decouple the dependence between them by making rewrite_one a callback function that is passed to rewrite_parents.

[PATCH v8 1/5] Refactor parse_loc

2013-02-28 Thread Thomas Rast
From: Bo Yang struggleyb@gmail.com We want to use the same style of -L n,m argument for 'git log -L' as for git-blame. Refactor the argument parsing of the range arguments from builtin/blame.c to the (new) file that will hold the 'git log -L' logic. To accommodate different data structures

[PATCH v8 5/5] log -L: :pattern:file syntax to find by funcname

2013-02-28 Thread Thomas Rast
This new syntax finds a funcname matching /pattern/, and then takes from there up to (but not including) the next funcname. So you can say git log -L:main:main.c and it will dig up the main() function and show its line-log, provided there are no other funcnames matching 'main'.

[PATCH v8 4/5] Implement line-history search (git log -L)

2013-02-28 Thread Thomas Rast
This is a rewrite of much of Bo's work, mainly in an effort to split it into smaller, easier to understand routines. The algorithm is built around the struct range_set, which encodes a series of line ranges as intervals [a,b). This is used in two contexts: * A set of lines we are tracking

Re: [PATCH v8 1/5] Refactor parse_loc

2013-02-28 Thread Junio C Hamano
Thomas Rast tr...@student.ethz.ch writes: From: Bo Yang struggleyb@gmail.com We want to use the same style of -L n,m argument for 'git log -L' as for git-blame. Refactor the argument parsing of the range arguments from builtin/blame.c to the (new) file that will hold the 'git log -L'

[RFC] optimize set_shared_perm()

2013-02-28 Thread Torsten Bögershausen
optimize set_shared_perm() in path.c: - sometimes the chown() function is called even when not needed. (This can be provoced by running t1301, and adding some debug code) Save a chmod from 400 to 400, or from 600-600 on these files: .git/info/refs+ .git/objects/info/packs+ Save chmod

Re: [PATCH v8 2/5] blame: introduce $ as end of file in -L syntax

2013-02-28 Thread Junio C Hamano
Thomas Rast tr...@student.ethz.ch writes: To save the user a lookup of the last line number, introduce $ as a shorthand for the last line. This is mostly useful to spell until the end of the file as '-Lbegin,$'. Doesn't -L begin or -L begin, do that already? If it were to introduce -L $-4,

Re: [PATCH v8 3/5] Export rewrite_parents() for 'log -L'

2013-02-28 Thread Junio C Hamano
Thomas Rast tr...@student.ethz.ch writes: From: Bo Yang struggleyb@gmail.com The function rewrite_one is used to rewrite a single parent of the current commit, and is used by rewrite_parents to rewrite all the parents. Decouple the dependence between them by making rewrite_one a

Re: [PATCH v8 4/5] Implement line-history search (git log -L)

2013-02-28 Thread Junio C Hamano
Thomas Rast tr...@student.ethz.ch writes: @@ -138,6 +155,11 @@ Examples This makes sense only when following a strict policy of merging all topic branches when staying on a single integration branch. +git log -L '/int main/',/^}/:main.c:: + + Shows how the function

zsh completion broken for file completion

2013-02-28 Thread Matthieu Moy
Hi, The completion for e.g. git add filetab is broken in master. I get the following result: git add fo__gitcomp_file:8: command not found: compgen The guilty commit is fea16b47b60 (Fri Jan 11 19:48:43 2013, Manlio Perillo, git-completion.bash: add support for path completion), which introduces

Re: zsh completion broken for file completion

2013-02-28 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 28/02/2013 19:43, Matthieu Moy ha scritto: Hi, The completion for e.g. git add filetab is broken in master. I get the following result: git add fo__gitcomp_file:8: command not found: compgen The guilty commit is fea16b47b60 (Fri Jan 11

Re: [PATCH v8 1/5] Refactor parse_loc

2013-02-28 Thread Thomas Rast
Junio C Hamano gits...@pobox.com writes: Thomas Rast tr...@student.ethz.ch writes: From: Bo Yang struggleyb@gmail.com We want to use the same style of -L n,m argument for 'git log -L' as for git-blame. Refactor the argument parsing of the range arguments from builtin/blame.c to the

Re: [PATCH v8 4/5] Implement line-history search (git log -L)

2013-02-28 Thread Thomas Rast
Junio C Hamano gits...@pobox.com writes: +/* + * NEEDSWORK: manually building a diff here is not the Right + * Thing(tm). log -L should be built into the diff pipeline. I am not sure about this design, and do not necessarily agree that wedging this to the diff pipeline is the right future

Re: [PATCH v8 0/5] git log -L

2013-02-28 Thread Junio C Hamano
Thomas Rast tr...@student.ethz.ch writes: For an instructive example, apply it and run git log -L:archiver:archive.h in your git.git. Fun ;-) This is queued at the tip of 'pu' so that poeple can have fun. Thanks. -- To unsubscribe from this list: send the line unsubscribe git in the

Re: [PATCH v8 4/5] Implement line-history search (git log -L)

2013-02-28 Thread Junio C Hamano
Thomas Rast tr...@student.ethz.ch writes: Junio C Hamano gits...@pobox.com writes: +/* + * NEEDSWORK: manually building a diff here is not the Right + * Thing(tm). log -L should be built into the diff pipeline. I am not sure about this design, and do not necessarily agree that wedging

Re: [BUG/PATCH] contrib/subtree: allow addition of remote branch with name not locally present

2013-02-28 Thread Paul Campbell
On Thu, Feb 28, 2013 at 12:20 AM, Junio C Hamano gits...@pobox.com wrote: Paul Campbell pcampb...@kemitix.net writes: cmd_add() attempts to check for the validity of refspec for the repository it is about to add as a subtree. It tries to do so before contacting the repository. If the refspec

Re: [PATCH v8 4/5] Implement line-history search (git log -L)

2013-02-28 Thread Thomas Rast
Junio C Hamano gits...@pobox.com writes: Thomas Rast tr...@student.ethz.ch writes: Junio C Hamano gits...@pobox.com writes: +/* + * NEEDSWORK: manually building a diff here is not the Right + * Thing(tm). log -L should be built into the diff pipeline. I am not sure about this design,

[PATCH v2] contrib/subtree: allow addition of remote branch with name not locally present

2013-02-28 Thread Paul Campbell
cmd_add() attempts to check for the validity of refspec for the repository it is about to add as a subtree. It tries to do so before contacting the repository. If the refspec happens to exist locally (say 'master') then the test passes and the repo is fetched. If the refspec doesn't exist locally

Re: [PATCH 2/2] describe: Exclude --all --match=PATTERN

2013-02-28 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: I am not sure if this is (1) behaviour is sometimes useful in narrow cases but is not explained well, (2) behaviour does not make sense in any situation, or (3) the combination can make sense if corrected, but the current behaviour is buggy. If it is

[PATCH] diff: Fix rename pretty-print when suffix and prefix overlap

2013-02-28 Thread Antoine Pelisse
When considering a rename for two files that have a suffix and a prefix that can overlap, a confusing line is shown. As an example, renaming a/b/b/c to a/b/c shows a/b/{ = }/b/c, instead of a/b/{b = }/c Currently, what we do is calculate the common prefix (a/b/), and the common suffix (/b/c), but

Re: [PATCH] diff: Fix rename pretty-print when suffix and prefix overlap

2013-02-28 Thread Thomas Rast
Antoine Pelisse apeli...@gmail.com writes: diff --git a/diff.c b/diff.c index 9038f19..e1d82c9 100644 --- a/diff.c +++ b/diff.c @@ -1177,7 +1177,16 @@ static char *pprint_rename(const char *a, const char *b) - while (a = old b = new *old == *new) { + /* + * Note: +

Re: [PATCH] diff: Fix rename pretty-print when suffix and prefix overlap

2013-02-28 Thread Antoine Pelisse
On Thu, Feb 28, 2013 at 11:14 PM, Thomas Rast tr...@student.ethz.ch wrote: Antoine Pelisse apeli...@gmail.com writes: diff --git a/diff.c b/diff.c index 9038f19..e1d82c9 100644 --- a/diff.c +++ b/diff.c @@ -1177,7 +1177,16 @@ static char *pprint_rename(const char *a, const char *b) -

Re: how to check pending commits to be pushed?

2013-02-28 Thread Patricia Bittencourt Egeland
Inside the super repo, I used git submodule foreach, that way (which worked fine): git submodule foreach git status || true No idea why the line bellow didn't work: git submodule foreach git status Thanks, Patricia On Feb 28, 2013, at 11:58 AM, Joachim Schmitz j...@schmitz-digital.de wrote:

Re: Subtree in Git

2013-02-28 Thread Kindjal
David Michael Barr b at rr-dav.id.au writes: From a quick survey, it appears there are no more than 55 patches squashed into the submitted patch. As I have an interest in git-subtree for maintaining the out-of-tree version of vcs-svn/ and a desire to improve my rebase-fu, I am tempted to