Re: DWIM .git repository discovery

2012-09-26 Thread Michael J Gruber
Junio C Hamano venit, vidit, dixit 26.09.2012 06:21: Nguyen Thai Ngoc Duy pclo...@gmail.com writes: I often find myself attempting to examine another repository, especially in projects that are closely related but put in different git repos. It's usually just a diff or log command git log

Re: Can git pull from a mercurial repository?

2012-09-26 Thread Georgi Chorbadzhiyski
Around 09/25/2012 05:15 PM, Max Horn scribbled: I think there is a lot of demand for a git-hg bridge, a way to seemlessly access a Mercurial repository as if it was a git repository. A converse to hg-git http://hg-git.github.com/ I've already mentioned this, but such a tool already exists

Re: CRLF, LF ... CR ?

2012-09-26 Thread David Aguilar
On Thu, Sep 13, 2012 at 9:51 PM, Junio C Hamano gits...@pobox.com wrote: David Aguilar dav...@gmail.com writes: git doesn't really even support LF. At the storage level that is correct, but the above is a bit of stretch. It may not be support, but git _does_ rely on LF when running many

Re: Can git pull from a mercurial repository?

2012-09-26 Thread Max Horn
On 26.09.2012, at 09:38, Georgi Chorbadzhiyski wrote: Around 09/25/2012 05:15 PM, Max Horn scribbled: I think there is a lot of demand for a git-hg bridge, a way to seemlessly access a Mercurial repository as if it was a git repository. A converse to hg-git http://hg-git.github.com/

Re: Can git pull from a mercurial repository?

2012-09-26 Thread Georgi Chorbadzhiyski
Around 09/26/2012 11:46 AM, Max Horn scribbled: On 26.09.2012, at 09:38, Georgi Chorbadzhiyski wrote: Around 09/25/2012 05:15 PM, Max Horn scribbled: I think there is a lot of demand for a git-hg bridge, a way to seemlessly access a Mercurial repository as if it was a git repository. A

Re: CRLF, LF ... CR ?

2012-09-26 Thread Jens Bauer
Hi David and Junio. At first, I was planning to reply that I'd probably not be qualified for that. But to tell the truth, I have been writing a lot of CR/LF/CRLF code throughout the years, so maybe I could do it. Unfortunately, I have to go slow about programming, because I burned myself out a

Re: CRLF, LF ... CR ?

2012-09-26 Thread Jens Bauer
Hi David and Junio. Woops, that's what happens when deleting a block of lines in a message... The CR/LF/CRLF implementation depends a lot on if git is reading a stream or reading from memory. I'd like to correct the last line to read... Worst case is, if a file contains mixed CR, LF and CRLF,

Re: DWIM .git repository discovery

2012-09-26 Thread Nguyen Thai Ngoc Duy
On Wed, Sep 26, 2012 at 11:21 AM, Junio C Hamano gits...@pobox.com wrote: Nguyen Thai Ngoc Duy pclo...@gmail.com writes: I often find myself attempting to examine another repository, especially in projects that are closely related but put in different git repos. It's usually just a diff or

[PATCH 0/5] wildmatch series update

2012-09-26 Thread Nguyễn Thái Ngọc Duy
No functional changes. Just incorporate changes from Ramsay and Johannes. Nguyễn Thái Ngọc Duy (5): Import wildmatch from rsync compat/wildmatch: remove static variable force_lower_case compat/wildmatch: fix case-insensitive matching Integrate wildmatch to git Support ** in .gitignore

[PATCH 1/5] Import wildmatch from rsync

2012-09-26 Thread Nguyễn Thái Ngọc Duy
These files are from rsync.git commit f92f5b166e3019db42bc7fe1aa2f1a9178cd215d, which was the last commit before rsync turned GPL-3. All files are imported as-is and no-op. Adaptation is done in a separate patch. rsync.git - git.git lib/wildmatch.[ch] wildmatch.[ch] wildtest.c

[PATCH 2/5] compat/wildmatch: remove static variable force_lower_case

