<div><div dir="auto">Paul, how important is it that the publicly accessible copy of the files is versioned? Do you want to facilitate public contributions, or is it more a convenient way to serve the files and give some sort of change log?</div></div><div dir="auto"><br></div><div dir="auto">Either way, I’m wondering if you’d be just as far ahead to use something like a commit hook to automate a publish step or duplicate commit in public.git whenever the changes to the public files of main.git are committed. This might get a bit tricky where deletions and renames are concerned. It would also suffer the problem of possibly leaking info through commit messages should your discipline waiver.</div><div dir="auto"><br></div><div dir="auto">If I’m interpreting the man page for `git filter-branch` correctly, this would be a one-time deal to generate the public repo. But it </div><div><div dir="auto">would fail the “‘Tracks’ development on main.git fairly easily” criterion I think. If public.git is created by filtering main.git, I don’t think you would later be able to pull branches from main.git into public.git, since git would presumably have to know to filter that branch again. And would it even be able to identify the common ancestor to do so?</div><div dir="auto"><br></div><div dir="auto">It’s quite probable that I’m wrong and git is way smarter than I think, but my gut says that rewritten commits from the filter operation won’t jibe with the original commits.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 31, 2020 at 3:20 PM Erik Schnetter <<a href="mailto:schnetter@gmail.com">schnetter@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes, git filter-branch is probably the way to go.<br>
<br>
Be aware that the commit messages themselves will not be filtered: If<br>
there is a commit that spans both public and private files, then the<br>
respective commit is filtered (rewritten) to only act on public files,<br>
but the message itself might still mention a private file.<br>
<br>
-erik<br>
<br>
On Tue, Mar 31, 2020 at 2:16 PM Doug Moen <<a href="mailto:doug@moens.org" target="_blank">doug@moens.org</a>> wrote:<br>
><br>
> I am not a git expert, so the following may be incorrect.<br>
><br>
> However, my intuition is that this isn't possible exactly as stated.<br>
> The public.git repo contains no version information about private files.<br>
> Each git commit is a snapshot of the entire tree, and has a hash of all<br>
> the data in that snapshot. Since the public.git repo contains only a subset<br>
> of the files in main.git, all of the commit hashes will be different.<br>
> Therefore "pulling changes" from main.git into public.git won't be<br>
> possible in the way you envision it due to hashes not being the same.<br>
><br>
> Although I've never used it, I suspect that "git filter-branch" could be<br>
> used to make a copy of main.git from which all of the private files have<br>
> been removed. It is a very expensive operation, but it would serve the<br>
> purpose of making the revision history of all the public files available<br>
> to other people. It's not exactly what you asked for though.<br>
><br>
> Doug Moen.<br>
><br>
> On Tue, Mar 31, 2020, at 5:49 PM, Paul Nijjar via kwlug-disc wrote:<br>
> ><br>
> > I have a git repo. Let's call it main.git . It has a bunch of files,<br>
> > most of which should stay private.<br>
> ><br>
> > I have a subset of those files that I would like to share with the<br>
> > public. Is it possible/easy to set up a second git repo public.git<br>
> > with the following properties:<br>
> ><br>
> > - Contains the files I would like to share and none of the other files<br>
> >   from main.git<br>
> > - "Tracks" development on main.git fairly easily (so if I make a<br>
> >   change to a public file and commit it, then I can easily pull that<br>
> >   change into the public repo). For this part, let's assume I can be<br>
> >   disciplined enough to make distinct commits for public files.<br>
> > - Has NO information in the git changesets about the private files.<br>
> > - Does not require me muddling with main.git (I do not want to make a<br>
> >   subproject that includes the public files and then have to worry<br>
> >   about incorporating that subproject into main.git)<br>
> ><br>
> > The fallback is that I don't bother tracking the files, and just<br>
> > release a snapshot of files I manually copy out of main.git repository.<br>
> > Being able to track the files in the public repo would be nice, but I<br>
> > am not willing to compromise my workflow on main.git (much) in order<br>
> > to accomplish this.<br>
> ><br>
> > - Paul<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Events: <a href="https://feeds.off-topic.kwlug.org" rel="noreferrer" target="_blank">https://feeds.off-topic.kwlug.org</a><br>
> > Blog: <a href="http://pnijjar.freeshell.org" rel="noreferrer" target="_blank">http://pnijjar.freeshell.org</a><br>
> ><br>
> > _______________________________________________<br>
> > kwlug-disc mailing list<br>
> > <a href="mailto:kwlug-disc@kwlug.org" target="_blank">kwlug-disc@kwlug.org</a><br>
> > <a href="https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org" rel="noreferrer" target="_blank">https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org</a><br>
> ><br>
><br>
> _______________________________________________<br>
> kwlug-disc mailing list<br>
> <a href="mailto:kwlug-disc@kwlug.org" target="_blank">kwlug-disc@kwlug.org</a><br>
> <a href="https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org" rel="noreferrer" target="_blank">https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org</a><br>
<br>
<br>
<br>
-- <br>
Erik Schnetter <<a href="mailto:schnetter@gmail.com" target="_blank">schnetter@gmail.com</a>><br>
<a href="http://www.perimeterinstitute.ca/personal/eschnetter/" rel="noreferrer" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a><br>
<br>
_______________________________________________<br>
kwlug-disc mailing list<br>
<a href="mailto:kwlug-disc@kwlug.org" target="_blank">kwlug-disc@kwlug.org</a><br>
<a href="https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org" rel="noreferrer" target="_blank">https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org</a><br>
</blockquote></div></div>