* Re: [PATCH 0/12] reducing resource usage of for_each_alternate_ref
From: Brandon Williams @ 2017-01-24 1:33 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <20170124003729.j4ygjcgypdq7hceg@sigill.intra.peff.net>
On 01/23, Jeff King wrote:
>
> A brief overview of the patches:
>
> [01/12]: for_each_alternate_ref: handle failure from real_pathdup()
> [02/12]: for_each_alternate_ref: stop trimming trailing slashes
> [03/12]: for_each_alternate_ref: use strbuf for path allocation
>
> Bugfixes and cleanups (the first one is actually a recent-ish
> regression).
Which is most likely my fault, Sorry! :)
I think the old behavior was to die and not return NULL.
--
Brandon Williams
^ permalink raw reply
* [PATCH] [draft]blame: add --aggregate option
From: Edmundo Carmona Antoranz @ 2017-01-24 2:10 UTC (permalink / raw)
To: git; +Cc: Edmundo Carmona Antoranz
---
builtin/blame.c | 78 +++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 51 insertions(+), 27 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index 126b8c9e5..9e8403303 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1884,6 +1884,7 @@ static const char *format_time(unsigned long time, const char *tz_str,
#define OUTPUT_NO_AUTHOR 0200
#define OUTPUT_SHOW_EMAIL 0400
#define OUTPUT_LINE_PORCELAIN 01000
+#define OUTPUT_AGGREGATE 02000
static void emit_porcelain_details(struct origin *suspect, int repeat)
{
@@ -1931,43 +1932,36 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent,
putchar('\n');
}
-static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
+/**
+ * Print information about the revision.
+ * This information can be used in either aggregated output
+ * or prepending each line of the content of the file being blamed
+ */
+static void print_revision_info(char* revision_hex, int revision_length, struct blame_entry* ent,
+ struct commit* commit, struct commit_info ci, int opt, int show_raw_time)
{
- int cnt;
- const char *cp;
- struct origin *suspect = ent->suspect;
- struct commit_info ci;
- char hex[GIT_SHA1_HEXSZ + 1];
- int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP);
-
- get_commit_info(suspect->commit, &ci, 1);
- sha1_to_hex_r(hex, suspect->commit->object.oid.hash);
-
- cp = nth_line(sb, ent->lno);
- for (cnt = 0; cnt < ent->num_lines; cnt++) {
- char ch;
- int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? GIT_SHA1_HEXSZ : abbrev;
-
- if (suspect->commit->object.flags & UNINTERESTING) {
+ if (opt & OUTPUT_AGGREGATE)
+ printf("\t");
+ int length = revision_length;
+ if (commit->object.flags & UNINTERESTING) {
if (blank_boundary)
- memset(hex, ' ', length);
+ memset(revision_hex, ' ', length);
else if (!(opt & OUTPUT_ANNOTATE_COMPAT)) {
length--;
putchar('^');
}
}
- printf("%.*s", length, hex);
+ printf("%.*s", length, revision_hex);
if (opt & OUTPUT_ANNOTATE_COMPAT) {
const char *name;
if (opt & OUTPUT_SHOW_EMAIL)
name = ci.author_mail.buf;
else
name = ci.author.buf;
- printf("\t(%10s\t%10s\t%d)", name,
+ printf("\t(%10s\t%10s\t", name,
format_time(ci.author_time, ci.author_tz.buf,
- show_raw_time),
- ent->lno + 1 + cnt);
+ show_raw_time));
} else {
if (opt & OUTPUT_SHOW_SCORE)
printf(" %*d %02d",
@@ -1975,11 +1969,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
ent->suspect->refcnt);
if (opt & OUTPUT_SHOW_NAME)
printf(" %-*.*s", longest_file, longest_file,
- suspect->path);
- if (opt & OUTPUT_SHOW_NUMBER)
- printf(" %*d", max_orig_digits,
- ent->s_lno + 1 + cnt);
-
+ ent->suspect->path);
if (!(opt & OUTPUT_NO_AUTHOR)) {
const char *name;
int pad;
@@ -1994,9 +1984,42 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
ci.author_tz.buf,
show_raw_time));
}
+ }
+ if (opt & OUTPUT_AGGREGATE)
+ printf(")\n");
+}
+
+static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
+{
+ int cnt;
+ const char *cp;
+ struct origin *suspect = ent->suspect;
+ struct commit_info ci;
+ char hex[GIT_SHA1_HEXSZ + 1];
+ int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP);
+ int revision_length = (opt & OUTPUT_LONG_OBJECT_NAME) ? GIT_SHA1_HEXSZ : abbrev;
+
+ get_commit_info(suspect->commit, &ci, 1);
+ sha1_to_hex_r(hex, suspect->commit->object.oid.hash);
+
+ if (opt & OUTPUT_AGGREGATE)
+ print_revision_info(hex, revision_length, ent, suspect->commit, ci, opt, show_raw_time);
+
+ cp = nth_line(sb, ent->lno);
+ for (cnt = 0; cnt < ent->num_lines; cnt++) {
+ if (!(opt & OUTPUT_AGGREGATE))
+ print_revision_info(hex, revision_length, ent, suspect->commit, ci, opt, show_raw_time);
+ if (opt & OUTPUT_ANNOTATE_COMPAT) {
+ printf("%*d) ",
+ max_digits, ent->lno + 1 + cnt);
+ } else {
+ if (opt & OUTPUT_SHOW_NUMBER)
+ printf(" %*d ", max_orig_digits,
+ ent->s_lno + 1 + cnt);
printf(" %*d) ",
max_digits, ent->lno + 1 + cnt);
}
+ char ch;
do {
ch = *cp++;
putchar(ch);
@@ -2609,6 +2632,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
{ OPTION_CALLBACK, 'C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback },
{ OPTION_CALLBACK, 'M', NULL, &opt, N_("score"), N_("Find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback },
OPT_STRING_LIST('L', NULL, &range_list, N_("n,m"), N_("Process only line range n,m, counting from 1")),
+ OPT_BIT(0, "aggregate", &output_option, N_("Aggregate output"), OUTPUT_AGGREGATE),
OPT__ABBREV(&abbrev),
OPT_END()
};
--
2.11.0.rc1
^ permalink raw reply related
* Re: [PATCH 0/12] reducing resource usage of for_each_alternate_ref
From: Jeff King @ 2017-01-24 2:12 UTC (permalink / raw)
To: Brandon Williams; +Cc: git
In-Reply-To: <20170124013341.GA185930@google.com>
On Mon, Jan 23, 2017 at 05:33:41PM -0800, Brandon Williams wrote:
> On 01/23, Jeff King wrote:
> >
> > A brief overview of the patches:
> >
> > [01/12]: for_each_alternate_ref: handle failure from real_pathdup()
> > [02/12]: for_each_alternate_ref: stop trimming trailing slashes
> > [03/12]: for_each_alternate_ref: use strbuf for path allocation
> >
> > Bugfixes and cleanups (the first one is actually a recent-ish
> > regression).
>
> Which is most likely my fault, Sorry! :)
>
> I think the old behavior was to die and not return NULL.
Yes, it is. :)
But I think it's probably pretty hard to trigger in practice. And on the
plus side, I think the new behavior after my patch is much more sensible
than even the original.
-Peff
^ permalink raw reply
* Re: [PATCH] [draft]blame: add --aggregate option
From: Edmundo Carmona Antoranz @ 2017-01-24 2:18 UTC (permalink / raw)
To: Git List; +Cc: Edmundo Carmona Antoranz
In-Reply-To: <20170124021046.30735-1-eantoranz@gmail.com>
Developers of the world, rejoice! :-)
Junio, Pranit (and whoever is paying attention to the conversation
that was being held about --tips), here's a draft of what I meant when
I was talking about the option of "aggregating" blame output. I'm not
considering _all_ cases yet, just would like for people to give it a
quick test and tell me if they think it's worth "polishing" it for
inclusion into mainline git.
The output would look like this:
$ ./git blame -L 1,19 -t --aggregate builtin/blame.c
Blaming lines: 0% (19/2974), done.
cee7f245dc builtin-pickaxe.c (Junio C Hamano 1161298804 -0700)
1) /*
31653c1abc builtin-blame.c (Eugene Letuchy 1235170271 -0800)
2) * Blame
cee7f245dc builtin-pickaxe.c (Junio C Hamano 1161298804 -0700)
3) *
7e6ac6e439 builtin/blame.c (David Kastrup 1398470209 +0200)
4) * Copyright (c) 2006, 2014 by its authors
5) * See COPYING for licensing conditions
cee7f245dc builtin-pickaxe.c (Junio C Hamano 1161298804 -0700)
6) */
7)
8) #include "cache.h"
fb58c8d507 builtin/blame.c (Michael Haggerty 1434981785 +0200)
9) #include "refs.h"
cee7f245dc builtin-pickaxe.c (Junio C Hamano 1161298804 -0700)
10) #include "builtin.h"
11) #include "blob.h"
12) #include "commit.h"
13) #include "tag.h"
14) #include "tree-walk.h"
15) #include "diff.h"
16) #include "diffcore.h"
17) #include "revision.h"
717d1462ba builtin-blame.c (Linus Torvalds 1169976846 -0800)
18) #include "quote.h"
cee7f245dc builtin-pickaxe.c (Junio C Hamano 1161298804 -0700)
19) #include "xdiff-interface.h"
It can be seen that options like -t still work in aggregation.
In relation to the previous conversation about "tips", I think a
better name could be "hints" and it could be added on top of the
aggregation.
On Mon, Jan 23, 2017 at 8:10 PM, Edmundo Carmona Antoranz
<eantoranz@gmail.com> wrote:
> ---
> builtin/blame.c | 78 +++++++++++++++++++++++++++++++++++++--------------------
> 1 file changed, 51 insertions(+), 27 deletions(-)
>
> diff --git a/builtin/blame.c b/builtin/blame.c
> index 126b8c9e5..9e8403303 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -1884,6 +1884,7 @@ static const char *format_time(unsigned long time, const char *tz_str,
> #define OUTPUT_NO_AUTHOR 0200
> #define OUTPUT_SHOW_EMAIL 0400
> #define OUTPUT_LINE_PORCELAIN 01000
> +#define OUTPUT_AGGREGATE 02000
>
> static void emit_porcelain_details(struct origin *suspect, int repeat)
> {
> @@ -1931,43 +1932,36 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent,
> putchar('\n');
> }
>
> -static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
> +/**
> + * Print information about the revision.
> + * This information can be used in either aggregated output
> + * or prepending each line of the content of the file being blamed
> + */
> +static void print_revision_info(char* revision_hex, int revision_length, struct blame_entry* ent,
> + struct commit* commit, struct commit_info ci, int opt, int show_raw_time)
> {
> - int cnt;
> - const char *cp;
> - struct origin *suspect = ent->suspect;
> - struct commit_info ci;
> - char hex[GIT_SHA1_HEXSZ + 1];
> - int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP);
> -
> - get_commit_info(suspect->commit, &ci, 1);
> - sha1_to_hex_r(hex, suspect->commit->object.oid.hash);
> -
> - cp = nth_line(sb, ent->lno);
> - for (cnt = 0; cnt < ent->num_lines; cnt++) {
> - char ch;
> - int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? GIT_SHA1_HEXSZ : abbrev;
> -
> - if (suspect->commit->object.flags & UNINTERESTING) {
> + if (opt & OUTPUT_AGGREGATE)
> + printf("\t");
> + int length = revision_length;
> + if (commit->object.flags & UNINTERESTING) {
> if (blank_boundary)
> - memset(hex, ' ', length);
> + memset(revision_hex, ' ', length);
> else if (!(opt & OUTPUT_ANNOTATE_COMPAT)) {
> length--;
> putchar('^');
> }
> }
>
> - printf("%.*s", length, hex);
> + printf("%.*s", length, revision_hex);
> if (opt & OUTPUT_ANNOTATE_COMPAT) {
> const char *name;
> if (opt & OUTPUT_SHOW_EMAIL)
> name = ci.author_mail.buf;
> else
> name = ci.author.buf;
> - printf("\t(%10s\t%10s\t%d)", name,
> + printf("\t(%10s\t%10s\t", name,
> format_time(ci.author_time, ci.author_tz.buf,
> - show_raw_time),
> - ent->lno + 1 + cnt);
> + show_raw_time));
> } else {
> if (opt & OUTPUT_SHOW_SCORE)
> printf(" %*d %02d",
> @@ -1975,11 +1969,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
> ent->suspect->refcnt);
> if (opt & OUTPUT_SHOW_NAME)
> printf(" %-*.*s", longest_file, longest_file,
> - suspect->path);
> - if (opt & OUTPUT_SHOW_NUMBER)
> - printf(" %*d", max_orig_digits,
> - ent->s_lno + 1 + cnt);
> -
> + ent->suspect->path);
> if (!(opt & OUTPUT_NO_AUTHOR)) {
> const char *name;
> int pad;
> @@ -1994,9 +1984,42 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
> ci.author_tz.buf,
> show_raw_time));
> }
> + }
> + if (opt & OUTPUT_AGGREGATE)
> + printf(")\n");
> +}
> +
> +static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
> +{
> + int cnt;
> + const char *cp;
> + struct origin *suspect = ent->suspect;
> + struct commit_info ci;
> + char hex[GIT_SHA1_HEXSZ + 1];
> + int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP);
> + int revision_length = (opt & OUTPUT_LONG_OBJECT_NAME) ? GIT_SHA1_HEXSZ : abbrev;
> +
> + get_commit_info(suspect->commit, &ci, 1);
> + sha1_to_hex_r(hex, suspect->commit->object.oid.hash);
> +
> + if (opt & OUTPUT_AGGREGATE)
> + print_revision_info(hex, revision_length, ent, suspect->commit, ci, opt, show_raw_time);
> +
> + cp = nth_line(sb, ent->lno);
> + for (cnt = 0; cnt < ent->num_lines; cnt++) {
> + if (!(opt & OUTPUT_AGGREGATE))
> + print_revision_info(hex, revision_length, ent, suspect->commit, ci, opt, show_raw_time);
> + if (opt & OUTPUT_ANNOTATE_COMPAT) {
> + printf("%*d) ",
> + max_digits, ent->lno + 1 + cnt);
> + } else {
> + if (opt & OUTPUT_SHOW_NUMBER)
> + printf(" %*d ", max_orig_digits,
> + ent->s_lno + 1 + cnt);
> printf(" %*d) ",
> max_digits, ent->lno + 1 + cnt);
> }
> + char ch;
> do {
> ch = *cp++;
> putchar(ch);
> @@ -2609,6 +2632,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
> { OPTION_CALLBACK, 'C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback },
> { OPTION_CALLBACK, 'M', NULL, &opt, N_("score"), N_("Find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback },
> OPT_STRING_LIST('L', NULL, &range_list, N_("n,m"), N_("Process only line range n,m, counting from 1")),
> + OPT_BIT(0, "aggregate", &output_option, N_("Aggregate output"), OUTPUT_AGGREGATE),
> OPT__ABBREV(&abbrev),
> OPT_END()
> };
> --
> 2.11.0.rc1
>
^ permalink raw reply
* Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure
From: Junio C Hamano @ 2017-01-24 2:28 UTC (permalink / raw)
To: Brandon Williams; +Cc: git, sbeller, pclouds
In-Reply-To: <20170124011135.GB187696@google.com>
Brandon Williams <bmwill@google.com> writes:
> ... It seems like breaking the question and answer up
> doesn't buy you much in terms of reducing allocation churn and instead
> complicates the API with needing to keep track of two structures instead
> of a one.
In my mind, the value of having a constant check_attr is primarily
that it gives us a stable pointer to serve as a hashmap key,
i.e. the identifier for each call site, in a later iteration.
Of course, in order to populate the "question" array, we'd need the
interning of attribute names to attr objects, which need to be
protected by mutex, and you would probably not want to do that every
time the control hits the codepath.
But all of the above comes from my intuition, and I'll very much
welcome to be proven wrong with an alternative design, or better
yet, a working code based on an alternative design ;-).
^ permalink raw reply
* Re: [PATCH v3 4/5] show-ref: Detect dangling refs under --verify as well
From: Junio C Hamano @ 2017-01-24 2:48 UTC (permalink / raw)
To: Vladimir Panteleev; +Cc: git
In-Reply-To: <20170123180059.4288-5-git@thecybershadow.net>
Vladimir Panteleev <git@thecybershadow.net> writes:
> Move detection of dangling refs into show_one, so that they are
> detected when --verify is present as well as when it is absent.
>
> Signed-off-by: Vladimir Panteleev <git@thecybershadow.net>
> ---
> builtin/show-ref.c | 16 ++++++++--------
> t/t1403-show-ref.sh | 22 ++++++++++++++++++++++
> 2 files changed, 30 insertions(+), 8 deletions(-)
>
> diff --git a/builtin/show-ref.c b/builtin/show-ref.c
> index ab8e0dc41..107d05fe0 100644
> --- a/builtin/show-ref.c
> +++ b/builtin/show-ref.c
> @@ -22,6 +22,14 @@ static void show_one(const char *refname, const struct object_id *oid)
> const char *hex;
> struct object_id peeled;
>
> + /* This changes the semantics slightly that even under quiet we
> + * detect and return error if the repository is corrupt and
> + * ref points at a nonexistent object.
> + */
This is my fault from more than 10 years ago, but I think the
comment shouldn't have been here (or at its original location). It
talks about the behaviour change relative to the previous version
when the comment was added, i.e. cf0adba788 ("Store peeled refs in
packed-refs file.", 2006-11-19).
I'll remove it after the series settles.
^ permalink raw reply
* [PATCH] gitk: use right colour for remote refs in the "Tags and heads" dialog
From: Paul Wise @ 2017-01-24 6:22 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras, Paul Wise
Makes it easier to see which refs are local and which refs are remote.
Adds consistency with the remote background colour in the graph display.
Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
---
gitk-git/gitk | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index a14d7a16b..14aebc23e 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -3404,6 +3404,8 @@ set rectmask {
}
image create bitmap reficon-H -background black -foreground "#00ff00" \
-data $rectdata -maskdata $rectmask
+image create bitmap reficon-R -background black -foreground "#ffddaa" \
+ -data $rectdata -maskdata $rectmask
image create bitmap reficon-o -background black -foreground "#ddddff" \
-data $rectdata -maskdata $rectmask
@@ -10022,6 +10024,7 @@ proc sel_reflist {w x y} {
set n [lindex $ref 0]
switch -- [lindex $ref 1] {
"H" {selbyid $headids($n)}
+ "R" {selbyid $headids($n)}
"T" {selbyid $tagids($n)}
"o" {selbyid $otherrefids($n)}
}
@@ -10051,7 +10054,11 @@ proc refill_reflist {} {
foreach n [array names headids] {
if {[string match $reflistfilter $n]} {
if {[commitinview $headids($n) $curview]} {
- lappend refs [list $n H]
+ if {[string match "remotes/*" $n]} {
+ lappend refs [list $n R]
+ } else {
+ lappend refs [list $n H]
+ }
} else {
interestedin $headids($n) {run refill_reflist}
}
--
2.11.0
^ permalink raw reply related
* Re: [PATCH] rebase: pass --signoff option to git am
From: Giuseppe Bilotta @ 2017-01-24 7:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git List
In-Reply-To: <xmqqsho9pdbc.fsf@gitster.mtv.corp.google.com>
On Tue, Jan 24, 2017 at 12:27 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>>
>> I'm not sure I follow. If the user doesn't want to signoff during a
>> rebase, they can simply not pass --signoff. If they do, they can not
>> pass it. Am I missing something?
>
> alias.
>
> Which also means that there needs to be --no-signoff option that can
> be given to countermand an earlier --signoff, if a user did
>
> [alias] rb = rebase --signoff
>
> and wants to disable it one time only with
>
> $ git rb --no-signoff
Oh, right, good point. This should be easy, I'll give this a go.
>>> In any case, will queue as-is so that we won't lose the patch while
>>> waiting for people to raise their opinions.
>>
>> Thanks.
>
> Thanks. The final version would also need tests, so it may be a
> good time to start thinking about what aspect of this feature wants
> to be protected against future breakages.
I have troubles thinking how it could go wrong. The most obvious
thing I can think of is it could not be remembered after an
interruption+continue. I'll think about this some more.
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply
* Re: [PATCH 7/7] completion: recognize more long-options
From: Johannes Sixt @ 2017-01-24 7:15 UTC (permalink / raw)
To: Cornelius Weig
Cc: bitte.keine.werbung.einwerfen, git, thomas.braun, szeder, john
In-Reply-To: <20170122225724.19360-8-cornelius.weig@tngtech.com>
If at all possible, please use your real email address as the From
address. It is pointless to hide behind a fake address because as Git
contributor you will have to reveal your identity anyway.
Please study item (5) "Sign your work" in
Documentation/SubmittingPatches and sign off your work.
I'm by no means a bash completion expert, but I have a comment on this
patch.
Am 22.01.2017 um 23:57 schrieb bitte.keine.werbung.einwerfen@googlemail.com:
> Recognize several new long-options for bash completion in the following
> commands:
AFAIR, it was a deliberate decision that potentially destructive command
line options are not included in command completions. In the list given,
I find these:
> - apply: --unsafe-paths
> - reset: --merge --mixed --hard --soft --patch --keep
> - rm: --force
Additionally, these options are only for internal purposes, but I may be
wrong:
> - archive: --remote= --exec=
-- Hannes
^ permalink raw reply
* Re: [PATCH 7/7] completion: recognize more long-options
From: Cornelius Weig @ 2017-01-24 8:14 UTC (permalink / raw)
To: Johannes Sixt; +Cc: bitte.keine.werbung.einwerfen, git, thomas.braun, john
In-Reply-To: <74ecd09c-55da-3858-5187-52c286a6bf62@kdbg.org>
On 01/24/2017 08:15 AM, Johannes Sixt wrote:
> If at all possible, please use your real email address as the From
> address. It is pointless to hide behind a fake address because as Git
> contributor you will have to reveal your identity anyway.
These are both real addresses, but for send-mail I would not want to use
my work account. I hope this is not a problem.
> Please study item (5) "Sign your work" in
> Documentation/SubmittingPatches and sign off your work.
I followed the recommendations to submitting work, and in the first
round signing is discouraged.
> AFAIR, it was a deliberate decision that potentially destructive command
> line options are not included in command completions. In the list given,
> I find these:
>
>> - reset: --merge --mixed --hard --soft --patch --keep
My bad, I only added --keep, which should be fine. As to these options
>> - apply: --unsafe-paths
>> - rm: --force
let's wait for further comments, but I won't cling to it.
> Additionally, these options are only for internal purposes, but I may be
> wrong:
>
>> - archive: --remote= --exec=
These may in fact be too exotic and just clutter the command line. Best
they are removed.
-- Cornelius
^ permalink raw reply
* Re: [RFC] Case insensitive Git attributes
From: Lars Schneider @ 2017-01-24 9:49 UTC (permalink / raw)
To: Junio C Hamano, git
Cc: Dakota Hawkins, Duy Nguyen, Johannes Schindelin, Stefan Beller,
drafnel, bmwill
In-Reply-To: <xmqqwpdlr2ht.fsf@gitster.mtv.corp.google.com>
> On 23 Jan 2017, at 20:38, Junio C Hamano <gitster@pobox.com> wrote:
>
> Junio C Hamano <gitster@pobox.com> writes:
>
>> So you are worried about the case where somebody on a case
>> insensitive but case preserving system would do
>>
>> $ edit file.txt
>> $ edit .gitattributes
>> $ git add file.txt .gitattributes
>>
>> and adds "*.TXT someattr=true" to the attributes file, which
>> would set someattr to true on his system for file.txt, but when the
>> result is checked out on a case sensitive system, it would behave
>> differently because "*.TXT" does not match "file.txt"?
Correct!
>> How do other systems address it? Your Java, Ruby, etc. sources may
>> refer to another file with "import" and the derivation of the file
>> names from class names or package names would have the same issue,
>> isn't it? Do they have an option that lets you say
>>
>> Even though the import statements may say "import a.b.C", we
>> know that the source tarball was prepared on a case insensitive
>> system, and I want you to look for a/b/C.java and a/b/c.java and
>> use what was found.
>>
>> or something like that? Same for anything that records other
>> filenames in the content to refer to them, like "Makefile".
>>
>> My knee jerk reaction to that is that .gitattributes and .gitignore
>> should not be instructed to go case insensitive on case sensitive
>> systems. If the system is case insensitive but case preserving,
>> it probably would make sense not to do case insensitive matching,
>> which would prevent the issue from happening in the first place.
>
> Sorry, but there is a slight leap in the above that makes it hard to
> track my thought, so let me clarify a bit.
>
> In the above, I am guessing the answer to the "How do other systems
> address it?" question to be "nothing". And that leads to the
> conclusion that it is better to do "nothing on case sensitive
> systems, and probably become evem more strict on case insensitive
> but case preserving systems", because that will give us a chance to
> expose the problem earlier, hopefully even on the originating
> system.
I agree: Git attributes should behave the same on all platforms independent
of the file system type. I dug a bit deeper and realized that this is actually
already the case. However, the default (?) core.ignorecase=1 config on Win/Mac
generates the behavior explained above. I wonder if 6eba621 ("attr.c: respect
core.ignorecase when matching attribute patterns", 2011-10-11) was a good idea.
AFAIK disabling core.ignorecase entirely on Win/Mac is no solution as this would
generate other trouble.
Git users can already create case insensitive gitattributes pattern. E.g.:
*.[tT][xX][tT]
However, based on my dayjob experience no Win/Mac developer does that as it
makes the gitattributes file unreadable. Consequently, Linux developers are
screwed. Therefore, I wonder if it would make sense to introduce a shortcut
for the case insensitive glob pattern. E.g.:
*.txt ignorecase
If Git detects the ignorecase attribute then it could generate *.[tT][xX][tT]
automatically.
^ permalink raw reply
* Re: [RFC 1/2] grep: only add delimiter if there isn't one already
From: Stefan Hajnoczi @ 2017-01-23 13:15 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <xmqqlgu5y4u8.fsf@gitster.mtv.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 2866 bytes --]
On Fri, Jan 20, 2017 at 10:16:31AM -0800, Junio C Hamano wrote:
> Stefan Hajnoczi <stefanha@redhat.com> writes:
>
> > v2.9.3::Makefile may convey that the user originally provided v2.9.3:
> > but is that actually useful information?
>
> You are either asking a wrong question, or asking a wrong person
> (i.e. Git) the question. The real question is why the user added a
> colon at the end, when "v2.9.3" alone would have sufficed. What did
> the user want to get out of giving an extra colon like "v2.9.3:"?
>
> One answer I can think of is that it is a degenerate case of [2/2],
> i.e. if "v2.9.3:t" were an appropriate way to look in the subtree
> "t" of "v2.9.3", "v2.9.3:" would be the appropriate way to look in
> the whole tree of "v2.9.3".
>
> I understand, from your response to my comment in the thread for
> [2/2], that the reason why "v2.9.3:t" was used in the example was
> because you felt uncomfortable with using pathspec.
>
> That's superstition.
>
> My only piece of advice to folks who feel that way is to learn Git
> more and get comfortable. You can do neat things like
>
> $ git grep -e pattern rev -- t ':!t/helper/'
>
> that you cannot do with "rev:t", for example ;-)
Neat, thanks for showing the path exclusion syntax. I wasn't aware of
it.
> All examples we saw so far are the ones that the user used the colon
> syntax when it is more natural to express the command without it. I
> am hesitant to see the behaviour of the command changed to appease
> such suboptimal use cases if it requires us to discard a bit of
> information, when we haven't established it is OK to lose.
>
> There may be a case
>
> (1) where the colon syntax is the most natural thing to use, AND
> script reading the output that used that syntax is forced to do
> unnecessary work because "git grep" parrots the colon
> literally, instread of being more intelligent about it
> (i.e. omitting or substituting with slash when the input is a
> tree object, not a tree-ish, as discussed in the thread).
>
> (2) where the colon syntax is the most natural thing, AND script
> reading the output WANTS to see the distinction in the input
> (remember, "git grep" can take more than one input tree).
>
> We haven't seen either of the above two in the discussion, so the
> discussion so far is not sufficient to support the change being
> proposed in this RFC, which requires that it is safe to assume that
> (1) is the only case where the input is a raw tree (or the input
> contains a colon) and (2) will never happen.
>
> So I am still mildly negative on the whole thing.
Avoiding the colon syntax avoids the whole issue for my use case.
I still think git-grep(1)'s output would be more useful if it used valid
git rev:path syntax in all cases.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply
* Re: [RFC 2/2] grep: use '/' delimiter for paths
From: Stefan Hajnoczi @ 2017-01-23 13:29 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, git
In-Reply-To: <xmqq60l9wdb9.fsf@gitster.mtv.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]
On Fri, Jan 20, 2017 at 02:56:26PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > It's not ignored; just as with git-log, it's a pathspec to limit the
> > diff. E.g.:
> >
> > $ git show --name-status v2.9.3
> > ...
> > M Documentation/RelNotes/2.9.3.txt
> > M Documentation/git.txt
> > M GIT-VERSION-GEN
> >
> > $ git show --name-status v2.9.3 -- Documentation
> > M Documentation/RelNotes/2.9.3.txt
> > M Documentation/git.txt
> >
> > That's typically less useful than it is with log (where limiting the
> > diff also kicks in history simplification and omits some commits
> > entirely). But it does do something.
>
> I think Stefan is missing the fact that the argument to "git show
> <tree-ish>:<path>" actually is naming a blob that sits at the <path>
> in the <tree-ish>. In other words, "show" is acting as a glorified
> "git -p cat-file blob", in that use.
>
> The use of "git show" you are demonstrating is still about showing
> the commit object, whose behaviour is defined to show the log
> message and the diff relative to its sole parent, limited to the
> paths that match the pathspec.
>
> It is perfectly fine and desirable that "git show <commit>:<path>"
> and "git show <commit> -- <path>" behaves differently. These are
> two completely different features.
Thanks for explaining guys. It all makes logical sense. I just hope I
remember the distinctions in that table for everyday git use.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2017, #04; Mon, 23)
From: Lars Schneider @ 2017-01-24 10:04 UTC (permalink / raw)
To: Junio C Hamano, Jeff King; +Cc: git
In-Reply-To: <xmqqo9yxpaxk.fsf@gitster.mtv.corp.google.com>
> On 24 Jan 2017, at 01:18, Junio C Hamano <gitster@pobox.com> wrote:
>
> * jk/fsck-connectivity-check-fix (2017-01-17) 6 commits
> (merged to 'next' on 2017-01-23 at e8e9b76b84)
> + fsck: check HAS_OBJ more consistently
> + fsck: do not fallback "git fsck <bogus>" to "git fsck"
> + fsck: tighten error-checks of "git fsck <head>"
> + fsck: prepare dummy objects for --connectivity-check
> + fsck: report trees as dangling
> + t1450: clean up sub-objects in duplicate-entry test
>
> "git fsck --connectivity-check" was not working at all.
>
> Will merge to 'master'.
"fsck: prepare dummy objects for --connectivity-check" seems to
make t1450-fsck.sh fail on macOS with TravisCI:
Initialized empty Git repository in /Users/travis/build/git/git/t/trash directory.t1450-fsck/connectivity-only/.git/
[master (root-commit) 86520b7] empty
Author: A U Thor <author@example.com>
2 files changed, 1 insertion(+)
create mode 100644 empty
create mode 100644 empty.t
override r--r--r-- travis/staff for .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391? (y/n [n]) not overwritten
dangling blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
test_must_fail: command succeeded: git fsck --strict
not ok 58 - fsck --connectivity-only
More test output: https://travis-ci.org/git/git/jobs/194663620
For some reason I am not able to replicate that behavior on my local
macOS machine. I found the commit using bisect on TravisCI:
https://api.travis-ci.org/jobs/194746454/log.txt?deansi=true
Any idea what might be wrong?
- Lars
^ permalink raw reply
* Re: [PATCH 0/3] stash: support filename argument
From: Johannes Schindelin @ 2017-01-24 10:56 UTC (permalink / raw)
To: Thomas Gummerer
Cc: git, Stephan Beyer, Junio C Hamano, Marc Strapetz, Jeff King
In-Reply-To: <20170121200804.19009-1-t.gummerer@gmail.com>
Hi Thomas,
On Sat, 21 Jan 2017, Thomas Gummerer wrote:
> This is the first try to implement the RFC I posted a week ago [1]. It
> introduces a new push verb for git stash. I couldn't come up with
> any better name that wasn't already taken. If anyone has ideas I'd be
> very happy to hear them.
I would have preferred a series of patches that essentially adds a new and
improved `save` syntax:
git stash [save] [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [-m <message>]]
[-- <path>...]
and keeps the legacy syntax, but deprecates it:
git stash [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [<message>]]
The problem with that is, of course, that 3c2eb80fe3 (stash: simplify
defaulting to "save" and reject unknown options, 2009-08-18) in its
infinite wisdom *already* introduced the `--` separator to drop out of
option parsing.
On a positive note, it is a thorn in Git's CUI that `git stash` implies
the `save` command, and that `save` is not at all the opposite of `apply`
or `pop`. Your introduction of the `push` command will fix that flaw, and
we can *still* deprecate the `save` command.
Ciao,
Johannes
^ permalink raw reply
* Re: GSoC 2017: application open, deadline = February 9, 2017
From: Johannes Schindelin @ 2017-01-24 11:28 UTC (permalink / raw)
To: Matthieu Moy
Cc: git, Pranit Bauva, Lars Schneider, Christian Couder, Jeff King,
Carlos Martín Nieto, Thomas Gummerer
In-Reply-To: <vpq1svtstud.fsf@anie.imag.fr>
Hi Matthieu,
On Mon, 23 Jan 2017, Matthieu Moy wrote:
> * Who's willing to mentor?
As in the years before, I am willing to mentor.
Ciao,
Johannes
^ permalink raw reply
* Re: [PATCH v1 0/2] urlmatch: allow regexp-based matches
From: Patrick Steinhardt @ 2017-01-24 11:29 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Patrick Steinhardt
In-Reply-To: <xmqqsho9r1rs.fsf@gitster.mtv.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 2423 bytes --]
On Mon, Jan 23, 2017 at 11:53:43AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <patrick.steinhardt@elego.de> writes:
>
> > This patch is mostly a request for comments. The use case is to
> > be able to configure an HTTP proxy for all subdomains of a
> > certain domain where there are hundreds of subdomains. The most
> > flexible way I could imagine was by using regular expressions for
> > the matching, which is how I implemented it for now. So users can
> > now create a configuration key like
> > `http.?http://.*\\.example\\.com.*` to apply settings for all
> > subdomains of `example.com`.
>
> While reading 2/2, I got an impression that this is "too" flexible
> and possibly operates at a wrong level. I would have expected that
> the wildcarding to be limited to the host part only and hook into
> match_urls(), allowing the users of the new feature to still take
> advantage of the existing support of "http://me@example.com" that
> limits the match to the case that the connection is authenticated
> for a user, for example, by newly allowing "http://me@*.example.com"
> or something like that.
>
> Because you cannot have a literal '*' in your hostname, I would
> imagine that supporting a match pattern "http://me@*.example.com"
> would be already backward compatible without requiring a leading
> question-mark.
>
> I also personally would prefer these textual matching to be done
> with glob not with regexp, by the way, as the above description of
> mine shows.
>
> Thanks.
Thanks for your feedback. Using globs in the hostname only was my
first intent, as well. I later on took regular expressions
instead so as to allow further flexibility for the user. The
reasoning was that there might be other use cases which cannot
actually be solved with using globs only, even if I myself wasn't
aware of different ones. So this might be indeed over-engineered
when using regular expressions.
There are several questions though regarding semantics with
globs, where I'd like to have additional opinions on.
- should a glob only be allowed for actual subdomains, allowing
"http://*.example.com" but not "http://*example.com"?
- should a glob also match multiple nestings of subdomains? E.g.
"http://*.example.com" would match "http://foo.example.com" but
not "http://foo.bar.example.com"?
I'll send a version 2 soon-ish.
Regards
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH] blame: add option to print tips (--tips)
From: Pranit Bauva @ 2017-01-24 11:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Edmundo Carmona Antoranz, Git List
In-Reply-To: <xmqqr33tsjwx.fsf@gitster.mtv.corp.google.com>
Hey Junio,
On Tue, Jan 24, 2017 at 12:06 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Pranit Bauva <pranit.bauva@gmail.com> writes:
>
>> We can probably make it useful with some extended efforts. I use
>> git-blame and I sometimes find that I don't need things like the name
>> of the author, time, timezone and not even the file name and I have to
>> use a bigger terminal. If we could somehow remove those fields then
>> maybe this would be a useful feature.
>
> I admit that I didn't recall the option until somebody else told me,
> but I think "blame -s" or something like that for that purpose ;-)
Ah! Thanks a lot!
Regards,
Pranit Bauva
^ permalink raw reply
* Re: [PATCH v2 0/5] string-list: make string_list_sort() reentrant
From: Johannes Schindelin @ 2017-01-24 11:44 UTC (permalink / raw)
To: Jeff King; +Cc: René Scharfe, Git List, Junio C Hamano
In-Reply-To: <20170123235445.qsejumltutd2vrhd@sigill.intra.peff.net>
[-- Attachment #1: Type: text/plain, Size: 522 bytes --]
Hi Peff,
On Mon, 23 Jan 2017, Jeff King wrote:
> Is there any interest in people adding the ISO qsort_s() to their libc
> implementations? It seems like it's been a fair number of years by now.
Visual C supports it *at least* since Visual Studio 2005:
https://msdn.microsoft.com/en-us/library/4xc60xas(v=vs.80).aspx
With René's patch, we have an adapter for GNU libc, and if anybody comes
up with the (equally trivial) adapter for BSD libc's qsort_r(), we have a
lot of bases covered.
Ciao,
Johannes
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2017, #04; Mon, 23)
From: Jeff King @ 2017-01-24 13:27 UTC (permalink / raw)
To: Lars Schneider; +Cc: Junio C Hamano, git
In-Reply-To: <0D956B23-E655-4C28-A205-14CCC0A7DEA2@gmail.com>
On Tue, Jan 24, 2017 at 11:04:21AM +0100, Lars Schneider wrote:
> "fsck: prepare dummy objects for --connectivity-check" seems to
> make t1450-fsck.sh fail on macOS with TravisCI:
>
> Initialized empty Git repository in /Users/travis/build/git/git/t/trash directory.t1450-fsck/connectivity-only/.git/
> [master (root-commit) 86520b7] empty
> Author: A U Thor <author@example.com>
> 2 files changed, 1 insertion(+)
> create mode 100644 empty
> create mode 100644 empty.t
> override r--r--r-- travis/staff for .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391? (y/n [n]) not overwritten
> dangling blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
Looks like "mv" prompts and then fails to move the file (so we get the
dangling blob for the source blob, and fsck doesn't report failure because
we didn't actually corrupt the destination blob).
If I'm understanding the behavior correctly, this violates POSIX, which
says:
1. If the destination path exists, the −f option is not specified, and
either of the following conditions is true:
a. The permissions of the destination path do not permit writing
and the standard input is a terminal.
b. The −i option is specified.
the mv utility shall write a prompt to standard error and read a
line from standard input. If the response is not affirmative,
mv shall do nothing more with the current source_file and go on
to any remaining source_files.
Our stdin isn't a terminal, and we do not specify "-i", so I think it
shouldn't prompt. It also exits with code 0 after failing to move,
which is another surprise.
Here's a patch (tested by me that it works on Linux, but I don't know
for sure that it fixes the Travis problem).
-- >8 --
Subject: [PATCH] t1450: use "mv -f" within loose object directory
The loose objects are created with mode 0444. That doesn't
prevent them being overwritten by rename(), but some
versions of "mv" will be extra careful and prompt the user,
even without "-i".
Reportedly macOS does this, at least in the Travis builds.
The prompt reads from /dev/null, defaulting to "no", and the
object isn't moved. Then to make matters even more
interesting, it still returns "0" and the rest of the test
proceeds, but with a broken setup.
We can work around it by using "mv -f" to override the
prompt. This should work as it's already used in t5504 for
the same purpose.
Signed-off-by: Jeff King <peff@peff.net>
---
t/t1450-fsck.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index efaf41b68..33a51c9a6 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -536,7 +536,7 @@ test_expect_success 'fsck --connectivity-only' '
# free to examine the type if it chooses.
empty=.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&
blob=$(echo unrelated | git hash-object -w --stdin) &&
- mv $(sha1_file $blob) $empty &&
+ mv -f $(sha1_file $blob) $empty &&
test_must_fail git fsck --strict &&
git fsck --strict --connectivity-only &&
--
2.11.0.840.gd37c5973a
^ permalink raw reply related
* Re: GSoC 2017: application open, deadline = February 9, 2017
From: Christian Couder @ 2017-01-24 13:32 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Matthieu Moy, git, Pranit Bauva, Lars Schneider, Jeff King,
Carlos Martín Nieto, Thomas Gummerer
In-Reply-To: <alpine.DEB.2.20.1701241228020.3469@virtualbox>
On Tue, Jan 24, 2017 at 12:28 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi Matthieu,
>
> On Mon, 23 Jan 2017, Matthieu Moy wrote:
>
>> * Who's willing to mentor?
>
> As in the years before, I am willing to mentor.
I am also willing to mentor.
Thanks!
^ permalink raw reply
* Re: [PATCH v2 0/5] string-list: make string_list_sort() reentrant
From: Jeff King @ 2017-01-24 13:44 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: René Scharfe, Git List, Junio C Hamano
In-Reply-To: <alpine.DEB.2.20.1701241233390.3469@virtualbox>
On Tue, Jan 24, 2017 at 12:44:10PM +0100, Johannes Schindelin wrote:
> Hi Peff,
>
> On Mon, 23 Jan 2017, Jeff King wrote:
>
> > Is there any interest in people adding the ISO qsort_s() to their libc
> > implementations? It seems like it's been a fair number of years by now.
>
> Visual C supports it *at least* since Visual Studio 2005:
>
> https://msdn.microsoft.com/en-us/library/4xc60xas(v=vs.80).aspx
>
> With René's patch, we have an adapter for GNU libc, and if anybody comes
> up with the (equally trivial) adapter for BSD libc's qsort_r(), we have a
> lot of bases covered.
Sadly, no. Microsoft's qsort_s() is not compatible with the ISO C one.
And BSD's qsort_r() has a similar problem acting as a wrapper, because
the order of arguments in the callback functions is different (so you'd
have to actually wrap the callback, too, and rearrange the arguments for
each call, or do some macro trickery).
Gory details are in:
https://stackoverflow.com/questions/39560773/different-declarations-of-qsort-r-on-mac-and-linux/39561369
and the original thread:
http://public-inbox.org/git/3083fbf7-d67e-77e4-e05f-94a7e7e15eba@web.de/
-Peff
^ permalink raw reply
* Re: [PATCH] difftool.c: mark a file-local symbol with static
From: Jeff King @ 2017-01-24 14:23 UTC (permalink / raw)
To: David Aguilar
Cc: Junio C Hamano, Ramsay Jones, Johannes Schindelin,
GIT Mailing-list
In-Reply-To: <20170122052608.tpr5pihfgafhoynj@gmail.com>
mn Sat, Jan 21, 2017 at 09:26:08PM -0800, David Aguilar wrote:
> > > An obvious second
> > > best option would be to drop -Wall from the "everybody" CFLAGS and
> > > move it to DEVELOPER_CFLAGS instead.
> >
> > Yeah, though that doesn't help the example above.
> >
> > As ugly as warning("%s", "") is, I think it may be the thing that annoys
> > the smallest number of people.
> >
> > -Peff
>
> How about using warning(" ") instead?
>
> For difftool.c specifically, the following is a fine solution,
> and doesn't require that we change our warning flags just for
> this one file.
I dunno. As ugly as the "%s" thing is in the source, at least it doesn't
change the output. Not that an extra space is the end of the world, but
it seems like it's letting the problem escape from the source code.
Do people still care about resolving this? -Wno-format-zero-length is in
the DEVELOPER options. It wasn't clear to me if that was sufficient, or
if we're going to get a bunch of reports from people that need to be
directed to the right compiler options.
The problematic code just hit 'next', so I suppose we'll see soon (OTOH,
the real test is when it get shipped as part of a release).
-Peff
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2017, #04; Mon, 23)
From: Lars Schneider @ 2017-01-24 14:43 UTC (permalink / raw)
To: Jeff King; +Cc: Junio C Hamano, git
In-Reply-To: <20170124132749.l3ezupyitvxe4t2l@sigill.intra.peff.net>
> On 24 Jan 2017, at 14:27, Jeff King <peff@peff.net> wrote:
>
> On Tue, Jan 24, 2017 at 11:04:21AM +0100, Lars Schneider wrote:
>
>> "fsck: prepare dummy objects for --connectivity-check" seems to
>> make t1450-fsck.sh fail on macOS with TravisCI:
>>
>> Initialized empty Git repository in /Users/travis/build/git/git/t/trash directory.t1450-fsck/connectivity-only/.git/
>> [master (root-commit) 86520b7] empty
>> Author: A U Thor <author@example.com>
>> 2 files changed, 1 insertion(+)
>> create mode 100644 empty
>> create mode 100644 empty.t
>> override r--r--r-- travis/staff for .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391? (y/n [n]) not overwritten
>> dangling blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
>
> Looks like "mv" prompts and then fails to move the file (so we get the
> dangling blob for the source blob, and fsck doesn't report failure because
> we didn't actually corrupt the destination blob).
>
> If I'm understanding the behavior correctly, this violates POSIX, which
> says:
>
> 1. If the destination path exists, the −f option is not specified, and
> either of the following conditions is true:
>
> a. The permissions of the destination path do not permit writing
> and the standard input is a terminal.
>
> b. The −i option is specified.
>
> the mv utility shall write a prompt to standard error and read a
> line from standard input. If the response is not affirmative,
> mv shall do nothing more with the current source_file and go on
> to any remaining source_files.
>
> Our stdin isn't a terminal, and we do not specify "-i", so I think it
> shouldn't prompt. It also exits with code 0 after failing to move,
> which is another surprise.
>
> Here's a patch (tested by me that it works on Linux, but I don't know
> for sure that it fixes the Travis problem).
>
> -- >8 --
> Subject: [PATCH] t1450: use "mv -f" within loose object directory
>
> The loose objects are created with mode 0444. That doesn't
> prevent them being overwritten by rename(), but some
> versions of "mv" will be extra careful and prompt the user,
> even without "-i".
>
> Reportedly macOS does this, at least in the Travis builds.
> The prompt reads from /dev/null, defaulting to "no", and the
> object isn't moved. Then to make matters even more
> interesting, it still returns "0" and the rest of the test
> proceeds, but with a broken setup.
>
> We can work around it by using "mv -f" to override the
> prompt. This should work as it's already used in t5504 for
> the same purpose.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> t/t1450-fsck.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
> index efaf41b68..33a51c9a6 100755
> --- a/t/t1450-fsck.sh
> +++ b/t/t1450-fsck.sh
> @@ -536,7 +536,7 @@ test_expect_success 'fsck --connectivity-only' '
> # free to examine the type if it chooses.
> empty=.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&
> blob=$(echo unrelated | git hash-object -w --stdin) &&
> - mv $(sha1_file $blob) $empty &&
> + mv -f $(sha1_file $blob) $empty &&
>
> test_must_fail git fsck --strict &&
> git fsck --strict --connectivity-only &&
> --
> 2.11.0.840.gd37c5973a
Ack. This patch fixes the issue:
https://travis-ci.org/larsxschneider/git/builds/194819605
Thanks,
Lars
^ permalink raw reply
* [PATCH v2 0/4] urlmatch: allow regexp-based matches
From: Patrick Steinhardt @ 2017-01-24 17:00 UTC (permalink / raw)
To: git; +Cc: Patrick Steinhardt, Junio C Hamano, Patrick Steinhardt
In-Reply-To: <20170123130635.29577-1-patrick.steinhardt@elego.de>
Hi,
This is version two of my patch series.
The use case is to be able to configure an HTTP proxy for all
subdomains of a domain where there are hundreds of subdomains.
Previously, I have been using complete regular expressions with
an escape-mechanism to match the configuration key's URLs.
According to Junio's comments, I changed this mechanism to a much
simpler one, where the user is only allowed to use globbing for
the host part of the URL. That is a user can now specify a key
`http.https://*.example.com` to match all sub-domains of
`example.com`. For now I've decided to implement it such that a
single `*` matches a single subdomain only, so for example
`https://foo.bar.example.com` would not match in this case. This
is similar to how shell-globbing works usually, so it should not
be of much surprise. It's also highlighted in the documentation.
I did not include an interdiff as too much has changed between
the two versions.
Regards
Patrick
Patrick Steinhardt (4):
mailmap: add Patrick Steinhardt's work address
urlmatch: enable normalization of URLs with globs
urlmatch: split host and port fields in `struct url_info`
urlmatch: allow globbing for the URL host part
.mailmap | 1 +
Documentation/config.txt | 5 +++-
t/t1300-repo-config.sh | 36 +++++++++++++++++++++++++
urlmatch.c | 68 +++++++++++++++++++++++++++++++++++++++++-------
urlmatch.h | 9 ++++---
5 files changed, 104 insertions(+), 15 deletions(-)
--
2.11.0
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox