Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-diffn.sh generates line numbers for /dev/null (when file is added or removed) #31

Open
camac opened this issue Aug 15, 2024 · 0 comments

Comments

@camac
Copy link

camac commented Aug 15, 2024

Note: Thank you for sharing the helpful git-diffn.sh script. I will follow up with a PR that fixes this issue. I am just recording the issue so it is searchable for anyone else using the script.

The git diff uses /dev/null as the source path when a file is added, and when a file is removed /dev/null is used as a destination path.
For example when a file is removed:

--- a/some/file.txt
+++ /dev/null

The git-diffn.sh script does not take this into account (it only expects a/somefile.txt or b/somefile.txt. This means /dev/null is prepended with a line number that doesn't make sense (leftover from the above linenumbers).

e.g.

--- a/some/file.txt
+      162:+++ /dev/null
camac added a commit to camac/eRCaGuy_dotfiles that referenced this issue Aug 15, 2024
Fix for issue ElectricRCAircraftGuy#31 
Update to the regular expression that identifies the source/destination path lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant