From: Jakub Narebski <jnareb@gmail.com>
To: "Catalin Marinas" <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [StGIT BUG] StGIT errors out on rebasing patch deleting file with Unicode filename
Date: Mon, 2 Jun 2008 17:47:34 +0200 [thread overview]
Message-ID: <200806021747.35243.jnareb@gmail.com> (raw)
In-Reply-To: <b0943d9e0806020626s3a1009d6q2a4cdb2526be9c8d@mail.gmail.com>
Dnia poniedziałek 2. czerwca 2008 15:26, Catalin Marinas napisał:
> 2008/6/2 Jakub Narebski <jnareb@gmail.com>:
>> On Sun, 1 June 2008, Jakub Narebski wrote:
>>
>>> StGIT errors out on rebasing patch which deletes file with Unicode
>>> characters in filename (with characters outside US-ASCII in filename).
>>> The patch in question is patch deleting gitweb/test/* in git directory,
>>> and is present already on the 'origin' branch (the branch we rebase
>>> onto), so stg-rebase should result in an empty patch (as first patch).
>>>
>>> "gitweb/test/M\303\244rchen" | 2 --
>>> gitweb/test/file with spaces | 4 ----
>>> gitweb/test/file+plus+sign | 6 ------
>>> 3 files changed, 0 insertions(+), 12 deletions(-)
>>> delete mode 100644 gitweb/test/Märchen
>>> delete mode 100644 gitweb/test/file with spaces
>>> delete mode 100644 gitweb/test/file+plus+sign
>>>
>>> I guess the error is caused by using unescaped (quoted) filename.
>>
>> You can WORKAROUND this bug by setting core.quotepath to false. This
>> allowed me to make stg-rebase.
>
> I can add a workaround in StGIT to actually ignore the exception
> raised by os.remove() but I don't know how to convert the quoted file
> name back to its unicode value in Python.
In Perl it is as simple as (see unquote() in gitweb/gitweb.perl)
if ($str =~ m/^"(.*)"$/) {
# needs unquoting
$str = $1;
$str =~ s/\\([^0-7]|[0-7]{1,3})/unq($1)/eg;
}
where
sub unq {
#...
if ($seq =~ m/^[0-7]{1,3}$/) {
# octal char sequence
return chr(oct($seq));
} elsif (exists $es{$seq}) {
# C escape sequence, aka character escape code
return $es{$seq};
}
# quoted ordinary character
return $seq;
Although I haven't tested this extensively.
Or you can just use '-z' switch to git-diff-tree and/or git-ls-files,
to get filename without quoting (but then you use '\0' as record
delimiter, not "\n").
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2008-06-02 15:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-01 8:46 [StGIT BUG] StGIT errors out on rebasing patch deleting file with Unicode filename Jakub Narebski
2008-06-02 7:39 ` Jakub Narebski
2008-06-02 13:26 ` Catalin Marinas
2008-06-02 15:47 ` Jakub Narebski [this message]
2008-06-02 16:11 ` Catalin Marinas
2008-06-02 20:23 ` [PATCH] Add rebase test for when upstream has deleted a non-ASCII file Karl Hasselström
2008-06-02 21:46 ` [StGit PATCH 0/4] Handle non-ASCII filenames Karl Hasselström
2008-06-02 21:46 ` [PATCH 1/4] Add rebase test for when upstream has deleted a non-ASCII file Karl Hasselström
2008-06-02 21:46 ` [PATCH 2/4] Handle changed files with non-ASCII names Karl Hasselström
2008-06-02 21:46 ` [PATCH 3/4] Test for another filename quoting issue in tree_status() Karl Hasselström
2008-06-02 21:46 ` [PATCH 4/4] Handle refresh of changed files with non-ASCII names Karl Hasselström
2008-06-03 0:41 ` [StGit PATCH v2 0/4] Handle non-ASCII filenames Karl Hasselström
2008-06-03 0:41 ` [StGit PATCH v2 1/4] Add rebase test for when upstream has deleted a non-ASCII file Karl Hasselström
2008-06-03 0:41 ` [StGit PATCH v2 2/4] Handle changed files with non-ASCII names Karl Hasselström
2008-06-03 0:41 ` [StGit PATCH v2 3/4] Test for another filename quoting issue in tree_status() Karl Hasselström
2008-06-03 0:41 ` [StGit PATCH v2 4/4] Handle refresh of changed files with non-ASCII names Karl Hasselström
2008-06-03 7:56 ` [StGit PATCH 0/4] Handle non-ASCII filenames Catalin Marinas
2008-06-03 9:27 ` Karl Hasselström
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=200806021747.35243.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
/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).