2012-09-26 Thread Nguyễn Thái Ngọc Duy
One place less to worry about thread safety Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- wildmatch.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/wildmatch.c b/wildmatch.c index

[PATCH 3/5] compat/wildmatch: fix case-insensitive matching

2012-09-26 Thread Nguyễn Thái Ngọc Duy
dowild() does case insensitive matching by lower-casing the text. That means lower case letters in patterns imply case-insensitive matching, but upper case means exact matching. We do not want that subtlety. Lower case pattern too so iwildmatch() always does what we expect it to do.

[PATCH 4/5] Integrate wildmatch to git

2012-09-26 Thread Nguyễn Thái Ngọc Duy
This makes wildmatch.c part of libgit.a and builds test-wildmatch; the dependency on libpopt in the original has been replaced with the use of our parse-options. Global variables in test-wildmatch are marked static to avoid sparse warnings. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH 5/5] Support ** in .gitignore and .gitattributes patterns using wildmatch()

2012-09-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- Documentation/gitignore.txt| 3 +++ attr.c | 4 +++- dir.c | 5 - t/t0003-attributes.sh | 17

Re: Problem completing remotes when .git/remotes exits

2012-09-26 Thread SZEDER Gábor
On Tue, Sep 25, 2012 at 04:43:59PM -0700, Junio C Hamano wrote: SZEDER Gábor sze...@ira.uka.de writes: - test -d $d/remotes ls -1 $d/remotes + test -d $d/remotes command ls -1 $d/remotes Yuck. For normal scripts, nobody sane would define alias for non-interactive environments,

[PATCH] revision: add --reflog-message=pattern to grep reflog messages

2012-09-26 Thread Nguyễn Thái Ngọc Duy
Both git log and git reflog show recognize this option. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Itch: how to show reflogs for checkout operation only? Instead of ignoring when -g is not given, we might want to imply -g. Still itch: grep highlight! For all applicable areas:

Re: [PATCH v2 14/14] Add git-check-ignore sub-command

2012-09-26 Thread Junio C Hamano
Johannes Sixt j.s...@viscovery.net writes: These days, we do not add random subcommands willy-nilly (I still doubt if check-ignore needs to be a separate debugging command, or a new mode of operation of ls-files or something), so the approach to use a blacklist makes more sense. help -a is

Re: [PATCH] mergetool--lib: Allow custom commands to override built-ins

2012-09-26 Thread Junio C Hamano
Ramkumar Ramachandra artag...@gmail.com writes: Hi David, David Aguilar wrote: diff_cmd () { - merge_tool_cmd=$(get_merge_tool_cmd $1) - if test -z $merge_tool_cmd - then - status=1 - break - fi - ( eval $merge_tool_cmd ) -

Re: [PATCH] revision: add --reflog-message=pattern to grep reflog messages

2012-09-26 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: Both git log and git reflog show recognize this option. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- How well does it interact with --grep and/or --all-match? -- To unsubscribe from this list: send the line unsubscribe git in the

Re: [PATCH] revision: add --reflog-message=pattern to grep reflog messages

2012-09-26 Thread Nguyen Thai Ngoc Duy
On Wed, Sep 26, 2012 at 9:07 PM, Junio C Hamano gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: Both git log and git reflog show recognize this option. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- How well does it interact with --grep and/or

bash completion with colour hints

2012-09-26 Thread Simon Oosthoek
Hi Shawn I only recently found the __git_ps1 function, but it wasn't directly able to replace my own contraption. I've modified the version I found after installing bash-completion in debian 6. The patch is attached, it contains an escape character, so it is hard to include in plain text.

Re: A generalization of git blame

2012-09-26 Thread xmeng
Philip Oakley philipoak...@iee.org writes: To get ground truth of authorship for each line, I start with git-blame. But later I find this is not sufficient because the last commit may only add comments or may only change a small part of the line, so that I shouldn't attribute the line of

git die message written to stdout?

2012-09-26 Thread 乙酸鋰
Is git die() messages written to stdout? Should it be written to stderr? -- 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: [RFC PATCH] add t3420-rebase-topology

2012-09-26 Thread Martin von Zweigbergk
[+Chris Webb regarding git rebase --root] First of all, thanks for a meticulous review! On Tue, Sep 18, 2012 at 12:53 AM, Johannes Sixt j.s...@viscovery.net wrote: Am 9/18/2012 8:31, schrieb Martin von Zweigbergk: Since here and in the following tests the test cases and test descriptions

Discussion around a --bindtodev option for git-daemon

2012-09-26 Thread Ronan Bignaux
I wrote this little patch to add a restrict option to bind only to a specific network interface. I'd not deal with --inetd since there are some bugs in xinetd with ipv6 ( and no more maintener ) , systemd/upstart are also Linux centric and subject to controversy... listen option was not more

[PATCH v4] Teach rm to remove submodules unless they contain a git directory

2012-09-26 Thread Jens Lehmann
Currently using git rm on a submodule - populated or not - fails with this error: fatal: git rm: 'submodule path': Is a directory This made sense in the past as there was no way to remove a submodule without possibly removing unpushed parts of the submodule's history contained in its .git

Re: [PATCH] mergetool--lib: Allow custom commands to override built-ins

2012-09-26 Thread David Aguilar
On Wed, Sep 26, 2012 at 7:06 AM, Junio C Hamano gits...@pobox.com wrote: Ramkumar Ramachandra artag...@gmail.com writes: Hi David, David Aguilar wrote: diff_cmd () { - merge_tool_cmd=$(get_merge_tool_cmd $1) - if test -z $merge_tool_cmd - then - status=1

Re: Configuring the location of ~/.gitconfig

2012-09-26 Thread David Aguilar
On Wed, Sep 26, 2012 at 7:14 AM, Ramkumar Ramachandra artag...@gmail.com wrote: Hi, I'd like to configure the location of ~/.gitconfig through an environment variable. My usecase is a simple enough: I have a repository with all my dotfiles, and I don't want to symlink ~/dotfiles/.gitconfig

Re: A generalization of git blame

2012-09-26 Thread Junio C Hamano
xm...@cs.wisc.edu writes: Another question is that is it possible to include my tool as a git built-in tool in the future? It largely depends on how the user would interact with your program, which is totally unclear as we haven't seen any part of it. I do not think we have enough information

Re: git die message written to stdout?

2012-09-26 Thread Frans Klaver
On Wed, 26 Sep 2012 18:01:39 +0200, 乙酸鋰 ch3co...@gmail.com wrote: Is git die() messages written to stdout? Should it be written to stderr? As far as I know git die() routines write their output to stderr. Do you have an indication that that might not be the case? Frans -- To

Re: bash completion with colour hints

2012-09-26 Thread Simon Oosthoek
On 26/09/12 17:24, Ramkumar Ramachandra wrote: Hi Simon, Could you follow the guidelines in Documentation/SubmittingPatches, so that the patch can be considered for inclusion? Hi Ram, thanks for your feedback. I gather now that this file is part of the entire git tree ;-) this is my first

Re: [PATCH] revision: add --reflog-message=pattern to grep reflog messages

2012-09-26 Thread Junio C Hamano
Nguyen Thai Ngoc Duy pclo...@gmail.com writes: On Wed, Sep 26, 2012 at 9:07 PM, Junio C Hamano gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: Both git log and git reflog show recognize this option. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- How

[PATCH 0/8] Fix GIT_CEILING_DIRECTORIES that contain symlinks

2012-09-26 Thread Michael Haggerty
This series fixes longest_ancestor_length() so that it works even if prefix_list contains entries that involve symlinks. The basic goal of the series is to call real_path() on each of the entries so that a textual comparison of the potential prefix to the front of path correctly decides whether

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

2012-09-26 Thread Michael Haggerty
It accepts a new parameter, die_on_error. If die_on_error is false, it simply cleans up after itself and returns NULL rather than dying. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- abspath.c | 93 --- 1 file changed, 72

[PATCH 2/8] Introduce new function real_path_if_valid()

2012-09-26 Thread Michael Haggerty
The function is like real_path(), except that it returns NULL on error instead of dying. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- abspath.c | 5 + cache.h | 1 + 2 files changed, 6 insertions(+) diff --git a/abspath.c b/abspath.c index a7ab8e9..5748b91 100644 ---

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

2012-09-26 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- path.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/path.c b/path.c index cbbdf7d..969bc17 100644 --- a/path.c +++ b/path.c @@ -12,6 +12,7 @@ */ #include cache.h #include strbuf.h +#include

[PATCH 4/8] longest_ancestor_length(): explicitly filter list before loop

2012-09-26 Thread Michael Haggerty
Separate the step of filtering and normalizing elements of the prefixes list from the iteration that looks for the longest prefix. This will help keep the function testable after we not only normalize the paths, but also convert them into real paths. Signed-off-by: Michael Haggerty

[PATCH 6/8] longest_ancestor_length(): use string_list_longest_prefix()

2012-09-26 Thread Michael Haggerty
Use string_list_longest_prefix() in the implementation of longest_ancestor_length(), instead of an equivalent loop. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- path.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/path.c b/path.c index

[PATCH 5/8] longest_ancestor_length(): always add a slash to the end of prefixes

2012-09-26 Thread Michael Haggerty
Previously we stripped off any slashes that were present. Instead, add a slash if it is missing. This removes the need for an extra check that path has a slash following the prefix and makes the handling of the root directory more natural, making the way clear to use

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

2012-09-26 Thread Michael Haggerty
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 involves a symbolic link, because the directories will look different even though they might

[PATCH 8/8] t1504: stop resolving symlinks in GIT_CEILING_DIRECTORIES

2012-09-26 Thread Michael Haggerty
This test used to explicitly resolve symlinks in the paths derived from TRASH_DIRECTORY that were written to GIT_CEILING_DIRECTORIES, because the code handling GIT_CEILING_DIRECTORIES was confused by symlinks. This is no longer necessary. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu ---

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Jonathan Nieder
Hi, Michael G Schwern wrote: On 2012.7.30 12:51 PM, Eric Wong wrote: Michael G Schwern wrote: _collapse_dotdot() works better than the existing regex did. I don't dispute it's better, but it's worth explaining in the commit message to reviewers why something is better. Yeah. I figured

Re: [PATCH] Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for detecting heap corruption

2012-09-26 Thread René Scharfe
Sorry for being late. Just wanted to try out this new feature and ended up reading this old thread. Am 15.09.2012 01:18, schrieb Junio C Hamano: t/perf/perf-lib.sh | 1 + t/test-lib.sh | 26 -- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git

Re: Can git pull from a mercurial repository?

2012-09-26 Thread Cosmin Stejerean
I definitely wrote git-hg for the purpose of checking out a mercurial repo so I can develop locally against it with git and then submit patches. Getting push support was never really a priority for me. Someone did eventually contribute some mechanism for pushing things back in a pull request, so I

Re: [PATCH 4/7] Add join_paths() to safely concatenate paths.

2012-09-26 Thread Jonathan Nieder
Hi, Michael G. Schwern wrote: Otherwise you might wind up with things like... my $path1 = undef; my $path2 = 'foo'; my $path = $path1 . '/' . $path2; creating '/foo'. Or this... my $path1 = 'foo/'; my $path2 = 'bar'; my $path = $path1 . '/' . $path2;

Re: Bug in Submodule add

2012-09-26 Thread Jens Lehmann
Am 26.09.2012 06:18, schrieb Jonathan Johnson: I believe I have found an issue with the way `submodule add` detects a submodule that already exists in the repository. Yes, this is an issue and thanks for the detailed report. To reproduce 1) add a git submodule in a specific location

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Eric Wong
Jonathan Nieder jrnie...@gmail.com wrote: Hi, Michael G Schwern wrote: On 2012.7.30 12:51 PM, Eric Wong wrote: Michael G Schwern wrote: _collapse_dotdot() works better than the existing regex did. I don't dispute it's better, but it's worth explaining in the commit message to

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Jonathan Nieder
Eric Wong wrote: That said, I'd favor an implementation that split on m{/+} and collapsed as Michael mentioned. Sounds sensible. Is canonicalize_path responsible for collapsing runs of slashes? What should _collapse_dotdot do to c:/.. or http://www.example.com/..;? -- To unsubscribe from

Re: [PATCH] Revert completion: fix shell expansion of items

2012-09-26 Thread Jeff King
On Wed, Sep 26, 2012 at 12:37:25AM +0200, SZEDER Gábor wrote: I looked into this issue, but quickly got lost in quoting-escaping hell. Ideally we could do some quoting in __gitcomp_nl(), so it would work for all kinds of input, but I couldn't come up with anything working. Alternatively, we

[PATCH 1/3] t9902: add a few basic completion tests

2012-09-26 Thread Jeff King
We were not testing ref or tree completion at all. Let's give them even basic sanity checks to avoid regressions. Signed-off-by: Jeff King p...@peff.net --- This would have caught the recent breakage, and also paves the way for testing the new fix. t/t9902-completion.sh | 41

[PATCH 2/3] t9902: add completion tests for odd filenames

2012-09-26 Thread Jeff King
We correctly handle completion items with spaces just fine, since we pass the lists around with newline delimiters. However, we do not handle filenames with shell metacharacters, as compgen -W performs expansion on the list we give it. Signed-off-by: Jeff King p...@peff.net --- Actually, these

[PATCH 3/3] completion: improve shell expansion of items

2012-09-26 Thread Jeff King
The current completion code doesn't deal properly with items (tags, branches, etc.) that have ${} in them because they get expanded by bash while using compgen. This patch is a rewrite of Felipe Contreras's 25ae7cf, which attempted to fix the problem by quoting the values we pass to __gitcomp_nl.

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Eric Wong
Jonathan Nieder jrnie...@gmail.com wrote: Eric Wong wrote: That said, I'd favor an implementation that split on m{/+} and collapsed as Michael mentioned. Sounds sensible. Is canonicalize_path responsible for collapsing runs of slashes? What should _collapse_dotdot do to c:/.. or

