finding the right remote branch for a commit

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

 



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@xxxxxxxxxxx
 
"moderation is a fatal thing. enough is as bad as a meal. more than
 enough is as good as a feast."
                                                        -- oscar wilde

Attachment: signature.asc
Description: Digital signature (GPG/PGP)


[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]

  Powered by Linux