Commit Graph

8 Commits

Author SHA1 Message Date
Linus Torvalds
b33e966608 Add "git-sh-setup-script" for common git shell script setup
It sets up the normal git environment variables and a few helper
functions (currently just "die()"), and returns ok if it all looks like
a git archive.  So use it something like

	. git-sh-setup-script || die "Not a git archive"

to make the rest of the git scripts more careful and readable.
2005-07-08 10:57:21 -07:00
Linus Torvalds
e2efb676ef git-checkout-script: use "--verify --revs-only" to parse revs
Sven Verdoolaege points out that I added the --verify option to
git-rev-parse exactly for things like this, but didn't update the
users.
2005-06-27 12:12:18 -07:00
Linus Torvalds
9661c25640 Fix typo in git-checkout-script.
The confusion between "revs" vs "refs" caused us to not find the branch
name, which in turn meant that we never switched the HEAD over to it.
2005-06-21 17:12:38 -07:00
Linus Torvalds
ef0bfa25e9 Remove MERGE_HEAD in "git checkout/reset"
Both of these scripts will end up resetting the index to some specific
head, and any unresolved merge will be forgotten.
2005-06-21 15:40:00 -07:00
Linus Torvalds
dc14841102 git checkout: fix default head case
The "${new=$old}" syntax only works for an undefined 'new', not for an
empty one. I knew that. Really. I'm not stupid.
2005-06-21 11:14:47 -07:00
Linus Torvalds
e8b11749f0 Make "git checkout" know about different branches
Now "git checkout xyzzy" will check out branch "xyzzy" and
switch the HEAD to it.
2005-06-21 11:03:11 -07:00
Linus Torvalds
a79944d76c "git checkout": add "-u" flag to update HEAD conditionally
And fix braino on testing "-f".
2005-06-21 09:59:26 -07:00
Linus Torvalds
303e5f4c32 Add "git checkout" that does what the name suggests
It is careful by default and refuses to overwrite old info, but if you
want to force everything to be re-read, use the "-f" flag.

Some day I'll make it take individual filenames too. Right now
it's all-or-nothing.
2005-06-21 09:47:37 -07:00