Re: [RFC] git-publish

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 13, 2006 at 09:51:27PM -0400, Shawn Pearce wrote:

> But even worse this style of workflow will generate a very messy
> history.  Almost every commit will have been done in isolation,

I think the real reason CVS histories stay un-messy is that 'cvs commit' is
actually more like 'git-commit && git-fetch && git-rebase origin &&
git-push'.  That is the workflow I use for small personal repositories
where I am replacing CVS with git. I always want to keep the server up
to date so my work is accessible from multiple machines, and I almost
never want to branch (I generally only rebase because I forgot a push or
pull). I still don't think I'd want all of that in one command, though.

> So in my humble opinion I think this is not really a workflow style
> that should be encouraged with GIT.  But perhaps tools to show you
> what would happen if you pushed right now (e.g. a shortlog of the
> commits that would upload or that must be downloaded and merged)
> would be useful.

Like git-log --pretty=online origin..HEAD?

One of the things I like about git is how easy it is to find out
what's going on. I have a large number of small project repostories
checked out at any given time. I can quickly get the status of all of
them with this script:

  #!/bin/sh

  count_zero() {
      test `"$@" | wc -l` = 0
  }

  check_git() {
    cd $1
    count_zero git-ls-files \
      -m -o -d --exclude-per-directory=.gitignore \
      --directory --no-empty-directory || echo COMMIT:$1
    if test -e .git/branches/origin -o -e .git/remotes/origin; then
      git-fetch || echo FETCH:$1
      count_zero git-rev-list master..origin || echo MERGE:$1
      count_zero git-rev-list origin..master || echo PUSH:$1
    else
      echo ORIGIN:$1
    fi
    test "`git-count-objects | cut -d' ' -f1`" -gt 1000 && echo PACK:$1
  }

  for i in `find $PROJECT_ROOTS -type -d -name .git | sed 's!/.git$!!'`; do
    echo Checking $i...
    errors="$errors `check_git $i`
  done
  echo $errors | sed -e 's/ /\n/g' -e 's/:/: /g'

This lets me know if I've forgotten to commit anything, if I've forgotten to
push (or if I haven't even set up an origin yet!), or if there are new changes
waiting for me to merge.

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]