git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Redirect isn't working:
@ 2023-01-19 18:06 Jack Adrian Zappa
  2023-01-20  1:46 ` brian m. carlson
  0 siblings, 1 reply; 3+ messages in thread
From: Jack Adrian Zappa @ 2023-01-19 18:06 UTC (permalink / raw)
  To: git-mailing-list

Here is the filled out form for submitting a bug report:

What did you do before the bug happened? (Steps to reproduce your issue)

  At the command line, I typed the following command:

  $ git diff --no-index --word-diff --color=always <(od -An -t x1
-w10000000000 file1.txt) <(od -An -t x1 -w10000000000 file2.txt)

What did you expect to happen? (Expected behavior)

  I expected to see the diff of the two files.

What happened instead? (Actual behavior)

  Instead I saw this:

  error: Could not access '/proc/1961/fd/63'

What's different between what you expected and what actually happened?

  The difference is that I would get the difference between the two
files as opposed to a critical failure message.

Anything else you want to add:

  Nope.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.38.1.windows.1
cpu: x86_64
built from commit: b85c8f604d375d4d773a36842964e8a7ec056aae
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19044
compiler info: gnuc: 12.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]
not run from a git repository - no hooks to show

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

* Re: Redirect isn't working:
  2023-01-19 18:06 Redirect isn't working: Jack Adrian Zappa
@ 2023-01-20  1:46 ` brian m. carlson
  2023-03-27  9:38   ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: brian m. carlson @ 2023-01-20  1:46 UTC (permalink / raw)
  To: Jack Adrian Zappa; +Cc: git-mailing-list

[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]

On 2023-01-19 at 18:06:17, Jack Adrian Zappa wrote:
> Here is the filled out form for submitting a bug report:
> 
> What did you do before the bug happened? (Steps to reproduce your issue)
> 
>   At the command line, I typed the following command:
> 
>   $ git diff --no-index --word-diff --color=always <(od -An -t x1
> -w10000000000 file1.txt) <(od -An -t x1 -w10000000000 file2.txt)
> 
> What did you expect to happen? (Expected behavior)
> 
>   I expected to see the diff of the two files.
> 
> What happened instead? (Actual behavior)
> 
>   Instead I saw this:
> 
>   error: Could not access '/proc/1961/fd/63'
> 
> What's different between what you expected and what actually happened?
> 
>   The difference is that I would get the difference between the two
> files as opposed to a critical failure message.

Thanks for the report.  This has come up before (and I attempted a
patch), but the ultimate problem here is that the /proc/PID/fd/* files
are symlinks on Linux, and instead of dereferencing symlinks, Git tries
to read them and print where they point to.  That doesn't work in this
case because the symlinks are symlinks to anonymous pipes, which can't
be resolved.

On other systems, the behaviour may be different because those files may
be represented differently.

My patch attempted to solve this by simply opening the contents instead
of stat'ing them as normal, but I think we found some edge cases and it
didn't get finished.  Note that this behaviour is what plain diff does
because it doesn't handle symlinks at all.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

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

* Re: Redirect isn't working:
  2023-01-20  1:46 ` brian m. carlson
@ 2023-03-27  9:38   ` Johannes Schindelin
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2023-03-27  9:38 UTC (permalink / raw)
  To: brian m. carlson; +Cc: Jack Adrian Zappa, git-mailing-list

Hi brian & Jack,

On Fri, 20 Jan 2023, brian m. carlson wrote:

> On 2023-01-19 at 18:06:17, Jack Adrian Zappa wrote:
> > Here is the filled out form for submitting a bug report:
> >
> > What did you do before the bug happened? (Steps to reproduce your issue)
> >
> >   At the command line, I typed the following command:
> >
> >   $ git diff --no-index --word-diff --color=always <(od -An -t x1
> > -w10000000000 file1.txt) <(od -An -t x1 -w10000000000 file2.txt)
> >
> > What did you expect to happen? (Expected behavior)
> >
> >   I expected to see the diff of the two files.
> >
> > What happened instead? (Actual behavior)
> >
> >   Instead I saw this:
> >
> >   error: Could not access '/proc/1961/fd/63'
> >
> > What's different between what you expected and what actually happened?
> >
> >   The difference is that I would get the difference between the two
> > files as opposed to a critical failure message.
>
> Thanks for the report.  This has come up before (and I attempted a
> patch), but the ultimate problem here is that the /proc/PID/fd/* files
> are symlinks on Linux, and instead of dereferencing symlinks, Git tries
> to read them and print where they point to.  That doesn't work in this
> case because the symlinks are symlinks to anonymous pipes, which can't
> be resolved.
>
> On other systems, the behaviour may be different because those files may
> be represented differently.
>
> My patch attempted to solve this by simply opening the contents instead
> of stat'ing them as normal, but I think we found some edge cases and it
> didn't get finished.  Note that this behaviour is what plain diff does
> because it doesn't handle symlinks at all.

Please note that this is not about a bug in Git itself, but in the MSYS2
Bash that Git for Windows includes in its distribution.

The technical details are quite involved, and I wrote up a ticket here, in
case somebody is up for a real good challenge:
https://github.com/git-for-windows/git/issues/4266

Ciao,
Johannes

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

end of thread, other threads:[~2023-03-27  9:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 18:06 Redirect isn't working: Jack Adrian Zappa
2023-01-20  1:46 ` brian m. carlson
2023-03-27  9:38   ` Johannes Schindelin

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