Open dalehenrich opened 12 years ago
I think this would be a good way to go, with very little resistance :). I mean we could even map the commands onto the real git command-line using OSProcess which should work out of the box.
When a checkout
is done (explicit or implied ... pull
, cherry-pick
, etc.) we can immediately do a Metacello load (if there are no outstanding conflicts) ...
#pull:
is simple, I would have thought:
pull: remoteName
^ self pull: remoteName branch: 'master'.
pull: remoteName branch: branchName
"Stuff here"
Be sure to take a look at Gitocello which already (through FFI) wraps a goodly chunk of git.
woops ... I replied out of context (so I deleted the previous comment:).
You are correct that:
git pull --no-commit --no-ff -v origin master
could be mapped to:
Metacello git
project: 'Metacello';
noCommit;
noFf;
v;
pull: 'origin' branch: 'master'
Besides the fact that we cannot exactly duplicate the script commands (issues with arg names and ordering), I question the usefulness of inventing a new language for git when the existing shell commands are so prevalent. I lean towards the following:
Metacello git
project: 'Metacello';
pull: '--no-commit --no-ff -v origin master'
primarily because it is google-friendly ... Being able to copy an example verbatim from stack-overflow to your script is extremely important!
+1
-Larry Trutter Sent from my phone
----- Reply message -----
From: "Dale Henrichs" notifications@github.com
To: "dalehenrich/FSGit" FSGit@noreply.github.com
Subject: [FSGit] Metacello git
? (#15)
Date: Fri, Sep 14, 2012 9:56 am
woops ... I replied out of context (so I deleted the previous comment:).
You are correct that:
git pull --no-commit --no-ff -v origin master
could be mapped to:
Metacello git project: 'Metacello'; noCommit; noFf; v; pull: `origin' branch: 'master'
Besides the fact that we cannot exactly duplicate the script commands (issues with arg names and ordering), I question the usefulness of inventing a new language for git when the existing shell commands are so prevalent. I lean towards the following:
Metacello git project: 'Metacello'; pull: `--no-commit --no-ff -v origin master'
primarily because it is google-friendly ... Being able to copy an example verbatim from stack-overflow to your script is extremely important!
—
Reply to this email directly or view it on GitHub.
While thinking about using git in Smalltalk this morning it occurred to me that there is a natural way to integrate git into Metacello using
Metacello git
and executing commands like the following:Not sure how that I like the command line arg passing, but it sure maps directly to the git documentation which is a real plus ... we could write a little argument parser to pick apart the command line and turn it into proper Smalltalk message sends underneath th covers.
We could do something like:
but then positioinal args would be difficult to handle ... not sure how to map the following to proper Smalltalk:
Anyway, some food for thought ...