git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] git-publish

From
Jeff King <peff@peff.net>
Date
Aug 14, 2006, 11:25 UTC
Message-ID
<20060814112544.GA13116@coredump.intra.peff.net>
In-Reply-To
<20060814015127.GA18667@spearce.org>
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.

Show 5 quoted lines
> 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
Previous: Junio C HamanoNext: Martin Langhoff
Message 12 of 14 in “[RFC] git-publish”
  1. Daniel BarkalowAug 13, 2006
  2. Junio C HamanoAug 13, 2006
  3. Johannes SchindelinAug 13, 2006
  4. Junio C HamanoAug 13, 2006
  5. Sam RavnborgAug 13, 2006
  6. Fredrik KuivinenAug 13, 2006
  7. Daniel BarkalowAug 13, 2006
  8. Sam RavnborgAug 13, 2006
  9. Alex RiesenAug 14, 2006
  10. Shawn PearceAug 14, 2006
  11. Junio C HamanoAug 14, 2006
  12. Jeff KingAug 14, 2006
  13. Martin LanghoffAug 13, 2006
  14. Petr BaudisSep 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.