git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] add: respect --ignore-errors when lstat() reports errors
@ 2019-10-26 21:59 Qusielle via GitGitGadget
  2019-10-26 21:59 ` [PATCH 1/1] add: respect `--ignore-errors` when `lstat()` " qusielle via GitGitGadget
  2019-11-03 20:26 ` [PATCH v2 0/1] add: respect --ignore-errors when lstat() " Qusielle via GitGitGadget
  0 siblings, 2 replies; 6+ messages in thread
From: Qusielle via GitGitGadget @ 2019-10-26 21:59 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

"git add --ignore-errors" command fails immediately when lstat returns an
error, despite the ignore errors' flag is enabled.

There could be files that triggers an error on stat(), when other files
proceed correctly. Issue can be reproduced when running git under Cygwin and
some target files have utf-8 long names (200+ utf chars). Windows can handle
them, but all operations on them failed under Cygwin. Issue can not be
reproduced with usual latin/numeric only names. For example, create a file
with 220 'й' letters by Windows Explorer, then in Cygwin:

Here and below "ййй..." means the line of й copied 220 times.
=============================================================

$ echo -n 'ййй...' | wc -c # check the real size 440

$ ls -la ls: cannot access 'ййй...'$'\320': No such file or directory
-????????? ? ? ? ? ? 'ййй...'$'\320'

$ ls й* ls: cannot access 'ййй...'$'\320': No such file or directory

$ stat й* stat: cannot stat 'ййй...'$'\320': No such file or directory

In my perspective, it's okay to skip these problematic files when ignore
error flag is specified, but official Git terminates entire git add command
when such files come up. But with proposed patch it is the desired behavior:

$ git add --ignore-errors . error: ййй... can only add regular files,
symbolic links or git-directories

All other files have been added correctly.
==========================================

Signed-off-by: Qusielle <qusielle@gmail.com>

qusielle (1):
  add: respect `--ignore-errors` when `lstat()` reports errors

 read-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 566a1439f6f56c2171b8853ddbca0ad3f5098770
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-432%2Fqusielle%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-432/qusielle/master-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/432
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-03 20:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-26 21:59 [PATCH 0/1] add: respect --ignore-errors when lstat() reports errors Qusielle via GitGitGadget
2019-10-26 21:59 ` [PATCH 1/1] add: respect `--ignore-errors` when `lstat()` " qusielle via GitGitGadget
2019-10-28  2:03   ` Junio C Hamano
2019-11-03 20:17     ` qusielle
2019-11-03 20:26 ` [PATCH v2 0/1] add: respect --ignore-errors when lstat() " Qusielle via GitGitGadget
2019-11-03 20:26   ` [PATCH v2 1/1] add: respect `--ignore-errors` when `lstat()` " qusielle via GitGitGadget

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).