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

Re: are hashes calculated from data

From
PBPeter Baumann <waste.manager@gmx.de>
Date
Apr 2, 2010, 06:10 UTC
Message-ID
<20100402061015.GC14999@m62s10.vlinux.de>
In-Reply-To
<y2j32541b131004012148w283911f8pf04a21fc307f68ed@mail.gmail.com>
On Fri, Apr 02, 2010 at 12:48:44AM -0400, Avery Pennarun wrote:
Show 40 quoted lines
> On Fri, Apr 2, 2010 at 12:22 AM, Miles Bader <miles@gnu.org> wrote:
> > Avery Pennarun <apenwarr@gmail.com> writes:
> >> At work, we have a cronjob that basically does most of these steps for
> >> us.  Then there's a central git repo that corresponds to the svn repo;
> >> people who want to use git can use that repo and not worry about
> >> git-svn.
> >
> > Do you happen to have the cron script available for perusal anywhere?
> >
> > I imagine many of the details would need to be changed for other
> > installations, but just looking at a working concrete example could be
> > very helpful...
> 
> Unfortunately the particular script we're using is about 99% local
> stuff and 1% useful stuff, so posting it won't really help.  The
> pseudocode is something like this:
> 
>        # configure your git-svn so that all its branches are under remotes/svn/*
>        git fetch origin
>        git svn fetch --fetch-all
>        for each branch in remotes/svn/*
>            git checkout remotes/svn/$branch   # detaches HEAD
>            git merge --no-ff origin/$branch
>            git svn dcommit   # replaces merge commit
>            git checkout origin/$branch
>            git merge remotes/svn/$branch
>            git push origin HEAD:$branch
>        git push origin refs/remotes/svn/*:refs/heads/svn/*
> 
> And then people who want to push into svn can push into the 'origin'
> repository, wherever that may be.  With some tweaking, you could make
> the git-svn repo and the origin repo the same.  It's a little annoying
> because git-svn absolutely insists on its branches being in
> refs/remotes/ somewhere, which means they don't normally get fetched
> when other people grab from your repo.
> 
> Also consider setting [merge]summary=true in your .gitconfig, so that
> the svn commit will have *some* useful information about what got
> committed.
> 

If I understand you correctly, this will commit only the the merge to svn and won't show all the commits the developer made (because of the --no-ff). From a SVN standpoint isn't it the same as doing the following?

	git checkout remotes/svn/$branch 	# to deatch the HEAD
	git merge --squash  origin/$branch
	git svn dcommit
I asked because in my workflow I can't to afford lossing the single commits.
Peter
Previous: Avery PennarunNext: Avery Pennarun
Message 5 of 7 in “are hashes calculated from data”
  1. Raymond AugeApr 2, 2010
  2. Avery PennarunApr 2, 2010
  3. Miles BaderApr 2, 2010
  4. Avery PennarunApr 2, 2010
  5. Peter BaumannApr 2, 2010
  6. Avery PennarunApr 2, 2010
  7. Peter BaumannApr 2, 2010

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.