Comments (9)
I was able to share the instructions between two repositories. For others:
To push from your repository clone to a remote:
$ git push origin refs/insns/*
To fetch from a remote such as GitHub:
$ git fetch origin 'refs/insns/*:refs/insns/*'
from git-integration.
There's a note at the end of the manpage, but it assumes quite a lot of Git knowledge. Suggestions for improvements welcome... 😃
from git-integration.
How about just adding two new options --push-insns
and --fetch-insn
(or ...-instructions
) that do exactly that? If no argument to the options is specified, instructions for all integration branches should be pushed / fetched, otherwise only for the given integration branch name.
from git-integration.
The setup I use is either to force push everything (including instructions) when I own the remote repository or to use a pre-push hook when I'm using a shared remote. The setup for pushing everything is:
git config remote.pushdefault my-remote
git config push.default matching
git config --add remote.my-remote.push +refs/insns/*:refs/insns/*
git config --add remote.my-remote.fetch +refs/insns/*:refs/insns/*
And for a pre-push hook is:
git config --add remote.origin.fetch +refs/insns/*:refs/insns/*
cat <<\EOF >.git/hooks/pre-push
#!/bin/sh
while read -r lref lsha1 rref rsha1
do
case "$lref" in
refs/heads/*)
if git rev-parse --quiet --verify refs/insns/${lref#refs/heads/} >/dev/null
then
git push origin +refs/insns/${lref#refs/heads/}:refs/insns/${lref#refs/heads/}
fi
esac
done
EOF
All of that assumes that you start with something up-to-date and that no one else will change the remote instruction sheet, which isn't really ideal. So perhaps a --pull-insns
option that merges remote changes with local changes would be useful (at which point --push-insns
becomes a natural extension); at that point I think we will also need to store the remote refs separately, so unless Git makes the change to have refs/remotes/<name>/heads/
instead of just refs/remote/<name>/
we'll need something like refs/remote-insns/<remote>/
to store the remote version.
Perhaps that means that the first new option should be --merge-insns-into <other>
which updates refs/insns/<name>
with the result of merging refs/insns/<name>
into <other>
(so it performs a "backwards" merge, which I think is normally the right way round when pulling - there's been a lot of discussion about this on the Git mailing list over the last few months).
from git-integration.
I wonder if there's a good way to make the instructions part of the commit
that results from git integration --rebuild
. I haven't completely thought
it through, but it seems plausible that it might feel more natural to
couple the instructions and the resulting branch.
from git-integration.
Interesting. I wonder if it would be useful to use notes to attach integration instructions to the resulting commits. That might make the status operation for some more complicated scenarios (e.g. fixup commits to create evil merges) easier, but it would be yet another thing to share with shared integration branches.
from git-integration.
I'm not very familiar with Notes.
I had been thinking of some way to attach a hidden Blob of instructions to a Commit. I imagine that might not work well if it meant I could inadvertently destroy the instructions by rewinding or similar.
from git-integration.
For attaching extra data to commits, notes are pretty much the way to go. But you're right that they may not be preserved across various operations (see the documentation on notes.rewriteRef
in git-notes(1)
).
I think I'm veering off into an unrelated topic now though, since adding yet another ref won't make it easier to share instruction sheets! (I should have read the subject, not just the latest comment...)
I'm not convinced that there is a technical solution for discovering instruction sheets, but perhaps git-integration could try to fetch instructions from a remote if a user tries to use it on a branch that doesn't have instructions; that probably wants to be configurable and default to "ask".
from git-integration.
Something like that might work.
from git-integration.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-integration.