It would just take somebody going through the code and switching all " unsigned long" to " long long" (or time_t, or even " gittime_t" if we want to abstract it).Īnd fixing the parser algorithm at least in tm_to_time_t() The good news that this is purely a code problem. It probably happens to work because casting the bits back and forth between signed and unsigned types generally works, as long as you end up with the type that you want.īut it isn't necessarily portable, and there can be subtle bugs. We freely interchange between time_t and unsigned long in the low-level date code. I am not sure there isn't some unportability at the lowest level. #=> error: unpack failed: index-pack abnormal exitįinally, when running test-date from git sources. Last issue: when trying to push this commit to a remote repository: #=> remote: error: object 2ee8fcc02658e23219143f5bcfe6f9a4615745f9:invalid tig(1) displays 55 years ago so the actual commit date is properly stored. Git update-ref -m 'commit: foo' refs/heads/masterĬommit date is effectively updated, but git show clamps the date to zero ( Jan 1 1970).
# at this point, edit the file to replace the timestamp Second technique, described in the git ml archive, not using the porcelain: git commit
TEXTMATE GIT ISO
The date I'm trying to set is October 4, 1958, that is around timestamp -354808800.įirst technique, using the commit -date flags with ISO 8601: it says Trying to represent a date before has been attempted before: see this thread TLDR date before unix epoch can be stored, but cannot be sure to be correctly represented.īut that has evolved since 2014 (see at the end) Puts "Please initialize git repository first!"Īs far back as commit c64b9b8 (git 0.99, May 2005), time has always been referred as Ĭommit 6eb8ae0 defines date as an unsigned long since April 2005. You should be able to figure out the rest yourself. If the file wasn't changed, no commit will be done, because git will block the commit.īelow I have extended the command to pop up a dialog for the commit message and to give a nice warning, if no git repository was found. #!/usr/bin/env rubyįilename = ENV.split("/").lastĮvery time you type in Command-S the file will be saved and committed to an (already existing) git repository. Now copy the code below into the text area and assign Command-S as the commands key-binding. What you want is this: Create a new command, set "Save" to "Current File" (this option is above the text area), "Input" to "Entire Document" and "Output" to "Show as Tool Tip".