Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Git mirror at SF + link to "repos" script

I've finished the setup of the git mirror at SF.  It is updating from
the CVS version every 10 minutes.  This lets me do all my zsh work using
git now.  I set it up this way:

I did a read-only git clone (from git://zsh.git.sf.net/gitroot/zsh) and
then put a read/write CVS checkout named "cvs" inside the .git subdir.
I have a push script that looks for that dir and chooses to run the git
cvsexportcommit command, which will save all my recent git commits to
the CVS repo.

If anyone is interested in seeing what I did to make pushing from git
easy, check out my multi-repo helper script, "repos" (look at the git_pu
and git_cvsexportcommit functions):


That "repos" script expects to have been called via a 2-letter symlink
of the actual operation to perform:  "di", "st", "up", "lo", "ci", or
"pu".  It figures out what kind of repo you're in, and calls the right
command for that action.

Some of the "repo" script's features:

- "st" (status) for CVS implements a local-only status of changed files
  (though it doesn't list unknown files).  Use "st -u" for a combined
  remote + local status that also includes unknown files.  If the local
  status shows too many changes (e.g. if you touched a file without
  changing it), running "di" or "up" on the file will make "st" accurate

- "di" (diff) and "lo" (log) automatically pipe the output through a
  pager if STDOUT is a terminal (emulating git).  For svn it turns off
  the displaying of deleted files (i.e. --no-diff-deleted).

- "up" (update) for git does a rebase update instead of a merge update.
  For CVS it supports the -n option to disable the update.

- "pu" (push) in a git repo knows now to deal with a git-svn repo and
  (with an embedded "cvs" checkout), a cvsexportcommit repo (the cvs
  code has been lightly tested so far, but I set it up to be pedantic,
  so it should be safe).  I also made "pu" for git understand that if
  there is a remote named "pu" in the config, it should use that for the
  push (this lets you have one URL for pushing (e.g. ssh://...), and one
  for fetching (e.g. git://...), should you so desire).

- "lo" (log) for git has a -v option that makes it easier to get the
  --name-status output.  It also has an -s option that lets you see the
  git-svn log output when in a git-svn repo.

- "ci" (checkin) for git makes the default to commit everything unless
  you specify other (non-"-m") options or files.  I also made a trailing
  -i mean to commit just the changes that are currently added (which is
  the normal git default).  This makes "ci" for git behave more like
  other SCMs I'm used to.

Though the script has support for hg and bzr, I don't do much committing
to those repos, so those SCMs could probably use some more work.


ci -m 'The commit message'
di foobar.c
lo -p        (-p is git only, but is so useful that I thought I'd mention it)


Messages sorted by: Reverse Date, Date, Thread, Author