Iceberg for files other than code?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Iceberg for files other than code?

khinsen
Hi everyone,

Is it possible to read and modify files not containing Pharo code in a
repository managed by Iceberg? I am thinking of reading the repository's
README file, for example, or storing data files read by my code
alongside the code itself.

Konrad.

Reply | Threaded
Open this post in threaded view
|

Re: Iceberg for files other than code?

Christopher Fuhrman-3
Hi Konrad,

On Sat, 6 Apr 2019 at 15:46, Konrad Hinsen <[hidden email]> wrote:
Hi everyone,

Is it possible to read and modify files not containing Pharo code in a
repository managed by Iceberg? I am thinking of reading the repository's
README file, for example, or storing data files read by my code
alongside the code itself.

I'm not sure if you are referring to GitHub's README, but if you are, I maintain my project's README on GitHub's web site (which requires care if you're using branches). I like the markdown preview there which requires no fancy software installed on my PC. You need to pull the change to Iceberg.

There's indeed a copy of the README.md in my image's pharo-local/iceberg/GITHUBUSERNAME/GITHUBPROJECT directory, and I can even modify it using Pharo 7's File Browser. However, any modifications to it are not seen or committed by Iceberg (at least I don't know of a way to make that happen). I believe Iceberg's change detection is limited to the smalltalk files in the packages that are in the repositories it knows about. But I'm still far from an expert with this. Hopefully a more qualified person can confirm.

There's theoretically a way to run a git client outside of Pharo that knows about the local git repo that Iceberg's using, so maybe you can commit the non-Pharo files that way. However, doing that is sure to cause a "detached" state with the repo in the image. That is not a catastrophic problem, but it's more accidental complexity to deal with. I picked my battles and maintain README on GitHub.

Christopher


Konrad.



--
Christopher Fuhrman, P.Eng, PhD
Professor in the Département of Software and IT Engineering
ÉTS (École de technologie supérieure)

http://profs.etsmtl.ca/cfuhrman
+1 514 396 8638
L'ÉTS est une constituante de l'Université du Québec
Confidentiality Notice
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [hidden email]. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
Avis de confidentialité
L'information contenue dans ce message électronique ainsi que dans les fichiers qui peuvent y être attachés est de nature confidentielle et destinée à l'usage exclusif du destinataire. Si ce message vous est parvenu par erreur ou que vous n'êtes pas le destinataire visé, vous êtes par la présente avisé que tout usage, copie ou distribution de l'information contenue dans ce message est strictement interdit et vous êtes prié d'en aviser [hidden email] et de détruire ce message. 
Reply | Threaded
Open this post in threaded view
|

Re: Iceberg for files other than code?

Tim Mackinnon
My understanding is that at the moment commits are restricted to what’s I the designated src directory, so you need to use an external way to commit non code files into your branch. These can be
1. Git cmd line
2. Another tool like IntelliJ 
3. The github web bowser

If you do, you need to pull or merge in Pharo to keep things in sync.

I also hope one day we might widen the scope to commit more things directly in Pharo - particularly the readme ir other config files (I gave the same problem with exercism )

Tim

Sent from my iPhone

On 6 Apr 2019, at 22:45, Christopher Fuhrman <[hidden email]> wrote:

Hi Konrad,

On Sat, 6 Apr 2019 at 15:46, Konrad Hinsen <[hidden email]> wrote:
Hi everyone,

Is it possible to read and modify files not containing Pharo code in a
repository managed by Iceberg? I am thinking of reading the repository's
README file, for example, or storing data files read by my code
alongside the code itself.

I'm not sure if you are referring to GitHub's README, but if you are, I maintain my project's README on GitHub's web site (which requires care if you're using branches). I like the markdown preview there which requires no fancy software installed on my PC. You need to pull the change to Iceberg.

There's indeed a copy of the README.md in my image's pharo-local/iceberg/GITHUBUSERNAME/GITHUBPROJECT directory, and I can even modify it using Pharo 7's File Browser. However, any modifications to it are not seen or committed by Iceberg (at least I don't know of a way to make that happen). I believe Iceberg's change detection is limited to the smalltalk files in the packages that are in the repositories it knows about. But I'm still far from an expert with this. Hopefully a more qualified person can confirm.

