You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
makes the journal get created on its first access, but what if the user makes a mistake (journal thursday when they meant friday) or wants to use a clever hack by setting $EDITOR to something that does data processing (e.g. EDITOR=head, EDITOR="wc -w" as in https://github.com/kousu/journal/blob/96877287c3da842cccc86847a80636e4281161d6/README.md#tips-and-tricks). It would be nice if non-existent files didn't get created just for looking at them -- reading shouldn't cause a write!. But I don't know how.
pass(1) solves this by a layer of indirection -- they first write to a tmp file, and after $EDITOR quits check what, if anything, was saved to it, and then only move it back in place if they want; they also have to use a tmpfile anyway because they need to temporarily decrypt the contents somewhere.
The text was updated successfully, but these errors were encountered:
journal/journal
Lines 100 to 103 in 9687728
makes the journal get created on its first access, but what if the user makes a mistake (
journal thursday
when they meantfriday
) or wants to use a clever hack by setting$EDITOR
to something that does data processing (e.g.EDITOR=head
,EDITOR="wc -w"
as in https://github.com/kousu/journal/blob/96877287c3da842cccc86847a80636e4281161d6/README.md#tips-and-tricks). It would be nice if non-existent files didn't get created just for looking at them -- reading shouldn't cause a write!. But I don't know how.pass(1)
solves this by a layer of indirection -- they first write to a tmp file, and after $EDITOR quits check what, if anything, was saved to it, and then only move it back in place if they want; they also have to use a tmpfile anyway because they need to temporarily decrypt the contents somewhere.The text was updated successfully, but these errors were encountered: