From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Derrick Stolee <derrickstolee@github.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 5/6] sequencer: duplicate the result of resolve_ref_unsafe()
Date: Sun, 9 Oct 2022 19:23:06 +0200 [thread overview]
Message-ID: <20221009172306.GA2052@szeder.dev> (raw)
In-Reply-To: <1711157b-8f04-008b-1672-f1fbac3c3e81@github.com>
On Fri, Sep 30, 2022 at 01:23:27PM -0400, Derrick Stolee wrote:
> > - const char *head_ref = resolve_ref_unsafe("HEAD",
> > + const char *head_ref = xstrdup_or_null(resolve_ref_unsafe("HEAD",
> > RESOLVE_REF_READING,
> > NULL,
> > - NULL);
> > + NULL));
>
> Moving to a 'char *' matches our typical pattern of "I am responsible
> for freeing this or passing that responsibility to someone else."
Do we really have such a misleading pattern?
To me 'char*', as opposed to 'const char*', means that "I'll modify
the buffer where this pointer points to, and I must be on the lookout
for when and how that happens".
next prev parent reply other threads:[~2022-10-09 17:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 14:09 [PATCH 0/6] rebase --update-refs: smooth out some rough edges SZEDER Gábor
2022-09-30 14:09 ` [PATCH 1/6] t2407-worktree-heads.sh: remove outdated loop SZEDER Gábor
2022-09-30 14:09 ` [PATCH 2/6] t3404-rebase-interactive: mark a test with REFFILES prereq SZEDER Gábor
2022-09-30 16:46 ` Ævar Arnfjörð Bjarmason
2022-10-05 16:45 ` Junio C Hamano
2022-09-30 14:09 ` [PATCH 3/6] rebase -i: emphasize that 'update-ref' expects a fully-qualified ref SZEDER Gábor
2022-09-30 14:09 ` [PATCH 4/6] sequencer: avoid empty lines after 'update-ref' instructions SZEDER Gábor
2022-09-30 17:18 ` Derrick Stolee
2022-10-05 16:49 ` Junio C Hamano
2022-09-30 14:09 ` [PATCH 5/6] sequencer: duplicate the result of resolve_ref_unsafe() SZEDER Gábor
2022-09-30 16:45 ` Ævar Arnfjörð Bjarmason
2022-09-30 16:51 ` Ævar Arnfjörð Bjarmason
2022-09-30 17:23 ` Derrick Stolee
2022-10-09 17:23 ` SZEDER Gábor [this message]
2022-09-30 14:09 ` [PATCH 6/6] sequencer: fail early if invalid ref is given to 'update-ref' instruction SZEDER Gábor
2022-09-30 17:09 ` Ævar Arnfjörð Bjarmason
2022-09-30 17:29 ` [PATCH 0/6] rebase --update-refs: smooth out some rough edges Derrick Stolee
2022-10-01 16:31 ` SZEDER Gábor
2022-10-01 16:53 ` Junio C Hamano
2022-10-05 17:14 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221009172306.GA2052@szeder.dev \
--to=szeder.dev@gmail.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).