Make 'branch.c' use 'ref-filter' APIs for iterating through refs
sorting. This removes most of the code used in 'branch.c' replacing it
with calls to the 'ref-filter' library.
Make 'branch.c' use the 'filter_refs()' function provided by 'ref-filter'
to filter out tags based on the options set.
We
Add the '--points-at' option provided by 'ref-filter'. The option lets
the user to list only branches which points at the given object.
Add documentation and tests for the same.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
Documentation/git-branch.t
Make 'branch.c' use 'ref-filter' data structures and make changes to
support the new data structures. This is a part of the process of
porting 'branch.c' to use 'ref-filter' APIs.
This is a temporary step before porting 'branch.c' to use 'ref-filter'
completely. As this is a temporary step, most o
Remove show_detached() and make detached HEAD to be rolled into
regular ref_list by adding REF_DETACHED_HEAD as a kind of branch and
supporting the same in append_ref(). This eliminates the need for an
extra function and helps in easier porting of branch.c to use
ref-filter APIs.
Before show_detac
We check if given ref is the current branch in print_ref_list(). Move
this check to print_ref_item() where it is checked right before
printing.
Based-on-patch-by: Jeff King
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
builtin/branch.c | 22 +
Remove the error reporting variable to make the code easier to port
over to using ref-filter APIs. This variable is not required as in
ref-filter we already check for possible errors and report them.
Based-on-patch-by: Jeff King
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off
This is a preperatory patch for 'roll show_detached HEAD into regular
ref_list'. This patch moves get_head_description() to the top so that
it can be used in print_ref_item().
Based-on-patch-by: Jeff King
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
From: Karthik Nayak
Remove unnecessary variables from ref_list and ref_item which were
used for width computation. This is to make ref_item similar to
ref-filter's ref_array_item. This will ensure a smooth port of
branch.c to use ref-filter APIs in further patches.
Previously the maxwidth was co
This is a follow up to porting tag.c to use ref-fitler APIs.
v2 of this patch series can be found here:
http://thread.gmane.org/gmane.comp.version-control.git/276147
Changes made in this series:
* Improve comment in 3/8 and fix grammar in 5/8.
* Fix the test in t1430 to check stderr for the broke
Implement the '--format' option provided by 'ref-filter'.
This lets the user list tags as per desired format similar
to the implementation in 'git for-each-ref'.
Add tests and documentation for the same.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
From: Karthik Nayak
In 'tag.c' we can print N lines from the annotation of the tag using
the '-n' option. Copy code from 'tag.c' to 'ref-filter' and
modify 'ref-filter' to support printing of N lines from the annotation
of tags.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-of
Implement an `align` atom which left-, middle-, or right-aligns the
content between %(align:..) and %(end).
It is followed by `:,`, where the `` is
either left, right or middle and `` is the size of the area
into which the content will be placed. If the content between
%(align:) and %(end) is more
Add strbuf_utf8_align() which will align a given string into a strbuf
as per given align_type and width. If the width is greater than the
string length then no alignment is performed.
Helped-by: Eric Sunshine
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
Part of my GSoC project to port tag.c to use ref-filter APIs. This is
a follow up to porting for-each-ref to use ref-filter APIs.
Version 12 can be found here:
thread.gmane.org/gmane.comp.version-control.git/276133
Changes since v12:
* %(align)...%(end) now quote formats everything in between the
Introduce ref_formatting_state which will hold the formatted output
strbuf instead of directly printing to stdout. This will help us in
creating modifier atoms which modify the format specified before
printing to stdout.
Implement a stack machinery for ref_formatting_state, this allows us
to push
From: Karthik Nayak
Since 'ref-filter' only has an option to match path names add an
option for plain fnmatch pattern-matching.
This is to support the pattern matching options which are used in `git
tag -l` and `git branch -l` where we can match patterns like `git tag
-l foo*` which would match
From: Karthik Nayak
Add support to sort by version using the "v:refname" and
"version:refname" option. This is achieved by using the 'versioncmp()'
function as the comparing function for qsort.
This option is included to support sorting by versions in `git tag -l`
which will eventually be ported
From: Karthik Nayak
Add a function called 'for_each_reftype_fullpath()' to refs.{c,h}
which iterates through each ref for the given path without trimming
the path and also accounting for broken refs, if mentioned.
Add 'filter_ref_kind()' in ref-filter.c to check the kind of ref being
handled and
From: Karthik Nayak
Make 'tag.c' use 'ref-filter' data structures and make changes to
support the new data structures. This is a part of the process
of porting 'tag.c' to use 'ref-filter' APIs.
This is a temporary step before porting 'tag.c' to use 'ref-filter'
completely. As this is a temporary
Use 'ref-filter' APIs to implement the '--merged' and '--no-merged'
options into 'tag.c'. The '--merged' option lets the user to only list
tags merged into the named commit. The '--no-merged' option lets the
user to only list tags not merged into the named commit. If no object
is provided it assum
From: Karthik Nayak
Make 'tag.c' use 'ref-filter' APIs for iterating through refs, sorting
and printing of refs. This removes most of the code used in 'tag.c'
replacing it with calls to the 'ref-filter' library.
Make 'tag.c' use the 'filter_refs()' function provided by 'ref-filter'
to filter out
Since atom_value is only required for the internal working of
ref-filter it doesn't belong in the public header.
Helped-by: Eric Sunshine
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
ref-filter.c | 5 +
ref-filter.h | 5 +
2 files changed, 6
While commit 9f673f9 (gc: config option for running --auto in
background - 2014-02-08) helps reduce some complaints about 'gc
--auto' hogging the terminal, it creates another set of problems.
The latest in this set is, as the result of daemonizing, stderr is
closed and all warnings are lost. This
I renamed both "flags" and "touched_flags" fields while making this
patch to make sure I was aware of how these flags were manipulated
(besides DIFF_OPT* macros). So hopefully I didn't miss anything.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Resend to the right recipients. I screwed send-email up.
The original commit d95d728aba06a34394d15466045cbdabdada58a2 was
reverted in commit 78cc1a540ba127b13f2f3fd531777b57f3a9cd46 because we
were (and still are) not ready for a new world order. A lot more
investigation must be done to see what is impacted. See the 78cc1a5 for
details.
This patch takes
I renamed both "flags" and "touched_flags" fields while making this
patch to make sure I was aware of how these flags were manipulated
(besides DIFF_OPT* macros). So hopefully I didn't miss anything.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/commit.c | 2 +-
diff-lib.c | 4 ++--
diff
The expression "!S_ISREG(ce)" covers i-t-a entries as well because
ce->ce_mode would be zero then. I could make a comment saying that, but
it's probably better just to comment with code, in case i-t-a entry
content changes in future.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/grep.c | 2 +-
The cached blob of i-t-a entries are empty blob. By checkout, we delete
the content we have. Don't do it.
This is done higher up instead of inside checkout_entry() because we
would have limited options in there: silently ignore, loudly ignore,
die. At higher level we can do better reporting. For e
Applying a patch that adds a file when that file is registered with "git
add -N" will fail with message "already exists in index" because
git-apply checks, sees those i-t-a entries and aborts. git-apply does
not realize those are for bookkeeping only, they do not really exist in
the index. This pat
The test case probably describes the test scenario the best. We have a
patch to modify some file but the base file is gone. Because
check_preimage() finds an index entry with the same old_name, it tries
to restore the on-disk base file with cached content with
checkout_target() and move on.
If thi
That "someday" in the comment happened two years later in
b65982b (Optimize "diff-index --cached" using cache-tree - 2009-05-20)
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/blame.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index 4db01c1..942f30
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/rm.c | 2 +-
cache-tree.c | 2 +-
cache.h | 1 +
read-cache.c | 4 ++--
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/builtin/rm.c b/builtin/rm.c
index 80b972f..8829b09 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -211,7 +21
On Thu, Jun 25, 2015 at 8:07 PM, Junio C Hamano wrote:
>>> Perhaps a good and safe way forward to resurrect what d95d728a
>>> wanted to do is to first add an option to tell run_diff_index() and
>>> run_diff_files() which behaviour the caller wants to see, add that
>>> only to the caller in wt-stat
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/clone.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index 836fb64..7a010bb 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -294,9 +294,14 @@ static int add_one_reference(struct st
On Wed, Jul 15, 2015 at 8:25 PM, Duy Nguyen wrote:
> On Wed, Jul 15, 2015 at 11:40:18AM +0200, Bjørnar Snoksrud wrote:
>> I reported this before, but now I have a nice topic to hang it on -
>>
>> I have re-reproduced the bug using a build from master as of today,
>> using the new worktree commands
Signed-off-by: Nguyễn Thái Ngọc Duy
---
path.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/path.c b/path.c
index a536ee3..7340e11 100644
--- a/path.c
+++ b/path.c
@@ -441,8 +441,7 @@ const char *enter_repo(const char *path, int strict)
else if (chdir(path))
Strict mode is about not guessing where .git is. If the user points to a
.git file, we know exactly where the target .git dir will be.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
path.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/path.c b/path.c
index 7340e11..32d4ca
Noticed-by: Bjørnar Snoksrud
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/clone.c | 6 --
t/t2025-worktree-add.sh | 5 +
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index 578da85..836fb64 100644
--- a/builtin/clone.c
+++ b/b
Signed-off-by: Nguyễn Thái Ngọc Duy
---
path.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/path.c b/path.c
index 95acbaf..a536ee3 100644
--- a/path.c
+++ b/path.c
@@ -431,7 +431,7 @@ const char *enter_repo(const char *path, int strict)
}
if
On Fri, Aug 21, 2015 at 3:55 PM, Guido Vranken wrote:
> germane exploitation details. I did find an older thread in the
> archive addressing this question (
> http://thread.gmane.org/gmane.comp.version-control.git/260328/ ), but
> because I'm unsure if those e-mail addresses are still relevant, I'
On Fri, Aug 21, 2015 at 3:47 PM, Jānis Rukšāns wrote:
> Hello,
>
>
> First of all, I apologise for the wall of text that follows; obviously I
> am bad at this.
>
> My $DAYJOB is switching from Subversion to Git, primarily because of
> it's distributed nature (we are scattered all across the globe)
The addresses are still valid. (I think there was a plan to introduce
a git-security@...
but I am not sure if that happened.)
> Current practice is to contact Junio C Hamano pobox.com>.
> Cc-ing Jeff King peff.net> isn't a bad idea while at it.
Just go for that.
On Fri, Aug 21, 2015 at 3:55 P
On Fri, Aug 21, 2015 at 12:44 PM, Jeff King wrote:
> On Fri, Aug 21, 2015 at 12:05:13PM -0700, Junio C Hamano wrote:
>
>> The primary reason I suspect is because you sent to a wrong set of
>> people. Submodule folks have largely been working in the scripted
>> ones, and may not necessarily be the
List,
I would like to report security vulnerabilities in git. Due to the
sensitive nature of security-impacting bugs I would like to know if
there's a dedicated e-mail address for this, so that the issues at
play can be patched prior to a coordinated public disclosure of the
germane exploitation d
Hello,
First of all, I apologise for the wall of text that follows; obviously I
am bad at this.
My $DAYJOB is switching from Subversion to Git, primarily because of
it's distributed nature (we are scattered all across the globe), and the
ease of branching and merging. One issue that has popped
Ivan Chernyavsky writes:
> But now I had a look on the source and I can see that builtin/branch.c
> builds the list of references and prints them in a single place
> (print_ref_list()) so I will have to split that function into two in
> order to reuse existing functionality.
>
> Another problem i
Jeff King writes:
> I think the plan is:
>
> 1. squelch the warning message from the config code; even if we change
> the config format to pager.*.command, we will have to support
> pager.* for historical reasons.
>
> 2. introduce pager.*.command so that "git foo_bar" can use
>
On Fri, Aug 21, 2015 at 4:49 PM, SZEDER Gábor wrote:
> Quoting Junio C Hamano :
>> Eric Sunshine writes:
>>> On Thu, Jul 23, 2015 at 4:49 PM, Eric Sunshine
>>> wrote:
Complete subcommands 'add' and 'prune', as well as their respective
options --force, --detach, --dry-run, --verbose, an
Junio C Hamano writes:
> The latter was inspired by a recent discussion, most notably
>
>http://thread.gmane.org/gmane.comp.version-control.git/273937/focus=273988
>
> but implements it with a much less UI impact. Tweaking "git log -p"
> has a lot of fallout---interested parties can try it o
17.08.2015, 20:49, "Junio C Hamano" :
> Duy Nguyen writes:
>
>> On Wed, Aug 5, 2015 at 7:47 PM, Ivan Chernyavsky
>> wrote:
>
> That is a dangeous thought. I'd understand if it were internally
> two step process, i.e. (1) the first pass finds commits that hits
> the --grep criteria and th
On Fri, Aug 21, 2015 at 1:47 PM, Junio C Hamano wrote:
>
> I do not think we are on the same wavelength. What I meant was to
> do this:
>
> aq = xmalloc(...);
> set up _everything_ in aq and make it a consistent state;
> /* aq->first and aq->last are part of _everything_ i
Signed-off-by: SZEDER Gábor
---
> I wrote a completion function for 'git worktree' as well, turns out a week
> or two before you posted this, but I never submitted it as it was way too
> convoluted. Anyway, will send it in reply to this, just for reference.
And here it is.
>From the number of i
Quoting Junio C Hamano :
Eric Sunshine writes:
On Thu, Jul 23, 2015 at 4:49 PM, Eric Sunshine
wrote:
Complete subcommands 'add' and 'prune', as well as their respective
options --force, --detach, --dry-run, --verbose, and --expire. Also
complete 'refname' in "git worktree add [-b ]
".
Stefan Beller writes:
>>> +struct task_queue *create_task_queue(unsigned max_threads)
>>> +{
>>> + struct task_queue *aq = xmalloc(sizeof(*aq));
>>> +
>>> +#ifndef NO_PTHREADS
>>> + int i;
>>> + if (!max_threads)
>>> + aq->max_threads = online_cpus();
>>> + else
>>> +
Jeff King writes:
> On Fri, Aug 21, 2015 at 12:05:13PM -0700, Junio C Hamano wrote:
>
>> The primary reason I suspect is because you sent to a wrong set of
>> people. Submodule folks have largely been working in the scripted
>> ones, and may not necessarily be the ones who are most familiar with
Dear Invited Author,
You have 6 days until August 25 for your Invited Paper in the WSEAS Conferences
in Seoul, South Korea.
We have just upgraded the role of Invited Speakers (see below). The extended
version of the accepted papers will be published in our collaborating 44 ISI
Journals.
If Au
On Fri, Aug 21, 2015 at 12:23 PM, Junio C Hamano wrote:
> Stefan Beller writes:
>
>> +struct submodule_args {
>> + const char *name;
>> + const char *path;
>> + const char *sha1;
>> + const char *toplevel;
>> + const char *prefix;
>> + const char **cmd;
>> + struct sub
On Fri, Aug 21, 2015 at 12:51 PM, Jeff King wrote:
> On Fri, Aug 21, 2015 at 12:48:23PM -0700, Stefan Beller wrote:
>
>> > Before even looking at the implementation, my first question would be
>> > whether this pattern is applicable in several places in git (i.e., is it
>> > worth the extra comple
On Fri, Aug 21, 2015 at 12:48:23PM -0700, Stefan Beller wrote:
> > Before even looking at the implementation, my first question would be
> > whether this pattern is applicable in several places in git (i.e., is it
> > worth the extra complexity of abstracting out in the first place). I
> > think t
On Fri, Aug 21, 2015 at 12:44 PM, Jeff King wrote:
> On Fri, Aug 21, 2015 at 12:05:13PM -0700, Junio C Hamano wrote:
>
>> The primary reason I suspect is because you sent to a wrong set of
>> people. Submodule folks have largely been working in the scripted
>> ones, and may not necessarily be the
On Fri, Aug 21, 2015 at 12:05 PM, Junio C Hamano wrote:
> Stefan Beller writes:
>
>> This adds functionality to do work in parallel.
>>
>> The whole life cycle of such a thread pool would look like
>>
>> struct task_queue * tq = create_task_queue(32); // no of threads
>> for (...)
>>
On Fri, Aug 21, 2015 at 12:05:13PM -0700, Junio C Hamano wrote:
> The primary reason I suspect is because you sent to a wrong set of
> people. Submodule folks have largely been working in the scripted
> ones, and may not necessarily be the ones who are most familiar with
> the run-command infrast
On Fri, Aug 21, 2015 at 10:43:58AM -0700, Junio C Hamano wrote:
> Junio C Hamano writes:
>
> > I wonder if we can do this instead
> >
> > if (!omit_values) {
> > - if (show_keys)
> > + if (show_keys && value_)
> > strbuf_addch(buf, key_delim);
> >
> >
Stefan Beller writes:
> +struct submodule_args {
> + const char *name;
> + const char *path;
> + const char *sha1;
> + const char *toplevel;
> + const char *prefix;
> + const char **cmd;
> + struct submodule_output *out;
> + sem_t *mutex;
> +};
I do not see what s
Stefan Beller writes:
> This adds functionality to do work in parallel.
>
> The whole life cycle of such a thread pool would look like
>
> struct task_queue * tq = create_task_queue(32); // no of threads
> for (...)
> add_task(tq, process_one_item_function, item); // non blocking
Two logical lines that were not overly long was split in the middle,
which made them read worse.
Signed-off-by: Junio C Hamano
---
builtin/log.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 0cdd889..a491d3d 100644
--- a/builtin/log
larsxschnei...@gmail.com writes:
> From: Lars Schneider
>
> PROBLEM:
> We run P4 servers on Linux and P4 clients on Windows. For an unknown
> reason the file path for a number of files in P4 does not match the
> directory path with respect to case sensitivity.
>
> E.g. `p4 files` might return
> /
Junio C Hamano writes:
> I wonder if we can do this instead
>
> if (!omit_values) {
> - if (show_keys)
> + if (show_keys && value_)
> strbuf_addch(buf, key_delim);
>
> though. That would eliminate the need for rolling back.
No we cannot. "con
Jeff King writes:
> When formatting a config value into a strbuf, we may end
> up stringifying it into a fixed-size buffer using sprintf,
> and then copying that buffer into the strbuf. We can
> eliminate the middle-man (and drop some calls to sprintf!)
> by writing directly to the strbuf.
>
> Th
Eric Sunshine writes:
> On Thu, Jul 23, 2015 at 4:49 PM, Eric Sunshine
> wrote:
>> Complete subcommands 'add' and 'prune', as well as their respective
>> options --force, --detach, --dry-run, --verbose, and --expire. Also
>> complete 'refname' in "git worktree add [-b ]
>> ".
>
> Ping[1]?
>
>
From: Lars Schneider
PROBLEM:
We run P4 servers on Linux and P4 clients on Windows. For an unknown
reason the file path for a number of files in P4 does not match the
directory path with respect to case sensitivity.
E.g. `p4 files` might return
//depot/path/to/file1
//depot/PATH/to/file2
If you
Andreas Schwab writes:
> Change to in the description of
> gc.*.reflogExpireUnreachable, since that is what the text refers to.
>
> Signed-off-by: Andreas Schwab
> ---
Makes sense. Thanks.
> Documentation/config.txt | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/D
On Fri, 21 Aug 2015, Jeff King wrote:
> - we may still have the opposite problem with renames. That is, a
> rename is _also_ a deletion, but will go to the end. So I would
> expect renaming the symlink "foo" to "bar" and then adding
> "foo/world" would end up with:
>
>M 10064
David Aguilar writes:
> Signed-off-by: David Aguilar
> ---
> builtin/am.c | 8
> 1 file changed, 4 insertions(+), 4 deletions(-)
Naming the tree_desc parameter given to unpack_trees() as "t" is
(unfortunately) an established convention, just like we often use
"i" and "j" in for() loop
David Aguilar writes:
> Reported-by: Linus Torvalds
> Signed-off-by: David Aguilar
> @@ -1975,10 +1977,20 @@ static int clean_index(const unsigned char *head,
> const unsigned char *remote)
>
> memset(&pathspec, 0, sizeof(pathspec));
>
> + memset(&opts, 0, sizeof(opts));
> + o
SZEDER Gábor writes:
> 'git describe --contains' doesn't default to HEAD when no commit is
> given, and it doesn't produce any output, not even an error:
>
> ~/src/git ((v2.5.0))$ ./git describe --contains
> ~/src/git ((v2.5.0))$ ./git describe --contains HEAD
> v2.5.0^0
Good spotting. I t
On Fri, Aug 21, 2015 at 09:10:35AM -0700, Junio C Hamano wrote:
> > $ git \#fetch
> > error: invalid key: pager.#fetch
> > error: invalid key: alias.#fetch
> > git: '#fetch' is not a git command. See 'git --help'.
> >
> > Did you mean this?
> > fetch
>
> Thanks. I somehow thought that we
Bjørnar Snoksrud writes:
> If you mis-type a git command starting with a non-letter, git
> internals will spit out some errors at you.
>
> $ git 5fetch
> error: invalid key: pager.5fetch
> error: invalid key: alias.5fetch
> git: '5fetch' is not a git command. See 'git --help'.
>
> Did you mean th
SZEDER Gábor writes:
> Quoting Junio C Hamano :
>
>> Well, that can be argued both ways.
> ...
>
> 'git describe' errors out by default if it can't describe the given
> commit.
Yes. "describe" always fails when it cannot produce an acceptable
description.
And "--always" and "--exact-match" are
Change to in the description of
gc.*.reflogExpireUnreachable, since that is what the text refers to.
Signed-off-by: Andreas Schwab
---
Documentation/config.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 75ec02e.
On Wed, Aug 19, 2015 at 03:46:25PM -0400, Dave Borowitz wrote:
> >> + unsigned dry_run = 0;
> >> + unsigned send_mirror = 0;
> >> + unsigned force_update = 0;
> >> + unsigned quiet = 0;
> >> + unsigned push_cert = 0;
> >> + unsigned use_thin_pack = 0;
> >> +
On Wed, Aug 19, 2015 at 03:46:27PM -0400, Anders Kaseorg wrote:
> git fast-export | git fast-import fails to preserve a commit that replaces
> a symlink with a directory. Add a failing test case demonstrating this
> bug.
>
> The fast-export output for the commit in question looks like
>
> c
Hi,
I’ve faced a strange behavior when filtering git log by date.
When used with “--date-order” it gives significantly less results that when
used without that option:
# git log --pretty=oneline --remotes "--after=Wed May 20 23:00:00 MSK 2015"
"--before=Fri May 22 00:00:00 MSK 2015" -- | wc -
'git describe --contains' doesn't default to HEAD when no commit is
given, and it doesn't produce any output, not even an error:
~/src/git ((v2.5.0))$ ./git describe --contains
~/src/git ((v2.5.0))$ ./git describe --contains HEAD
v2.5.0^0
Unlike other 'git describe' options, the '--contains
On Mon, Aug 17, 2015 at 05:22:03PM -0700, Stefan Beller wrote:
> +static int module_clone(int argc, const char **argv, const char *prefix)
> [...]
> + /* Redirect the worktree of the submodule in the superprojects config */
> + if (!is_absolute_path(sm_gitdir)) {
> + char *s =
In the previous change in this function, we add locale support for
single-byte encodings only. It looks like pcre only supports utf-* as
multibyte encodings, the others are left in the cold (which is
fine).
We need to enable PCRE_UTF8 so pcre can find character boundary
correctly. It's needed for
Similar to the "grep -F -i" case, we can't use kws on icase search
outside ascii range, so we quote the string and pass it to regcomp as
a basic regexp and let regex engine deal with case sensitivity.
The new test is put in t7812 instead of t4209-log-pickaxe because
lib-gettext.sh might cause prob
There's another regcomp code block coming in this function. By moving
the error handling code out of this block, we don't have to add the
same error handling code in the new block.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
diffcore-pickaxe.c | 16
1 file changed, 8 insertions(+),
This function returns true if git is running under an UTF-8
locale. pcre in the next patch will need this.
is_encoding_utf8() is used instead of strcmp() to catch both "utf-8"
and "utf8" suffixes.
When built with no gettext support, we peek in several env variables
to detect UTF-8. pcre library m
The default tables are usually built with C locale and only suitable
for LANG=C or similar. This should make case insensitive search work
correctly for all single-byte charsets.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
grep.c | 8 ++--
grep.h
Similar to the previous commit, we can't use kws on icase search
outside ascii range. But we can't simply pass the pattern to
regcomp/pcre like the previous commit because it may contain regex
special characters, so we need to quote the regex first.
To avoid misquote traps that could lead to undef
Sorry it took more than a month for a simple reroll. Free time (with
energy left) is rare these days. v4 adds system regex's icase support
detection and only runs tests in these cases. This should fix test
failures on Windows where compat regex does not support icase.
Diff from v3 below
diff --gi
-F means "no regex", not "case sensitive" so it should not override -i
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/grep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/grep.c b/builtin/grep.c
index d04f440..2d392e9 100644
--- a/builtin/grep.c
+++ b/builtin/grep.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
test-regex.c | 56 ++--
1 file changed, 50 insertions(+), 6 deletions(-)
diff --git a/test-regex.c b/test-regex.c
index 0dc598e..3b5641c 100644
--- a/test-regex.c
+++ b/test-regex.c
@@ -1,19 +1,63 @@
#in
When we detect the pattern is just a literal string, we avoid heavy
regex engine and use fast substring search implemented in kwsset.c.
But kws uses git-ctype which is locale-independent so it does not know
how to fold case properly outside ascii range. Let regcomp or pcre
take care of this case in
Signed-off-by: Nguyễn Thái Ngọc Duy
---
grep.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/grep.c b/grep.c
index b58c7c6..bd32f66 100644
--- a/grep.c
+++ b/grep.c
@@ -403,9 +403,11 @@ static void compile_regexp(struct grep_pat *p, struct
grep_opt *opt)
p->wo
Quoting Jeff King :
When formatting a config value into a strbuf, we may end
up stringifying it into a fixed-size buffer using sprintf,
and then copying that buffer into the strbuf. We can
eliminate the middle-man (and drop some calls to sprintf!)
by writing directly to the strbuf.
The reason
On Fri, 2015-08-21 at 13:36 +0200, Joakim Tjernlund wrote:
> I cannot push:
> # > git push origin
> Login for jo...@git.transmode.se
> Password:
> Counting objects: 7, done.
> Delta compression using up to 4 threads.
> Compressing objects: 100% (7/7), done.
> Writing objects: 100% (7/7), 13.73 KiB
I cannot push:
# > git push origin
Login for jo...@git.transmode.se
Password:
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 13.73 KiB | 0 bytes/s, done.
Total 7 (delta 4), reused 0 (delta 0)
fatal: Unable to
Quoting Junio C Hamano :
SZEDER Gábor writes:
'git describe [...] --always' should always show the unique abbreviated
object name as a fallback when the given commit cannot be described with
the given set of options, see da2478dbb0 (describe --always: fall back
to showing an abbreviated obje
1 - 100 of 106 matches
Mail list logo