gitdiff, utility for git

gitdiff is available in github at michaelpq/home.

About gitdiff

Small utility developed to make the development under GIT simple.

Why?

Don’t you have multiple repositories in your local environment?
Aren’t you interacting in your work with multiple users at the same time, exchanging patches with them?
Aren’t you tired to go from folder to folder to open each file you need to edit?
Applying a patch on a repository and forgot to add the files linked to it?
Wanna clean up your folder of untracked files?
Isn’t it long to open all the files of a developing branch one-by-one?

For what?

gitdiff can make your life really easy with GIT.
It holds the following features:

  • Apply a patch and create a branch at the same time,
    avoids a unfortunate patch application on a master branch!
  • Clean up your folder of undesired files in 1 command,
    no need to move from repo to repo.
  • Open once-in-a-row all the files developed on a branch.
  • Choose the number of files to be opened by terminal window,
    each tab has the title of associated file.
  • Add once-in-a-row to a branch all the files not tracked yet.
  • Checkout a branch easily wherever you are in your environment.
  • View all the existing branches of chosen GIT Repository.
  • Choose the Repository you want to see.
  • Of course interact with the editor you prefer: emacs, vi or nano.
  • Generate to an output file the commands launching file openings.

Help for gitdiff

Synopsys

This manual describes some help for the application gitdiff of project Bacasable developed by Michael Paquier.
gitdiff is composed of a couple of commands and they are just presented successively.
If you find any bugs in the program, thanks to report it the problem
in the bug tracker of Bacasable project in Source forge servers.

By default, the script is set to use a branch master called “master”
and a GIT repository located in $HOME/pgxc.
Note: This utility is from a Postgres-XC’s developer, important not to forget ;)

Those parameters can be changed easily in the header of the script.
If this script will just be used for one repository, it is recommended to change the header parameter CODE_REPO.

List of commands

Print the help

gitdiff -h

If you are not enough motivated to put your hands in gitdiff script,
it is possible to set the repository the script is interacting with -d option at each moment.

gitdiff -d $GIT_REPO .. + rest of the command

Clean up chosen folder of untracked files.

gitdiff -f

Track in repository all the untracked files.

gitdiff -a

View all the existing branches of repository (remote and local).

gitdiff -l

Checkout a branch.

gitdiff -b $BRANCH_NAME

Apply a patch to a branch, add to the branch untracked files and commit it to the branch.

gitdiff -b $BRANCH_NAME -p $PATCH_NAME

If the branch does not exist, a new one is created.
Commit log of the patch is simply the name of the patch applied.

Open all the diff files of a branch chosen compared with master.
Each file is opened in a different tab whose title is the file name.
Possibility to choose the number of files open in each terminal with option -n.
Number of files opened by terminal is 10 by default.
Possibility to choose the editor to open the files with option -e (emacs, nano or vi).
emacs is the editor by default.

gitdiff -e $EDITOR -d $REPO_NAME -b $BRANCH_NAME -n $NUM_FILES

This command:

gitdiff -b branch

opens all the diff files of default repository with emacs and 10 files per terminal.

Option -b is mandatory. Options -n, -d and -e are optional,
it depends on how you want to customize this utility :)

©2010-2013 Michael Paquier All content is ©Copyright of Otacoo.com 2010-2013. Privacy Policy - Terms of Use