git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philip Oakley <philipoakley@iee.email>
To: Matt Rogers <mattr94@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Phillip Wood <phillip.wood123@gmail.com>,
	Matt R via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH 1/1] rebase -r: let `label` generate safer labels
Date: Mon, 2 Sep 2019 23:13:17 +0100	[thread overview]
Message-ID: <b39e5215-f5d6-eca3-7f08-813b5508d779@iee.email> (raw)
In-Reply-To: <CAOjrSZtw+wYHxFRQCfb80xzm9OsGDh2rW8uD+AYYdmDPxk5DFQ@mail.gmail.com>

On 02/09/2019 22:47, Matt Rogers wrote:
> 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...
>
>
>
> 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

  parent reply	other threads:[~2019-09-02 22:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02 14:01 [PATCH 0/1] Make git rebase -r's label generation more resilient Johannes Schindelin via GitGitGadget
2019-09-02 14:01 ` [PATCH 1/1] rebase -r: let `label` generate safer labels Matt R via GitGitGadget
2019-09-02 17:57   ` Phillip Wood
2019-09-02 18:29     ` Junio C Hamano
2019-09-02 20:12       ` brian m. carlson
2019-09-02 21:24       ` Philip Oakley
     [not found]         ` <CAOjrSZtw+wYHxFRQCfb80xzm9OsGDh2rW8uD+AYYdmDPxk5DFQ@mail.gmail.com>
2019-09-02 22:13           ` Philip Oakley [this message]
2019-09-03 11:19       ` Johannes Schindelin
2019-09-03 19:51         ` Junio C Hamano
2019-09-03 22:40           ` Matt Rogers
2019-09-02 19:42     ` Johannes Schindelin
2019-09-03 18:10       ` Junio C Hamano
2019-11-18 20:51         ` Johannes Schindelin
2019-11-17 23:16 ` [PATCH v2 0/2] Make git rebase -r's label generation more resilient Johannes Schindelin via GitGitGadget
2019-11-17 23:16   ` [PATCH v2 1/2] rebase-merges: move labels' whitespace mangling into `label_oid()` Johannes Schindelin via GitGitGadget
2019-11-17 23:16   ` [PATCH v2 2/2] rebase -r: let `label` generate safer labels Matthew Rogers via GitGitGadget
2019-11-18  3:42   ` [PATCH v2 0/2] Make git rebase -r's label generation more resilient Junio C Hamano
2019-11-18 11:23     ` [PATCH] sequencer: handle rebase-merge for "onto" message Danh Doan
2019-11-18 11:57       ` [PATCH v2] sequencer: handle rebase-merges " Doan Tran Cong Danh
2019-11-18 20:15         ` Johannes Schindelin
2019-11-21  0:16       ` [PATCH] sequencer: handle rebase-merge " Junio C Hamano
2019-11-18 20:52     ` [PATCH v2 0/2] Make git rebase -r's label generation more resilient 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=b39e5215-f5d6-eca3-7f08-813b5508d779@iee.email \
    --to=philipoakley@iee.email \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=mattr94@gmail.com \
    --cc=phillip.wood123@gmail.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.
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 NNTP newsgroup(s).