Wednesday, April 2, 2014

Announcing Unco - undo changes to files made by any command

Being sick of myself occasionally wiping off the changes made to files by running wrong commands, I have started writing a program called "Unco" (pronunciation: an-ko) - a command that records the changes to the file system, and let the users undo the changes afterwards if necessary.

Unlike existing command-level solutions like aliasing rm to trash-cli, Unco is designed to be capable of undoing changes made by any program; it hooks the library calls that affect the file system and records the changes for later undoing.

The following scenario illustrates how it can be used, in case of git.
  1. instruct the shell to record all git commands
    % alias git="unco record -- git"
    
  2. edit file under the git repository
    % vi program.c
    
  3. Oops! I have accidentally reset the changes
    % git reset --hard HEAD
    
  4. don't worry, just undo the last action
    % undo history
    index    command (*=undone)
         1   git reset --hard HEAD
    % unco undo 1
    
As described, you can apply unco for rm or make install or whatever command.

The development is still in early stages, and I would not advise anybody not capable of debugging the code by oneself to use it. But for those interested, the repo is at github.com/kazuho/unco.

For the time being, the program runs on OS X and linux (edited Apr. 3 2014)only on OS X. Hopefully the command may be polished up so that it can be turned on by default; i.e. record all commands run on the shell by default.

18 comments:

  1. The 147th edition of the British Open begins July 19 at the Carnoustie Race Championship in Angus, Scotland.Defending champion Jordan Spieth leads the pack as he tries to put Claret Jug up for his fourth major victory in his career.MORE: Chances of winning the British Open 2018


    British Open 2018
    British Open
    The British Open 2018
    British Open Golf
    British Open 2018 Live
    2018 British Open

    British Open 2018
    British Open
    The British Open 2018
    British Open Golf
    British Open 2018 Live
    2018 British Open



    Open Championship
    Open Championship Live
    Open Championship 2018

    The Open Championship
    The Open Championship Live
    Open Championship Golf Live

    ReplyDelete
  2. The 70th Primetime Emmy Awards air live Monday, Sept. 17, at 8 p.m. Eastern on NBC.
    Where can I watch the Emmy Awards online?
    If you subscribe to a TV provider, you can log in and stream the show at NBC.com/live, or via the NBC app on pretty much any mobile device. The show will also be available on Hulu’s live TV service.
    Who is hosting?
    “Saturday Night Live” Weekend Update co-hosts Colin Jost and Michael Che. They say they won’t get too political.
    When is the red carpet so I can watch and judge all the fashion?
    As usual, E! has the most comprehensive red carpet show — Giuliana Rancic and Jason Kennedy will co-host and interview the celebrities, beginning at 6 p.m. Eastern.
    Which show has the most nominations?
    HBO’s “Game of Thrones” is shaping up to have a great night — it returned after a year of ineligibility with 22 nominations, the most of any series. It’s followed by NBC’s “Saturday Night Live” and HBO’s “Westworld,” with 21 each, and Hulu’s “The Handmaid’s Tale” with 20.
    Emmys 2018
    Emmy Awards 2018
    Emmys
    Emmy Awards
    Emmy Awards
    Emmys
    Emmy Awards 2018
    Emmys 2018
    Emmys 2018 Live
    Emmy Awards 2018 Live
    Emmys Live
    Emmy Awards Live
    Emmy Awards Live
    Emmys Live
    Emmy Awards 2018 Live
    Emmys 2018 Live
    Emmys 2018 Live Stream
    Emmy Awards 2018 Live Stream
    Emmys Live Stream
    Emmy Awards Live Stream
    Emmy Awards Live Stream
    Emmys Live Stream
    Emmy Awards 2018 Live Stream
    Emmys 2018 Live Stream
    Emmys 2018 Winners
    Emmy Awards 2018 Winners
    Emmys Winners
    Emmy Awards Winners
    Emmy Awards Winners
    Emmys Winners
    Emmy Awards 2018 Winners
    Emmys 2018 Winners

    https://emmysi.de/
    https://emmyawardsi.de/

    ReplyDelete
  3. The World Series 2018 Updates will be the championship series of Major League Baseball's 2018 season.
    The 114th edition of the World Series will be played between the American League champion versus the National League champion and will begin on Tuesday,
    October 23. A potential Game 7 is scheduled to be played on October 31.[2] The Series will be televised nationally by Fox. For the second year in a row,
    the World Series will be sponsored by YouTube TV and officially will be known as the 2018 World Series presented by YouTube TV.[3]

    ReplyDelete

Note: Only a member of this blog may post a comment.