-
Notifications
You must be signed in to change notification settings - Fork 305
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
Add ttar: plain text archive, replacement for tar #59
Conversation
This changeset adds ttar, a plain text replacement for tar, and uses it for the sysfs fixture archive. The syntax is loosely based on tar(1). Using a plain text archive makes it possible to review changes without downloading and extracting the archive. Also, when working on the repo, git diff and git log become useful again, allowing a committer to verify and track changes over time. The code is written in bash, because bash is available out of the box on all major flavors of Linux and on macOS. The feature set used is restricted to bash version 3.2 because that is what Apple is still shipping. The programm also works on Windows if bash is installed. Obviously, it does not solve the Windows limitations (path length limited to 260 characters, no symbolic links) that prompted the move to an archive format in the first place.
This changeset is inspired by @grobie's comment in issue #54. We needed an archive format because Windows fails when checking out repos with certain files (e.g., file paths that include colons or are longer than 260 characters). For now, we are using tar: a binary format that is opaque as far as github reviews and git (diff, log -p) are concerned. @grobie mentioned https://github.com/jtvaughan/ptar which addresses this problem but adds a dependency to another language, C. This changeset implements a simple plain-text archive in bash 3.2, which is installed by default with all major Linux distributions and with all versions of macOS. The script can handle plain-text files, symbolic links, and directories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, looks great! Thanks a lot @ideaship!
Let's see if my trusty bash gurus @matthiasr and @SuperQ have any remaining comments, otherwise I'll merge tonight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for writing this, it's a great solution.
Yea, this is fine. Not my normal bash style, but reasonably good. |
Add ttar: plain text archive, replacement for tar
Implement Process.root() method to retrieve current root directory
This changeset adds ttar, a plain text replacement for tar, and uses it
for the sysfs fixture archive. The syntax is loosely based on tar(1).
Using a plain text archive makes it possible to review changes without
downloading and extracting the archive. Also, when working on the repo,
git diff and git log become useful again, allowing a committer to verify
and track changes over time.
The code is written in bash, because bash is available out of the box on
all major flavors of Linux and on macOS. The feature set used is
restricted to bash version 3.2 because that is what Apple is still
shipping.
The programm also works on Windows if bash is installed. Obviously, it
does not solve the Windows limitations (path length limited to 260
characters, no symbolic links) that prompted the move to an archive
format in the first place.