From: Junio C Hamano <gitster@pobox•com>
To: Philippe Blain <levraiphilippeblain@gmail•com>
Cc: "Ben Boeckel" <mathstuf@gmail•com>,
git@vger•kernel.org, "Martin Ågren" <martin.agren@gmail•com>,
"Jeff King" <peff@peff•net>,
"Jeff Hostetler" <jeffhost@microsoft•com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail•com>,
"Taylor Blau" <me@ttaylorr•com>
Subject: Re: [PATCH 1/1] config: support a default remote tracking setup upon branch creation
Date: Fri, 30 Jul 2021 10:32:07 -0700 [thread overview]
Message-ID: <xmqqim0r1ze0.fsf@gitster.g> (raw)
In-Reply-To: <bcbe13a8-7f22-7564-77cd-674c7b2acbf6@gmail.com> (Philippe Blain's message of "Fri, 30 Jul 2021 09:35:49 -0400")
Philippe Blain <levraiphilippeblain@gmail•com> writes:
>> diff --git a/environment.c b/environment.c
>> index 2f27008424..d550deabbd 100644
>> --- a/environment.c
>> +++ b/environment.c
>> @@ -60,6 +60,8 @@ int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
>> char *check_roundtrip_encoding = "SHIFT-JIS";
>> unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
>> enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;
>> +const char* git_branch_remote = NULL;
>> +const char* git_branch_merge = NULL;
Style:
(1) asterisk sticks to the identifier, not type, in our codebase.
(2) do not initialize globals and statics to 0 or NULL.
> Can the new settings be implemented without adding more global variables ?
This is worth considering in the longer term. For things like these
new configuration items and existign git_branch_track, we already
have reasonably made abstraction that branch.c is where interesting
actions happen (like setting up remote tracking, etc), so there is
no reason for them to be in environment.c or *.h to be visible to
anywhere outside branch.c file.
I wonder if it is a matter of moving git_default_branch_config() to
branch.c from config.c and make it global, while moving these global
variables also to branch.c and make them file-local?
I am still unsure without the expected use-case well documented, if
it is clear enough for users to learn how and when these new
configurations should be used (as opposed to following the
traditional triangular workflow) with only the documentation updates
in this patch, but at least I can trust others like you to give
input to polish this into a reasonable shape.
Thanks for a review (and thanks for starting the effort, Ben).
next prev parent reply other threads:[~2021-07-30 17:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-28 13:50 [PATCH 0/1] Improve automatic setup of tracking for new branches Ben Boeckel
2021-07-28 13:50 ` [PATCH 1/1] config: support setting up a remote tracking branch upon creation Ben Boeckel
2021-07-28 17:48 ` Junio C Hamano
2021-07-28 18:26 ` Ben Boeckel
2021-07-28 18:39 ` Junio C Hamano
2021-07-29 2:01 ` [PATCH 0/1] Improve automatic setup of tracking for new branches Ben Boeckel
2021-07-29 2:01 ` [PATCH 1/1] config: support a default remote tracking setup upon branch creation Ben Boeckel
2021-07-30 13:35 ` Philippe Blain
2021-07-30 14:07 ` Ben Boeckel
2021-07-30 17:32 ` Junio C Hamano [this message]
2021-08-02 13:02 ` Ævar Arnfjörð Bjarmason
2021-08-02 13:16 ` Ben Boeckel
2021-08-02 15:20 ` Ævar Arnfjörð Bjarmason
2021-07-30 1:04 ` [PATCH 0/1] Improve automatic setup of tracking for new branches Junio C Hamano
2021-07-30 1:33 ` Ben Boeckel
2021-07-30 13:35 ` Philippe Blain
2021-07-30 13:57 ` Ben Boeckel
2021-07-30 16:01 ` Philippe Blain
2021-07-30 17:45 ` Ben Boeckel
2021-08-02 21:17 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqim0r1ze0.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jeffhost@microsoft$(echo .)com \
--cc=levraiphilippeblain@gmail$(echo .)com \
--cc=martin.agren@gmail$(echo .)com \
--cc=mathstuf@gmail$(echo .)com \
--cc=me@ttaylorr$(echo .)com \
--cc=pclouds@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox