git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/2] rebase: refactor dwim_ref_or_die from merge-base.c

From
ATAlex Torok <alext9@gmail.com>
Date
Dec 6, 2019, 13:13 UTC
Message-ID
<CANmPhj1vSQYmwix7FMMBAksSTUJpz0izJyehmOhThkUfyUBy+w@mail.gmail.com>
In-Reply-To
<20191206012335.GA16183@generichostname>
On Thu, Dec 5, 2019 at 8:23 PM Denton Liu <liu.denton@gmail.com> wrote:
> The remaining paragraphs shouldn't end up going into the commit message
> since they're more like "notes to reviewers". You should place these
> notes under the `---` below so that they won't end up in the final
> commit message.
Thank you for the info! I'll keep that in mind for my next patch submission.
Show 17 quoted lines
> > +void dwim_ref_or_die(const char *str, int len, char **ref)
> > +{
> > +     struct object_id discard;
> > +     switch (dwim_ref(str, len, &discard, ref)) {
> > +     case 0:
> > +             die("No such ref: '%s'", str);
>
> I see that this code is copied so I'm fine with leaving it as is. But if
> you need to do any rerolls, it would be nice to, as a prepatory step,
> introduce a patch which 1. marks these strings for translation and 2.
> lowercases the first letter of the sentence which is the convention for
> messages that are seen by the end-user.
>
> Perhaps:
>
>         die(_("no such ref: '%s'"), str);
>

Sounds good! I'll add a patch to the end of this series that addresses these strings not being translated.

Thank you for your feedback. ~Alex

Show 33 quoted lines
> > +     case 1:
> > +             break; /* good */
> > +     default:
> > +             die("Ambiguous refname: '%s'", str);
>
> Same comment here.
>
> Thanks,
>
> Denton
>
> > +     }
> > +}
> > +
> > +
> >  int expand_ref(struct repository *repo, const char *str, int len,
> >              struct object_id *oid, char **ref)
> >  {
> > diff --git a/refs.h b/refs.h
> > index 730d05ad91..a961662382 100644
> > --- a/refs.h
> > +++ b/refs.h
> > @@ -154,6 +154,7 @@ int repo_dwim_log(struct repository *r, const char *str, int len, struct object_
> >  int dwim_ref(const char *str, int len, struct object_id *oid, char **ref);
> >  int dwim_log(const char *str, int len, struct object_id *oid, char **ref);
> >
> > +void dwim_ref_or_die(const char *str, int len, char **ref);
> >  /*
> >   * A ref_transaction represents a collection of reference updates that
> >   * should succeed or fail together.
> > --
> > 2.17.1
> >
Previous: Denton LiuNext: Alex Torok
Message 10 of 23 in “rebase: fix bug in --fork-point”
  1. 0/3 rebase: fix bug in --fork-pointAlex Torok, Dec 5, 2019
  2. 1/3 rebase: add test for rebase --fork-point with short upstreamAlex Torok, Dec 5, 2019
  3. Junio C HamanoDec 5, 2019
  4. Alex TorokDec 5, 2019
  5. 2/3 rebase: refactor dwim_ref_or_die from merge-base.cAlex Torok, Dec 5, 2019
  6. 3/3 rebase: fix rebase to use full ref to find fork-pointAlex Torok, Dec 5, 2019
  7. 0/2 rebase: fix bug in --fork-pointAlex Torok, Dec 5, 2019
  8. 1/2 rebase: refactor dwim_ref_or_die from merge-base.cAlex Torok, Dec 5, 2019
  9. Denton LiuDec 6, 2019
  10. Alex TorokDec 6, 2019
  11. 2/2 rebase: find --fork-point with full refAlex Torok, Dec 5, 2019
  12. Denton LiuDec 6, 2019
  13. Phillip WoodDec 6, 2019
  14. Alex TorokDec 6, 2019
  15. Denton LiuDec 6, 2019
  16. Phillip WoodDec 6, 2019
  17. 0/1 rebase: fix --fork-point with short ref upstreamAlex Torok, Dec 9, 2019
  18. 1/1 rebase: fix --fork-point with short refnameAlex Torok, Dec 9, 2019
  19. Junio C HamanoDec 9, 2019
  20. Alex TorokDec 11, 2019
  21. Denton LiuDec 11, 2019
  22. Eric SunshineDec 11, 2019
  23. Junio C HamanoFeb 11, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.