Dear Rainer,
I will do the uploading to-morrow. Your explanations will be fabulous help!
At the moment I am worried that the URL of the repository contains my name:
https://github.com/belbernard/bolprocessor-php
Anthony created a repository with a neutral URL:
https://github.com/belbernard/bolprocessor-php
Can we fix this?
Bernard
Rainer Schuetz wrote on 30/09/2020 13:37:
> Dear Bernard,
>
> Fab! I am not an expert at all myself but I’ll try my best to take your
> hand until things have settled ;-) My own memory of git has faded a bit,
> but fortunately I can look up things easily on the web. Once one is able
> to put questions in the right words, almost everything is answered well
> out there… Let me add this at the outset: anything we run into can be
> changed, undone etc… Deleting a Github repo takes two minutes and
> setting it up again 5….
>
>
>> Now I created this repository:
>> https://github.com/belbernard/bolprocessor-php
>> and a small README file. It will contain exclusively the PHP interface.
>
> Okay, let’s take this as given. I’ll give you the concrete steps with a
> few explanations to get going first, and we can discuss the implications
> later when problems arise or questions pose themselves. I am assuming
> you do this on the command-line.
>
> But first, before you actually start, let’s get identity straight: there
> are two levels to this: one is that you tell git how you identify as an
> author. This requires a “name” and an email address. You’re free to
> chose what you like here, this is not bound to your Github account. The
> other level are the credentials you use to show Github that you have the
> right to access the repo and write to it. The later will be asked from
> you when you try to push to GitHub. So let’s get that authorship id out
> of the way: when you start this is usually done on the “global” git
> configuration level (global is not as global as it sounds, there is also
> “system” and "local”. Global is the default in your userspace, it could
> be overwritten with “local”). The config information is stored in a file
> in your $HOME directory, called .gitconfig. You can edit that file, or
> add entries with git commands. This is mine .gitconfig:
>
>
>
>
> You can also add the entries with git-commands:
>
> git config --global user.name "whatever you chose to appear as author"
> git config --global user.email "the email address that will be
> visibly associated with your authorship”
>
>
> Now let's “clone” the rep you created into your local environment (this
> will create the folder coprocessor-php in the folder you are, so mind a
> potential conflict):
>
> git clone https://github.com/belbernard/bolprocessor-php
>
> You can actually tell git to clone into a folder of a different name (or
> you can later rename the folder, git doesn’t care about the parent
> folder name):
>
> git clone https://github.com/belbernard/bolprocessor-php bolprocessor
>
> Once that’s done you’ll have an almost empty folder, it contains the
> Readme, License and most importantly: a hidden folder .git that contains
> all the current information about the repo. In theory you could delete
> all files in your folder (e.g. accidentally) *except that .git folder*
> and reinstate the entire repo by having git reconstruct them from the
> info in .git (the command would be `git checkout *`). `git init` creates
> that .git folder (but without any version-control-information, when you
> start!).
>
> Now come the crucial steps: you want to add your files to the (that ;-))
> repo: taking files under version control should be thought of, I think,
> as having two steps: the first is to “add” the files (or to stage them),
> and the second is to “commit” them. Only what is committed has ended up
> under version control or is uploaded if you push. Splitting the process
> into two steps might seem like a nuisance at first, but it allows you to
> organise your commits, remove files again from the stage if you changed
> your mind, keep spontaneous/temporary changes (“untracked” files and
> folders) separate from stuff that is considered a candidate to be
> committed. And once you think you aggregated a nice bunch of changes you
> can commit them as a meaningful unit. Commit will commit everything that
> is staged and none of the “untracked files"
>
> So extract your snapshot into that folder and think of it as creating
> the files you will want to add, and subsequently commit and then push to
> your remote repo. You want all the files of the snapshot in the right
> location and nothing else for now (so after getting the files in place
> delete the .zip ’n further artefacts that might have appeared as
> sideffect of extracting the snapshot).
>
> You might want to have a look at what git thinks you’ve changed so far.
> It’s basically a diff of the repo-state stored in the .git folder and
> the current folder state:
>
> git status
>
> It should give you a short list of files and the folder php/ listing
> them as “untracked files"
>
>
>
> If you’re like me and hate those hidden system-files like .DS_Store you
> might want to add that exclusion list right away that I mentioned the
> other day. It’s a file called “.gitignore” residing in the root folder
> of your repo. You can freely edit it, every entry is a line. To exclude
> .DS_Store just add it as a line in a file called .gitignore. The result
> (`git status`) should look like this:
>
>
>
> The gitignore file could at some point get quite long, it might even be
> possible to include Anthony’s repo in that file and exclude it from
> version control… I haven’t fully thought it through, but it could be a
> simple way to keep you working environment, which I assume is having
> both Anthony’s and your files in a shared parent folder. Note that you
> can rename the parent folder, git only looks inside of it. But that’s
> for another day, right? Just keep in mind that .gitignore is maintained
> like any other file in the repo. If you change it, it will “work” right
> away, but if you’d like it to be available for anybody you need to add,
> commit and push it. If you just want it for yourself, you could add
> .gitignore to .gitignore and git wouldn’t remind you of it any more.
>
> Now you’re ready to add the whole bunch using kind of a regex (or a glob
> expression, I am not sure, anyways “.” is "all"):
>
> git add .
>
> If you run `git status` again it’s shows you what it did, it should have
> “added" all files ’n folders to the “stage”:
>
>
>
> Now you’re ready to commit. A commit requires a commit message, and you
> can add it with -m, so that git doesn’t open a text-editor for you (this
> editor thing might be confusing. Not sure if you’re used to a specific
> editor on the command line, it might be helpful to configure that - but
> for now you can avoid the editor by adding the commit message with -m).
> The commit message can be anything you chose. Some people warn it’s
> important to be considerate about it ;-)
>
> git commit -m "Initial commit php-interface for bp3”
>
> Git status will tell you now that the repo has caught up with the folder
> state, *and* that it has overtaken the remote repo by one commit:
>
>
>
> At that point you’re ready to push:
>
> git push
>
> Note that when you cloned the repo git protocolled the remote you used.
> As long as you only have one remote repo, git will use it as the target
> destination. In multi-repo setups (e.g. private repo and Organisation
> repo you might need to configure the default remote or make it explicit
> on the command line).
>
> At this point it should ask you for your Github credentials and store
> them somewhere. Hopefully it won’t ask you each time you push, otherwise
> some more configuration might become necessary. Github also provides a
> way to store ssh-keys, similar to what you might have done with your
> web-provider, so I am pretty sure you’ll get over this.
>
> Fingers crossed your initial commit was uploaded to Github, you should
> be able to see it on the Github-site, Github is usually very fast in
> updating the repo-state on the site.
>
> From now on - as long as things remain basic - i.e. you only have one
> remote, and you only need one-way synching because you’re the only one
> that commits - you just need to get used to going through that “make
> untracked changes (edit something or create a file) - stage (git add …)
> - commit (git commit -m “…”) and upload (git push)” cycle to keep the
> public version of your repo in sync with the local one (some people skip
> add by doing “git commit -am “…”, but that’s considered careless ;-) ).
> All these commands have many options and you can use globs ’n stuff in
> many places, so there is a lot to learn if one wants (most interesting
> maybe branches, that give you a space to explore stuff without messing
> with the main development thread). But the basic cycle can be handled
> like that. A nice thing about git is that it’s quite smart about what
> you might want to do, and it tells you stuff like that you can do “git
> restore —staged <file>” after you added or “git push” after you
> commited. Some of these terms likely require some Googling, but
> generally speaking git is amazingly well documented on all levels.
> Undoing local commits is also possible in various ways (git reset with
> various options like —soft, —hard and more). The hairy thing you want to
> avoid is undoing commits that have already been pushed. As long as
> you’re alone, even that is still possible, but it requires more
> commands. Git wants you to avoid this, because if multiple users share a
> remote and you keep deleting stuff from the remote, synching problems
> are very likely to occur. The general git philosophy, I’d say is -
> rather than undo/delete stuff, add such changes on top as well. They’ll
> be visible in history then, but you avoid synching problems.
>
> I am happy to answer questions that come up (but maybe we better do that
> with private email)
>
> Best
> .r.
>
>
>
>>
>> I chose "GNU General Public License v3.0" which should be ok for
>> our approach.
>>
>> Now, looking at https://guides.github.com/activities/hello-world/ ,
>> I guess that I should push all current files (the content
>> of bolprocessor_php.zip) into this "master" branch, and thereafter
>> create a new "work" branch to push next versions… Is this the case ? I
>> am careful because there seems to be no "undo" for dummies…
>>
>> One more thing: if I push the zip file, will it deflate on its own?
>>
>> In the Terminal I went to the work folder and did "git init" as
>> you suggested. Now, "ls -l" yields:
>>
>> drwxr-xr-x@ 10 bernardbel staff 340 29 sep 15:41 .git
>> -rw-r--r--@ 1 bernardbel staff 181679 22 jul 00:19 BP2_help.txt
>> -rw----r--@ 1 bernardbel staff 166 25 sep 09:54 compile.php
>> drwxr-xr-x@ 44 bernardbel staff 1496 29 sep 14:17 php
>>
>> What should I do next?
>>
>> I will also think about the structure you are discussing below. The
>> main point is that for the time being we are sharing a version of
>> the package designed to run under MAMP or a similar local server. The
>> next stage might be to install it as an on-line service, but
>> developers joining the project would still run their new versions on
>> local servers.
>>
>> So, until we have a standalone application (rendering the PHP
>> interface obsolete) the installation procedure will remain the one
>> described on top of https://bolprocessor.org/misc/BP3/CheckList.html.
>> The only complication is that both Anthony and I are delivering a
>> "bolprocessor" folder and their contents should be merged. As
>> you suggested, the console's folder could be named "console" and put
>> inside the "bolprocessor" folder at the same level as "php". I Anthony
>> agrees with this change, he may change the folder's name to "console"
>> or "bp_console" whatever…
>>
>> Bernard
>>
>> Rainer Schuetz wrote on 29/09/2020 14:19:
>>>
>>>
>>>> On 29. Sep 2020, at 06:53, Bernard Bel <ber...@gm...> wrote:
>>>>
>>>> So, when the whole project moves to GitHub you could take
>>>> the current version of the interface as an initial version.
>>>
>>> Okay!
>>>
>>>> I am now planning genuine developments such as running scripts via
>>>> the interface — i.e. translating their actions to commands sent
>>>> to the console. This will be worth following stepwise.
>>>
>>> Good! This feels to me like the ideal moment for you to start
>>> switching to the git workflow yourself - it would only require you to
>>> run “git init” in your development folder, create a
>>> Github account and push to it, Github even guides through the steps.
>>>
>>> But if you’re not comfortable jumping off right now: how about
>>> creating a Github account for you and I push to a repo there
>>> - ideally borrowing your identity temporarily, as that would
>>> allow commits to appear with proper authorship assignment. Once
>>> you’re happy to take over, you just need to “pull” into a new folder
>>> and can maintain things yourself. And pushing a commit is less work
>>> than creating an archive, uploading to a server and sending emails
>>> ;-) And once the organisation is created, the repo can be moved in
>>> with proper authorship-assignment and history as intended.
>>>
>>>> We will also need to figure out a procedure for sharing examples of
>>>> grammars, data, scripts etc. used for checking the software or
>>>> constructing tutorials. Up to now we use the "ctests" folder but it
>>>> is not systematic.
>>>
>>> Right, and when going “official” one might want to disentangle the
>>> interface and bp3 a bit more. Other than the php-interface, and
>>> ctests, one could also think about the help.txt and compile.php
>>> files. They’re special in that they are thought of as concerning bp
>>> as a whole rather than just the interface. So this is about how to
>>> split duties between bp3 and the php-interface. I’ve thought about
>>> this a bit in the past and found it quite tricky. Actually separating
>>> the php-interface and the bp-repo into separate sibling-folders might
>>> be an interesting experiment to see which unintended dependencies and
>>> hardcoded paths between both components slipped in. As to help-files,
>>> one could ask if bp3 should require the php-interface to be
>>> available, or if some text-only documentation could allow bp3 to
>>> display (some) help without it. Ideally the php-interface could
>>> access the bp3-binary/repo wherever it resides, and bp3 would
>>> not depend on the interface for anything essential. If the
>>> webserver requires the binary in the webspace of the php-interface,
>>> one might even think it intuitive to install bp3-console as a
>>> subdirectory of the php-interface rather than the opposite. I am
>>> still not clear on which requirements are given by security
>>> restrictions of the web-server, but there are other reasons why one
>>> might want the php-interface to be able to find bp3 in different
>>> folders/locations, e.g. multiple versions of a Bolprocessor binary
>>> required by different user files. One could also imagine binary and
>>> interface developing at different paces, so that multiple installs of
>>> both become a “nice to have”. (This issue is pretty thorny for
>>> SuperCollider, the binaries of which write configuration- and
>>> runtime-files to hardcoded system-locations by default. If for
>>> some reason you need multiple installs on your system, each
>>> overwrites the other's files. Creating “standalone” installs is not
>>> as trivial as it should be, and SC has become such a complex project
>>> that things are not easy to set straight any more).
>>>
>>> Best
>>> .r.
>
|