There's theoretically a way to run a git client outside of Pharo that knows about the local git repo that Iceberg's using, so maybe you can commit the non-Pharo files that way. However, doing that is sure to cause a "detached" state with the repo in the image. That is not a catastrophic problem, but it's more accidental complexity to deal with. I picked my battles and maintain README on GitHub.

Christopher


Konrad.



--
Christopher Fuhrman, P.Eng, PhD
Professor in the Département of Software and IT Engineering
ÉTS (École de technologie supérieure)

http://profs.etsmtl.ca/cfuhrman
+1 514 396 8638
L'ÉTS est une constituante de l'Université du Québec
Confidentiality Notice
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [hidden email]. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
Avis de confidentialité
L'information contenue dans ce message électronique ainsi que dans les fichiers qui peuvent y être attachés est de nature confidentielle et destinée à l'usage exclusif du destinataire. Si ce message vous est parvenu par erreur ou que vous n'êtes pas le destinataire visé, vous êtes par la présente avisé que tout usage, copie ou distribution de l'information contenue dans ce message est strictement interdit et vous êtes prié d'en aviser [hidden email] et de détruire ce message. 
Reply | Threaded
Open this post in threaded view
|

Re: Iceberg for files other than code?

khinsen
In reply to this post by Christopher Fuhrman-3
Hi Christopher and Tim,

Thanks for your comments!

I agree that managing the README from Pharo is not the most important
use case, I just mentioned it because everyone know what a README is.

A better example of what I want to do is Pharo's Help system. It stores
the individual pages as methods that return a literal string. That's one
way to store data in a package but it looks like a kludge. More
importantly, it is very difficult to use or edit the pages outside of
Pharo.

A better way to do something like that is to store pages as plain text
in the same repository as the classes that use them. But that requires
that the class can access the files as "file xx/yy/zz.txt in the same
repository from which my code was loaded". And if the class modifies the
text file, that change must be committed somehow.

I suspect that the read access part is doable somehow. The repository
checkout in pharo-local contains all the files, so it's just a matter of
figuring out the path. It's committing changes that requires some
support from Iceberg, which you says is not available if I understand
correctly.

Konrad

Reply | Threaded
Open this post in threaded view
|

Re: Iceberg for files other than code?

Tim Mackinnon
Hi Konrad - I think you can do what you describe - I think the ICeRepository entry for your project will have the path you want.

And yes, its the committing back non source files where iceberg doesn’t try to do anything (and so needs help from elsewhere).

Tim

> On 7 Apr 2019, at 16:40, Konrad Hinsen <[hidden email]> wrote:
>
> Hi Christopher and Tim,
>
> Thanks for your comments!
>
> I agree that managing the README from Pharo is not the most important
> use case, I just mentioned it because everyone know what a README is.
>
> A better example of what I want to do is Pharo's Help system. It stores
> the individual pages as methods that return a literal string. That's one
> way to store data in a package but it looks like a kludge. More
> importantly, it is very difficult to use or edit the pages outside of
> Pharo.
>
> A better way to do something like that is to store pages as plain text
> in the same repository as the classes that use them. But that requires
> that the class can access the files as "file xx/yy/zz.txt in the same
> repository from which my code was loaded". And if the class modifies the
> text file, that change must be committed somehow.
>
> I suspect that the read access part is doable somehow. The repository
> checkout in pharo-local contains all the files, so it's just a matter of
> figuring out the path. It's committing changes that requires some
> support from Iceberg, which you says is not available if I understand
> correctly.
>
> Konrad
>


Reply | Threaded
Open this post in threaded view
|

Re: Iceberg for files other than code?

khinsen
Hi Tim,

> Hi Konrad - I think you can do what you describe - I think the
> ICeRepository entry for your project will have the path you want.

Indeed. Here's how to get the repository for class MyClass:

  repo := IceRepository registeredRepositoryIncludingPackage: MyClass
package.

And then the path ist just

  repo location.

> And yes, its the committing back non source files where iceberg
> doesn’t try to do anything (and so needs help from elsewhere).

From what I saw so far it looks possible to change a file and do a
commit from Pharo code, bypassing the Iceberg UI. For some uses that
may be OK.

Konrad.