Skip to content

amZotti/TimeWizard

Repository files navigation

Outcome

Enable users to retroactively modify commit timestamps

Purpose

While taking a Data Structures and Algorithms class I ran into an interesting problem. I was creating high quality work that I would definitely want to be able to reference later on, but due to the political nature of academia I was unable to open source my content at that time. I decided I would go ahead, do my coursework, and then just commit it later

A few months later my course was over and I wanted to commit my work. But committing normally would not have the proper timestamp that would reflect when I completed the work. I searched for an easy way to manupulate timestamps in Git but shockingly there were none. From there on I decided to create TimeWizard

Setup

  1. Add TimeWizard to home directory
  2. Add TimeWizard directory to your root path
  3. Use aliases timewizard and timewizard_all to commit a single file or an entire directory respectively

timewizard

Alias: timewizard (full file name) (day number) (month number) "commit message (optional)"

Example: timewizard "README.md" 28 8

timewizard_all

Alias: timewizard_all (day number) (month number)

Example: timewizard 1 10 Success!

timewizard_all will process all files of a given file type within whatever directory you are currently in. All these files will be committed on their own day.

If a user wants to disable auto-incrementing days they can just comment out or delete the line in TimeWizardWrapper "days.next!".

If a user wants to specify the number of days they wish to increment by they can do this by replacing "days.next!" with the following code:

days = days.to_i

days += (number you wish you increment days by)

days = days.to_s

timewizard_commit_tracked

Alias: timewizard_commit_tracked (day number) (month number) "Commit message (optional)"

Example: timewizard_commit_tracked 02 10 "Initialize ArrayBag ADT and MagicSquare puzzle"

It is very common to want to add multiple files into a single commit. Using the new timewizard_commit_tracked alias we can do just that! All you need to do is stage all the files you want to timewizard into a commit and use the special alias noted below.

Defaults

The following are set by default and need to be changed manually in TimeWizard.rb:
  • Default year: "2014"
  • Default commit message: "Created #{filename}"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages