summaryrefslogtreecommitdiff
path: root/git-branch.sh
AgeCommit message (Collapse)Author
2006-03-03git-branch: add -r switch to list refs/remotes/*Eric Wong
If we decide to use refs/remotes/, having a convenient way to list them would be nice. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-29git-branch: Documentation fixesFredrik Kuivinen
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-17Comment fixes.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14Usage message clean-up, take #2Fredrik Kuivinen
There were some problems with the usage message clean-up patch series. I hadn't realised that subdirectory aware scripts can't source git-sh-setup. I propose that we change this and let the scripts which are subdirectory aware set a variable, SUBDIRECTORY_OK, before they source git-sh-setup. The scripts will also set USAGE and possibly LONG_USAGE before they source git-sh-setup. If LONG_USAGE isn't set it defaults to USAGE. If we go this way it's easy to catch --help in git-sh-setup, print the (long) usage message to stdout and exit cleanly. git-sh-setup can define a 'usage' shell function which can be called by the scripts to print the short usage string to stderr and exit non-cleanly. It will also be easy to change $0 to basename $0 or something else, if would like to do that sometime in the future. What follows is a patch to convert a couple of the commands to this style. If it's ok with everyone to do it this way I will convert the rest of the scripts too. [jc: thrown in to proposed updates queue for comments.] Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29define die() for scripts that use it.Junio C Hamano
As a fallout from not using git-sh-setup in scripts that can operate from a subdirectory, we lost definition of die() from them. It might make sense to do some cleanup to consolidate them back again, but this should suffice for now. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29branch: make it operable from a subdirectory.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-25git-sh-setup: die if outside git repository.Junio C Hamano
Now all the users of this script detect its exit status and die, complaining that it is outside git repository. So move the code that dies from all callers to git-sh-setup script. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-18git-branch: -f to forcibly reset branch head.Junio C Hamano
A new usage, 'git-branch -f branch [start]', resets the branch head at start (or current head). Should be considered a dangerous operation, but if you are like me to keep rewinding branches it is handy. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15allow git-update-ref create refs with slashes in namesAlex Riesen
Make git-update-ref create references with slashes in them. git-branch and git-checkout already support such reference names. git-branch can use git-update-ref to create the references in a more formal manner now. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-03Do not fail on hierarchical branch names.Junio C Hamano
"git-checkout -b frotz/nitfol master" failed to create $GIT_DIR/refs/heads/frotz/nitfol but went ahead and updated $GIT_DIR/HEAD to point at it, resulting in a corrupt repository. Exit when we cannot create the new branch with an error status. While we are at it, there is no reason to forbid subdirectories in refs/heads, so make sure we handle that correctly. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15git-check-ref-format: reject funny ref names.Junio C Hamano
Update check_ref_format() function to reject ref names that: * has a path component that begins with a ".", or * has a double dots "..", or * has ASCII control character, "~", "^", ":" or SP, anywhere, or * ends with a "/". Use it in 'git-checkout -b', 'git-branch', and 'git-tag' to make sure that newly created refs are well-formed. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-02Add git-symbolic-refJunio C Hamano
This adds the counterpart of git-update-ref that lets you read and create "symbolic refs". By default it uses a symbolic link to represent ".git/HEAD -> refs/heads/master", but it can be compiled to use the textfile symbolic ref. The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah .git/HEAD' have been converted to use new git-symbolic-ref command, so that they can deal with either implementation. Signed-off-by: Junio C Hamano <junio@twinsun.com>
2005-09-15git-branch -d <branch>: delete unused branch.Junio C Hamano
The new flag '-d' lets you delete a branch. For safety, it does not lets you delete the branch you are currently on, nor a branch that has been fully merged into your current branch. The credit for the safety check idea goes to Daniel Barkalow. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-08[PATCH] Do not create bogus branch from flag to git branchAmos Waterland
If you run `git branch --help', you will unexpectedly have created a new branch named "--help". This simple patch adds logic and a usage statement to catch this and similar problems, and adds a testcase for it. Signed-off-by: Amos Waterland <apw@rossby.metr.ou.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-08Big tool rename.Junio C Hamano
As promised, this is the "big tool rename" patch. The primary differences since 0.99.6 are: (1) git-*-script are no more. The commands installed do not have any such suffix so users do not have to remember if something is implemented as a shell script or not. (2) Many command names with 'cache' in them are renamed with 'index' if that is what they mean. There are backward compatibility symblic links so that you and Porcelains can keep using the old names, but the backward compatibility support is expected to be removed in the near future. Signed-off-by: Junio C Hamano <junkio@cox.net>