git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brent Goodrick <bgoodr@gmail.com>
To: git@vger.kernel.org
Subject: Is there a way to exclude user-specified files or directories from  participating in merges?
Date: Tue, 17 Feb 2009 16:49:01 -0800	[thread overview]
Message-ID: <e38bce640902171649g765275a4n4e86d1d4f4aaf394@mail.gmail.com> (raw)

Suppose I create a git repo called central.git on a machine I will
call "central". In that central.git repo, I put these files:

  work.sh
  home.sh
  generic.sh

When I clone the central.git repo on to a different machine I will
call "work", I want this fileset to be pulled:

  work.sh
  generic.sh

But not the home.sh file.

Similarly, when I clone the central.git repo on a machine I will call
"home", I want this fileset to be pulled:

  home.sh
  generic.sh

But not the work.sh file.

What I think I need are two branches, one called "home_branch" and
"work_branch", but read on for the twist:

Say I'm working on editing the work machines fileset on the work repo
I had cloned originally from central.git, and commit a change to both
generic.sh and work.sh.  I do a git-push to an appropriate remote
branch I have set up on the central.git repo, so that I can do a
git-merge type of integration on the central machine in the
central.git repo into the other branches (i.e., into the home_branch),
specifically so that the home_branch gets updated with the change to
the generic.sh file.  However, I want the home_branch to be updated
with the change I made to generic.sh, but I don't ever want the
work.sh to show up in the home_branch that would occur during a normal
merge. Likewise, I would not ever want the home.sh file to participate
in merges from the work fileset back over to the home fileset (and
likewise I would not ever want to see the work.sh file show up on the
home_branch).

The above should apply for all files certain special directories. For
instance, if I were to have a work_files directory and a home_files
directory, then the the work_files is for the "work" machine (and
work_branch) and the "home_files" is for the "home" machine (and
home_branch).

How do I mark certain files and/or directories (via relative file
paths or with file globbing) on certain branches to be excluded from
being merged into all other (or a specified list of) branches?
Ideally I would want to only have to add some logic to the .git/config
file in the central.git repo that specifies the exclusions/exceptions,
and not have to remember to make corresponding changes into any of the
other repos that are cloned from it. Is this possible?

Also, is there a way to avoid the home.sh file from ever being added
to any file underneath the .git directory of the repo I cloned on the
"work" machine. I would not want there to be any risk that anyone with
network access to the "work" machine (say, a sysadmin with sufficient
privileges) to be able to see any form of the home.sh file since it
exists on some branch in the .git directory.

Thanks,
Brent

             reply	other threads:[~2009-02-18  0:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-18  0:49 Brent Goodrick [this message]
2009-02-18  1:05 ` Is there a way to exclude user-specified files or directories from participating in merges? Junio C Hamano
2009-02-18  1:32   ` Brent Goodrick
2009-02-18  1:58     ` Junio C Hamano
2009-02-18  5:39       ` Brent Goodrick
2009-02-18  1:36   ` Junio C Hamano
2009-02-18 13:33   ` Sitaram Chamarty
2009-02-18 19:02     ` Junio C Hamano
2009-02-19 13:37       ` Sitaram Chamarty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e38bce640902171649g765275a4n4e86d1d4f4aaf394@mail.gmail.com \
    --to=bgoodr@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).