git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* finding the right remote branch for a commit
@ 2007-07-10 14:49 martin f krafft
  2007-07-11 21:26 ` Johannes Schindelin
  0 siblings, 1 reply; 7+ messages in thread
From: martin f krafft @ 2007-07-10 14:49 UTC (permalink / raw)
  To: git discussion list

[-- Attachment #1: Type: text/plain, Size: 2853 bytes --]

Dear list,

I am trying to figure out a way to store ~/.etc in git. With SVN,
I would have a .etc repository for each machine, which would use
svn:externals to reference locations of the various subdirectories,
which SVN would then pull and assemble. Thus, my ~/.etc might be

  ~/.etc
  ~/.etc/ssh [svn+ssh://svn.madduck.net/priv/etc/ssh]
  ~/.etc/vim [svn+ssh://svn.madduck.net/pub/etc/vim]
  ...

With git, I am now considering using remote branches for this kind
of stuff. So I'll have a repository for my ssh config and
a repository for my vim config, and so on.

The idea then is to create another repository for each machine and
to register the remote tracking branches there in much the same way
that I used svn:externals previously (and with the added benefit
that I don't have to stay within subdirectories).

Thus, the vim repository might look like this:

  .etc/
  |-- vim/
  |   `-- rc.vim
  `-- .vimrc -> .etc/vim/rc.vim

and the ssh configuration might be

  .etc/
  |-- ssh/
  |   |-- config
  |   `-- authorized_keys
  `-- .ssh -> .etc/ssh/

My theory is that merging all those remotely tracked branches into
a local repo populates my home directory, and bringing it up to the
latest version is as simple as:

  git remote update
  git branch -r | xargs git merge   # any way to just merge all remote branches?

So far so good, this seems to work just fine.

Right now I am trying to figure out how to push updates back to the
central store so that other machines who "subscribe" to a given
branch can receive the updates.

For instance, I may have made a change to ~/.vimrc and to
~/.ssh/config and committed each to the machine-local repository.
What I need now is a way to tell me

  (a) which commits are local and have not been merged from a remote
      tracking branch. If I actually want to keep commits local,
      e.g. because of changes only applicable to this one machine,
      I can move them to a local branch and rebase that whenever the
      remotes change.

  (b) which commits should be pushed where. This is a bit of
      a strange one it may seem, but in my case, remote branches are
      orthogonal and never touch the same file. Thus, each file
      belongs to one remote branch. How can I determine which one?

      Or even better, how could I push all my local commits to the
      respective remotes?

Thanks for any comments, and sorry to be cluttering the list with my
newbie stuff...

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
spamtraps: madduck.bogus@madduck.net
 
"moderation is a fatal thing. enough is as bad as a meal. more than
 enough is as good as a feast."
                                                        -- oscar wilde

[-- Attachment #2: Digital signature (GPG/PGP) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-16  9:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-10 14:49 finding the right remote branch for a commit martin f krafft
2007-07-11 21:26 ` Johannes Schindelin
2007-07-12  7:47   ` martin f krafft
2007-07-12  9:33     ` Jakub Narebski
2007-07-15 22:33   ` Matthias Lederhofer
2007-07-15 23:48     ` Johannes Schindelin
2007-07-16  9:14       ` Matthias Lederhofer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).