[PATCH 4/3] completion: quote completions we find

2012-09-26 Thread Jeff King
On Wed, Sep 26, 2012 at 05:51:19PM -0400, Jeff King wrote: This is not a complete fix, as the completion result does will still contain metacharacters, so it would need extra quoting to actually be used on a command line. But it's still a step in the right direction, because: [...] 2. We

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Jonathan Nieder
Eric Wong wrote: It should probably just return the root path (c:/ and http://www.example.com/; respectively). That means recognizing drive letters and URLs. Hm. Subversion commands seem to use svn_client_args_to_target_array2 to canonicalize arguments. It does something like the following:

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Eric Wong
Jonathan Nieder jrnie...@gmail.com wrote: Maybe we can use apr_filepath_merge() to avoid reinventing the wheel? Ideally, yes. Is there an easy way to access that from Perl? (and for the older versions of SVN folks people are running). Perhaps we can expose equivalent functionality in git via

Re: [PATCH 3/3] completion: improve shell expansion of items

2012-09-26 Thread SZEDER Gábor
Hi, On Wed, Sep 26, 2012 at 05:51:19PM -0400, Jeff King wrote: diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index be800e0..b0416ea 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -225,6

Using bitmaps to accelerate fetch and clone

2012-09-26 Thread Shawn Pearce
Google has published a series of patches (see links below) to JGit to improve fetch and clone performance by adding compressed bitmaps to the pack-*.idx structure. Operation Index V2 Index VE003 Clone 37530ms (524.06 MiB) 82ms (524.06 MiB)

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Jonathan Nieder
Eric Wong wrote: Ideally, yes. Is there an easy way to access that from Perl? (and for the older versions of SVN folks people are running). Subversion's swig bindings only wrap a few apr functions and do not depend on fuller apr bindings. Something like svn_dirent_is_under_root() could be

Re: A generalization of git blame

2012-09-26 Thread xmeng
It largely depends on how the user would interact with your program, which is totally unclear as we haven't seen any part of it. I do not think we have enough information to answer the question at this point. Do you mean it largely depends on the diversity of options on input and output