On Thu, Sep 24 2015, Jeff King wrote:
> This also eliminates calls to strcpy, which make auditing
> the code base harder.
Maybe may English parser is broken, but this doesn't immediately sound
like what you meant to say. Also, in 29/68 you say "We drop calls to
strcpy, which makes auditing the c
27;s just help less smart
compilers generate good code anyway.
Signed-off-by: Rasmus Villemoes
---
shallow.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/shallow.c b/shallow.c
index 8b1c35d..5aec5a5 100644
--- a/shallow.c
+++ b/shallow.c
@@ -464,7 +464,7 @@ static
It seems to be odd to do x=y if x==y. Maybe there's a bug somewhere near
this, but as is this is somewhat confusing.
Signed-off-by: Rasmus Villemoes
---
shallow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/shallow.c b/shallow.c
index 5aec5a5..7c28239 100644
and size.
Signed-off-by: Rasmus Villemoes
---
shallow.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/shallow.c b/shallow.c
index 4d0b005..e21534a 100644
--- a/shallow.c
+++ b/shallow.c
@@ -445,11 +445,13 @@ static uint32_t *paint_alloc(struct paint_info *info)
hat the LHS could wrap
around 0, giving a false negative.
This might as well be written using pointer subtraction avoiding these
issues.
Signed-off-by: Rasmus Villemoes
---
shallow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/shallow.c b/shallow.c
index e21534a..8b1
On Thu, Dec 08 2011, Joe Perches wrote:
> On Thu, 2011-12-08 at 11:37 -0800, Junio C Hamano wrote:
>> Joe Perches writes:
>> > Many types of signatures are used by various projects.
>> > The most common type is formatted:
>> >"[some_signature_type]-by: First Last "
>> > e.g:
>> >"Reporte
On 04/04/2019 11.27, Baruch Siach wrote:
> Hi Junio,
>
> On Thu, Apr 04 2019, Junio C. Hamano wrote:
>> Baruch Siach writes:
>>
Independently, I think it makes sense to do something like
/^([a-z][a-z-]*-by|Cc): (.*)/i
to tighten the match to exclude a non-trailer; that
which is different from the current behaviour of using
stdout. I'm not sure what the most correct thing is, but I assume --help
is mostly used interactively with stdout and stderr pointing at the same
place.
Signed-off-by: Rasmus Villemoes
---
Documentation/config.txt | 10 +
On 2018-09-26 17:16, Junio C Hamano wrote:
> Rasmus Villemoes writes:
>
>> +/*
>> + * We use split_cmdline() to get the first word of the
>> + * alias, to ensure that we use the same rules as when
>> + * the alias i
On 2018-09-26 17:19, Duy Nguyen wrote:
> On Wed, Sep 26, 2018 at 4:42 PM Taylor Blau wrote:
>>> +
>>> + /*
>>> + * We use split_cmdline() to get the first word of the
>>> + * alias, to ensure that we use the same rules as when
>>> + * the alias is
On 2018-09-26 20:12, Taylor Blau wrote:
>
> In the case where you are scripting (and want to know what 'git co'
> means for programmatic usage), I think that there are two options. One,
> which you note above, is the 'git -c help.followAlias=false ...'
> approach, which I don't think is so bad for
On 2018-09-26 20:49, Jeff King wrote:
> On Wed, Sep 26, 2018 at 08:16:36AM -0700, Junio C Hamano wrote:
>
>>
>> If we expect users to use "git cp --help" a lot more often than "git
>> help cp" (or the other way around), one way to give a nicer experience
>> may be to unconditionally make "git cp -
This documents the existing behaviour of "git help cmd" when cmd is an
alias, as well as providing a hint to use the "git cmd --help" form to
be taken directly to the man page for the aliased command.
Signed-off-by: Rasmus Villemoes
---
Documentation/git-help.txt | 4 +++
rinting
this line to stderr should not hurt, and can help in figuring out what
is happening in a case like
$ git sc -h
'sc' is aliased to '!somecommand'
somecommand: invalid option '-h'
Suggested-by: Jeff King
Signed-off-by: Rasmus Villemoes
---
git.c | 3 +++
itbar"
case.
[1] https://public-inbox.org/git/20180926102636.30691-1...@rasmusvillemoes.dk/
[2] https://public-inbox.org/git/20180926184914.gc30...@sigill.intra.peff.net/
Signed-off-by: Rasmus Villemoes
---
builtin/help.c | 26 +++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff -
On 2018-10-03 04:13, Jeff King wrote:
>> +/*
>> + * If we were invoked as "git help cmd", or cmd is an
>> + * alias for a shell command, we inform the user what
>> + * cmd is an alias for and do nothing else.
>> + */
>> +if (!e
On 2018-10-03 04:18, Jeff King wrote:
> On Mon, Oct 01, 2018 at 01:21:07PM +0200, Rasmus Villemoes wrote:
>
>>
>> +If an alias is given, git prints a note explaining what it is an alias
>> +for on standard output. To get the manual page for the aliased
>> +co
rinting
this line to stderr should not hurt, and can help in figuring out what
is happening in a case like
$ git sc -h
'sc' is aliased to '!somecommand'
somecommand: invalid option '-h'
Suggested-by: Jeff King
Signed-off-by: Rasmus Villemoes
---
git.c | 3 +++
ecker reports. Use better wording in patch 3.
Rasmus Villemoes (3):
help: redirect to aliased commands for "git cmd --help"
git.c: handle_alias: prepend alias info when first argument is -h
git-help.txt: document "git help cmd" vs "git cmd --help" for aliases
This documents the existing behaviour of "git help cmd" when cmd is an
alias, as well as providing a hint to use the "git cmd --help" form to
be taken directly to the man page for the aliased command.
Signed-off-by: Rasmus Villemoes
---
Documentation/git-help.txt | 4 +++
itbar"
case.
[1] https://public-inbox.org/git/20180926102636.30691-1...@rasmusvillemoes.dk/
[2] https://public-inbox.org/git/20180926184914.gc30...@sigill.intra.peff.net/
Signed-off-by: Rasmus Villemoes
---
builtin/help.c | 34 +++---
1 file changed, 31 insertions(+), 3 deletions(-)
On 2018-10-05 10:19, Junio C Hamano wrote:
> Rasmus Villemoes writes:
>
>>
>> I believe that printing the "is aliased to" message also in case (2) has
>> value: Depending on pager setup, or if the user has help.format=web, the
>> message is still prese
ecker reports. Use better wording in patch 3.
v4: Reword commit log in patch 1.
Rasmus Villemoes (3):
help: redirect to aliased commands for "git cmd --help"
git.c: handle_alias: prepend alias info when first argument is -h
git-help.txt: document "git help cmd" vs &qu
rolled
away, but being printed to stderr, it should never hurt.
[1] https://public-inbox.org/git/20180926102636.30691-1...@rasmusvillemoes.dk/
[2] https://public-inbox.org/git/20180926184914.gc30...@sigill.intra.peff.net/
Signed-off-by: Rasmus Villemoes
---
builtin/help.c | 34 +++
rinting
this line to stderr should not hurt, and can help in figuring out what
is happening in a case like
$ git sc -h
'sc' is aliased to '!somecommand'
somecommand: invalid option '-h'
Suggested-by: Jeff King
Signed-off-by: Rasmus Villemoes
---
git.c | 3 +++
This documents the existing behaviour of "git help cmd" when cmd is an
alias, as well as providing a hint to use the "git cmd --help" form to
be taken directly to the man page for the aliased command.
Signed-off-by: Rasmus Villemoes
---
Documentation/git-help.txt | 4 +++
For consistency, add full stops in a few places and outdent a line by
one space.
Signed-off-by: Rasmus Villemoes
---
Documentation/git-send-email.txt | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
7;sob' means in this line from 'git send-email -h':
--suppress-cc * author, self, sob, cc, cccmd, body,
bodycc, all.
Rasmus Villemoes (3):
Documentation/git-send-email.txt: style fixes
send-email: only consider lines containing @ or <> for automatic
dy has its own
suppression category. It seems natural to make 'misc-by' implied by
'body'.
Based-on-patch-by: Joe Perches
Signed-off-by: Rasmus Villemoes
---
Documentation/git-send-email.txt | 5 -
git-send-email.perl | 14 --
2 files changed,
ing a garbage address, insist on at least a @ or a <>
pair being present.
This is also preparation for the next patch, where we are likely to
encounter even more non-addresses in -by lines, such as
Reported-by: Coverity
Patch-generated-by: Coccinelle
Signed-off-by: Rasmus Villemoes
-
On 2018-10-10 14:57, Ævar Arnfjörð Bjarmason wrote:
>
> On Wed, Oct 10 2018, Rasmus Villemoes wrote:
>
>> +if ($c !~ /.+@.+|<.+>/) {
>> +printf("(body) Ignoring %s from line '%s'\n",
>> +
On 2018-10-11 08:06, Junio C Hamano wrote:
> Rasmus Villemoes writes:
>
>> I considered that (and also had a version where I simply insisted on a @
>> being present), but that means the user no longer would get prompted
>> about the cases where the address was just sligh
On 2018-10-11 08:18, Junio C Hamano wrote:
> Rasmus Villemoes writes:
> we now ...
>
>> +next if $suppress_cc{'sob'} and $what =~
>> /^Signed-off-by$/i;
>
> ... must make sure what we have is _exactly_ "signed-off-by
On 2018-10-16 07:57, Junio C Hamano wrote:
> Rasmus Villemoes writes:
>
>>> I wonder if it would make it easier to grok if we made the logic
>>> inside out, i.e.
>>>
>>> if ($sc eq $sender) {
>>> ...
>>>
dy has its own
suppression category. It seems natural to make 'misc-by' implied by
'body'.
Based-on-patch-by: Joe Perches
Signed-off-by: Rasmus Villemoes
---
Documentation/git-send-email.txt | 5 -
git-send-email.perl | 19 ---
2 files changed,
ing a garbage address, insist on at least a @ or a <>
pair being present.
This is also preparation for the next patch, where we are likely to
encounter even more non-addresses in -by lines, such as
Reported-by: Coverity
Patch-generated-by: Coccinelle
Signed-off-by: Rasmus Villemoes
-
b' means in this line from 'git send-email -h':
--suppress-cc * author, self, sob, cc, cccmd, body,
bodycc, all.
Rasmus Villemoes (3):
Documentation/git-send-email.txt: style fixes
send-email: only consider lines containing @ or <> for automatic
Cc'ing
For consistency, add full stops in a few places and outdent a line by
one space.
Signed-off-by: Rasmus Villemoes
---
Documentation/git-send-email.txt | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
aders
and/or people who copy the producer/consumer logic to their own code.
Rasmus Villemoes (5):
builtin/grep.c: change todo_* variables to unsigned
builtin/grep.c: refactor loop in work_done() slightly
builtin/grep.c: add shorthand for &todo[todo_end] in add_work()
builtin/grep.c: add
Use a helper for indexing into the todo array with any of the todo_*
variables, in preparation for not keeping those reduced mod TODO_SIZE.
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/builtin/grep.c b/builtin
ad of todo_done.
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/builtin/grep.c b/builtin/grep.c
index 35ed79b0dd..ce158cabbb 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -102,7 +102,7 @@ static void add_w
In preparation for subsequent patches that make todo_* free-running
instead of reducing them mod TODO_SIZE, change their type to unsigned
to avoid undefined behaviour in case anybody ever greps more than 2
billion files.
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 8
1 file
As preparation for changing all accesses to the todo array to use a
helper function, do the .done check in the loop body.
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builtin/grep.c b/builtin/grep.c
index 6c1e90d43b
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/builtin/grep.c b/builtin/grep.c
index 211ae54222..92b9e6198d 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -93,18 +93,20 @@ static int skip_first_line
ick up anything from that due to the anchoring. Except for the
misc-by regexp that added hyphens to grab Reported-and-tested-by and
similar. So this is by far the simplest fix that doesn't hurt the common
use cases the misc-by handling was added to support, so
Acked-by: Rasmus Villemoes
Rasmus
As part of my dayjob, I did and still do some work on an upstream
project. A while ago, I was granted commit access to that project.
However, upstream asked that I would register with their system using a
private email, or at least one that wouldn't change if I changed jobs,
rather than my work ema
On 2018-08-30 20:13, Eric Sunshine wrote:
> On Thu, Aug 30, 2018 at 7:26 AM Rasmus Villemoes
> wrote:
>> I can set GIT_COMMITTER_EMAIL in the environment, but that is
>> rather inconvenient, since that means I have to remember to do that in
>> the shell I'm using for
On 16 February 2018 at 02:15, Rasmus Villemoes wrote:
> This is a very naive attempt at teaching git cherry to restrict
> attention to a given pathspec. Very much RFC, hence no documentation
> update or test cases for now.
>
Ping, any comments on this?
The man page for update-index says
-q
Quiet. If --refresh finds that the index needs an update,
the default behavior is to error out. This
option makes git update-index continue anyway.
--ignore-submodules
Do not try to update submodules. This option
I believe the first two should be ok, but I'm not sure what I myself
think of the third one. Perhaps the saving is not worth the
complexity, but it does annoy my optimization nerve to see all the
unnecessary duplicated work being done.
Rasmus Villemoes (3):
grep: move grep_source_init ou
In the NO_PTHREADS or !num_threads case, this doesn't change
anything. In the threaded case, note that grep_source_init duplicates
its third argument, so there is no need to keep [path]buf.buf alive
across the call of add_work().
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 6 ++--
gs->identifier, and changing grep_source_clear accordingly
to avoid a double free.
Signed-off-by: Rasmus Villemoes
---
grep.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/grep.c b/grep.c
index 3d7cd0e96..b1532b1b6 100644
--- a/grep.c
+++ b/grep.c
@@ -1972,7 +1972,8 @
(avoiding repeating the
"GREP_SOURCE_OID, pathbuf.buf, path, oid" argument list); a subsequent
cleanup patch will make that even more so.
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 19 ++-
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/builti
revealed that (1) there
isn't actually any pathspec handling and (2) any argc other than 1..3 is
treated as 0 - something which is probably also worth fixing.
With this patch, the command above does give something reasonable, and
t3500-cherry.sh also seems to pass.
Signed-off-b
comment to explain why one then does
the memset despite the first half of the comment.
Rasmus Villemoes (2):
grep: move grep_source_init outside critical section
grep: simplify grep_oid and grep_file
builtin/grep.c | 33 -
1 file changed, 20 insertions(+), 13
In the NO_PTHREADS or !num_threads case, this doesn't change
anything. In the threaded case, note that grep_source_init duplicates
its third argument, so there is no need to keep [path]buf.buf alive
across the call of add_work().
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 6 ++--
(avoiding repeating the
long "GREP_SOURCE_OID, pathbuf.buf, path, oid" argument list); a
subsequent cleanup patch will make that even more so.
Signed-off-by: Rasmus Villemoes
---
builtin/grep.c | 27 ++-
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git
Signed-off-by: Rasmus Villemoes
---
Documentation/config.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 671fcbaa0..d88fc9f63 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -3000,6 +3000,7
Signed-off-by: Rasmus Villemoes
---
contrib/completion/git-completion.bash | 1 +
1 file changed, 1 insertion(+)
diff --git a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index fdd984d34..10607cdf2 100644
--- a/contrib/completion/git-completion.bash
+++ b
e
value is interpreted as a whitespace-separated list of, possibly
negated, patterns. Later patterns override earlier ones.
If the feature is deemed worthwhile and my approach is acceptable,
I'll go ahead and try to write some documentation. For now, there is
just a small test script.
Rasm
fe-include directives,
so they will effectively just ignore them.
Obviously, we must ignore safe-include.whitelist directives when we
are processing a safe-included file.
Signed-off-by: Rasmus Villemoes
---
config.c | 91 +---
1 file changed, 88
This adds a script for testing various aspects of the safe-include feature.
Signed-off-by: Rasmus Villemoes
---
t/t1309-config-safe-include.sh | 96 ++
1 file changed, 96 insertions(+)
create mode 100755 t/t1309-config-safe-include.sh
diff --git a/t
Junio C Hamano wrote:
> (by the way, we do not do dashes in names for configuration by
> convention)
OK. Actually, I now think I'd prefer a subsection [include "safe"], but
I don't have any strong preferences regarding the names.
> That syntax _could_ be just a relative path (e.g. project.gitco
On Sun, Apr 05 2015, Jeff King wrote:
> which is back to the v2.0.0 number. Even with the extra strlen, it seems
> that what fgets does internally beats repeated getc calls. Which I guess
> is not too surprising, as each getc() will have to check for underflow
> in the buffer. Perhaps there is mo
On Tue, Apr 07 2015, Jeff King wrote:
> On Tue, Apr 07, 2015 at 03:48:33PM +0200, Rasmus Villemoes wrote:
>
>> Implementation-wise, I think strbuf_getwholeline could be implemented
>> mostly as a simple wrapper for getdelim. If I'm reading the current code
>> an
some unrelated
item had to be prompted for. So kill $prompting.
Signed-off-by: Rasmus Villemoes
---
git-send-email.perl | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 2162478..f608d9b 100755
--- a/git-send-email.perl
+++ b/git
ID of the earlier email
(which is cumbersome in some MUAs) and then copy-paste that.
If this idea is accepted, I'm certain I'll get to use the feature
immediately, since the patch is not quite ready for inclusion :-)
Signed-off-by: Rasmus Villemoes
---
git-send-e
broken anything in the process.
[*] Suggestions for improving that heuristic are welcome. One thing
that might be worthwhile is to give words ending in a colon higher
weight.
Rasmus Villemoes (2):
git-send-email: add optional 'choices' parameter to the ask sub
git-send-email: Cach
, where the
zeroth element is the choice and the first is used for the prompt.
Signed-off-by: Rasmus Villemoes
---
git-send-email.perl | 11 +++
1 file changed, 11 insertions(+)
diff --git a/git-send-email.perl b/git-send-email.perl
index 2162478..ac3b02d 100755
--- a/git-send-email.perl
ch invocation of git-send-email.
Signed-off-by: Rasmus Villemoes
---
git-send-email.perl | 133 ---
1 file changed, 127 insertions(+), 6 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index ac3b02d..5094267 100755
--- a/git-send-
70 matches
Mail list logo