caldwell / commit-patch

Commit patches to Darcs, Git, Mercurial, Bazaar, Monotone, Subversion, or CVS
http://www.porkrind.org/commit-patch/
GNU General Public License v2.0
21 stars 8 forks source link

(autodetect-patch-directory-root) doesn't get confused by symlinks #13

Closed dkogan closed 5 years ago

dkogan commented 7 years ago

Prior to this patch you could have a scenario where

Since (autodetect-patch-directory-root) comparse paths, this would make the comparison fail in the wrong place, and (autodetect-patch-directory-root) would return a wrong result

caldwell commented 7 years ago

I was trying to reproduce this to see if diff-path needed the same treatment (as per your discussion with Jim), but I can't figure out how to get into the situation you mention. What VCS were you using and was the symlink outside the repo pointing in, or inside the repo pointing outside?

This looks like an obvious fix, I just can't figure out how to get into the scenario.

dkogan commented 7 years ago

David Caldwell notifications@github.com writes:

I was trying to reproduce this to see if diff-path needed the same treatment (as per your discussion with Jim), but I can't figure out how to get into the situation you mention. What VCS were you using and was the symlink outside the repo pointing in, or inside the repo pointing outside?

This was with SVN. The real file contained in the VCS was called Makefile.something. There was also a symlink

Makefile -> Makefile.something

Both live in the repo. Since there's very little reason for both of these to exist, I primarily only touch "Makefile", even though the actual file name is "Makefile.something"

dkogan commented 7 years ago

Just hit this again. The patch buffer was referring to the actual file (Makefile.sometihng) and was correct, but commit-patch barfs. Any reason to not merge this?

dkogan commented 7 years ago

barfs thusly:

/bin/sh: 8101: cd: can't cd to /home/dima/blah/blah/blah/Makefile/

It can't cd there because "Makefile" is a symlink as described above, not a directory.

dkogan commented 7 years ago

This bug has another component apparently. The 'default-directory' of the commit buffer was wrong (it was from some previous commit). This always happens and generally doesn't cause a problem. Except here it did. M-x cd to the current project fixed it.

dkogan commented 7 years ago

Just hit this again. Can we merge this? Please?