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

Re: [PATCH 1/1] rebase -r: let `label` generate safer labels

From
Philip Oakley <philipoakley@iee.email>
Date
Sep 2, 2019, 22:13 UTC
Message-ID
<b39e5215-f5d6-eca3-7f08-813b5508d779@iee.email>
In-Reply-To
<CAOjrSZtw+wYHxFRQCfb80xzm9OsGDh2rW8uD+AYYdmDPxk5DFQ@mail.gmail.com>
On 02/09/2019 22:47, Matt Rogers wrote:
Show 5 quoted lines
> I can redo the commit, I had thought that I had previously fixed the 
> author but I guess I was mistaken.
>
> As for issues with non utf-8 encodings, I don't know of any simple way 
> to check for those except for restricting to asci alphanumeric characters

If I read the Wikipedia article [1] about the utf-8 design choices it is pretty reasonable and robust most of the time, though that maybe a part one way trapdoor.

> Also the code given doesn't resolve onelines that consist only of 
> restricted file names (e.g. COM, NUL, etc. On windows)

It maybe that the rebase doc may need (if it happens) a short comment warning of that.

Also need to check if the `label_oid()` function actually makes the label distinct, hence prevents such labels from being used as such a restricted file name - i.e. does it include the oid element.

Ultimately the label could be tweaked to have say the 4char prefix to fool the Windows 'starts with' name detection - which assumes I understand how some of those bad filenames are detected...

Show 21 quoted lines
>
>
>
> On Mon, Sep 2, 2019, 5:24 PM Philip Oakley <philipoakley@iee.email> wrote:
>
>     On 02/09/2019 19:29, Junio C Hamano wrote:
>     > I see there are "lets make sure it is unique by suffixing "-%d" in
>     > other codepaths; would that help if this piece of code yields a
>     > label that is not unique?
>     maybe use a trailing 4 characters  of the oid to get a reasonably
>     unique
>     label?
>
>     Oh, just seen dscho's "we make sure that the labels are unique,
>     via the
>     `label_oid()` function!", maybe needs mentioning in the commit
>     message
>     if re-rolled.
>
>     Philip
>
[1] https://en.wikipedia.org/wiki/UTF-8#Description
Previous: Johannes Schindelin
Message 22 of 22 in “Make git rebase -r's label generation more resilient”
  1. 0/1 Make git rebase -r's label generation more resilientJohannes Schindelin via GitGitGadget, Sep 2, 2019
  2. 1/1 rebase -r: let `label` generate safer labelsMatt R via GitGitGadget, Sep 2, 2019
  3. Phillip WoodSep 2, 2019
  4. Junio C HamanoSep 2, 2019
  5. brian m. carlsonSep 2, 2019
  6. Philip OakleySep 2, 2019
  7. Johannes SchindelinSep 3, 2019
  8. Junio C HamanoSep 3, 2019
  9. Matt RogersSep 3, 2019
  10. Johannes SchindelinSep 2, 2019
  11. Junio C HamanoSep 3, 2019
  12. Johannes SchindelinNov 18, 2019
  13. 0/2 Make git rebase -r's label generation more resilientJohannes Schindelin via GitGitGadget, Nov 17, 2019
  14. 2/2 rebase -r: let `label` generate safer labelsMatthew Rogers via GitGitGadget, Nov 17, 2019
  15. 1/2 rebase-merges: move labels' whitespace mangling into `label_oid()`Johannes Schindelin via GitGitGadget, Nov 17, 2019
  16. Junio C HamanoNov 18, 2019
  17. sequencer: handle rebase-merge for "onto" messageDanh Doan, Nov 18, 2019
  18. sequencer: handle rebase-merges for "onto" messageDoan Tran Cong Danh, Nov 18, 2019
  19. Johannes SchindelinNov 18, 2019
  20. Junio C HamanoNov 21, 2019
  21. Johannes SchindelinNov 18, 2019
  22. Philip OakleySep 2, 2019

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.