Git Product home page Git Product logo

git-backup's Issues

Create `Makefile`

Task

Create a Makefile that would

  • install the script in the appropriate /usr location - 7b2a6f0
    • re-search the proper /usr location
  • Update README - 3021bef
  • install & gzip the manual page (git-backup(1)) (why gzip?)

Notes

probably use install & gzip utils.

maaaaybe consider windows? lmao normies

High priority, since the user has to manually add the script to his path or the appropriate /usr location.

Same with the manual page. And the -m option won't work since the manual page is not provided.

Create `delete backup` functionality

Task

  • Create a function which delete backups
    • Figure out how we want to display current backups so that we can
      • select one or multiple of them
    • One of them
    • Multiple
    • All
    • Make it work with remote backups (git push origin :branch-name)

Better handle errors with bash equivalent of try/catch/finally

{
	do_stuff
	doSomeMoreStuff
} || {
	check_for_error_1 && handle_error_1
	checkForError2 && handleError2
}

This will be useful in restoring the git stash, independent of either a failure or success.
This will probable require a finally thingie.
Or maybe consider wrapping the function up? Maybe?

Update README.md

Task

Update README.md with

  • description
  • installation info (preferably, using Makefile with make - see #1)
  • installation info for arch users (yay -S git-backup once #2 is done)

Create `restore from backup` functionality

Task

  • Create a function which would restore changes from

    • XYZ backup

      • list backups - #6
        • select one to restore from
    • latest backup

      • Identify the latest backup (probably by the unix date timestamp we add to the branch name) (create as separate function since it'd be needed for other stuff too)
  • implement an option to activate this function

    • think of a good name
    • handle in the script
    • update docs
      • raw
      • manual page

Running in untracked directory will create the backup (stash), but won't pop it back

There's some bad sh1t happening if you run git-backup in an untracked directory.

I don't know if this also happens with just regular git stash -u (probably?)

I need to investigate more (I just wasted an hour+ trying to recover; I succeeded, but boy was this stressful).

What helped me recover was:

  1. checking my shell history - when was the last time I ran git-backup
  2. going through git reflog --all and finding a commit that has a date very similar to the one found in the shell's history. Mine was identical.
  3. git stash apply <COMMIT-ISH>

Create `list backups` functionality

Task

  • Create a function which would list backups

    • Local backups
    • Remote backups
    • Both
    • Decide which backups should be listed by default
  • Implement an option to activate this function

    • think of a good name
    • handle in the script
    • update docs
      • raw
      • manual page
  • Make it extendable for other commands (see #4 & #5)

    • Make a single or multiple backups selectable (probably in interactive mode, something like git rebase -i)

Future

  • Display which ones can be backed up (to where HEAD points to, checking if the changes could apply without conflicts (check by commits/refs/whatever-works, if possible, to avoid having to test every backup))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.