Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add Git and Pandoc #10

Open
ricardokl opened this issue Nov 6, 2019 · 23 comments
Open

Please add Git and Pandoc #10

ricardokl opened this issue Nov 6, 2019 · 23 comments

Comments

@ricardokl
Copy link

Couldn't install vim plugins with Vim-Plug, maybe because of missing git?
Yes I could try pathogen, I will, but Git seems somewhat important to have.

Thanks for the work in the app, it is amazing!

@holzschu
Copy link
Owner

holzschu commented Dec 9, 2019

git is covered by the GPL, making it incompatible with AppStore rules. The WorkingCopy App has a functional git system (and a great user interface).

@somelinguist
Copy link

FYI Pandoc is also covered by the GPL.

@holzschu
Copy link
Owner

holzschu commented Jan 6, 2020

Good to know, thanks.

@rmchale
Copy link

rmchale commented Feb 18, 2020

That’s means git could not be packaged in a-shell. But perhaps there’s a way it could be installed by the user?

Are you saying I can access files downloaded from working copy in a-shell?

@ricardokl
Copy link
Author

I no longer have an ipad to test the app.... but thank you very much for the answer.
Perhaps then some integration with working copy could help? Or as rmchale sugested, the user could download and install somehow.

@holzschu
Copy link
Owner

Are you saying I can access files downloaded from working copy in a-shell?

Yes. The command "pickFolder" lets you access any folder in any app on your iPad (or iPhone). You have to click on the folder (so it's not automatic), but once you've done it, you are inside with all writing and reading permissions. That includes the right to erase everything with "rm -rf *", so be careful.

Once you have accessed a folder in another app, a-Shell keeps the permission, and you can access it faster with "jump + name of the folder". Use "showmarks" for a list of folders.

But perhaps there’s a way it could be installed by the user?

Yes, I could do that. Users can sideload anything they want, so a user with a Mac could add git to a-Shell. I'll think about it.

@ryanbooker
Copy link

Documents/bin appears to be in the path, but after adding a copy of git From my Mac to that folder, a-shell still couldn’t find it.

@ryanbooker
Copy link

ryanbooker commented Apr 26, 2020

I believe this is because PATH has:

/var/mobile/Containers/Data/Application/<APPID>/Documents/bin

rather than

/private/var/mobile/Containers/Data/Application/<APPID>/Documents/bin

@holzschu
Copy link
Owner

I check for both. However, what I mean by sideloading is:

  • compile git for iOS (using a cross-compiler)
  • make it a dynamic library
  • add this dynamic library to the a-Shell project
  • compile the a-Shell project
  • install the result to your iPad
    This is not an easy process; step 1 might be especially difficult.

@ryanbooker
Copy link

Ah. Makes more sense. I was wondering "Hmm. Is iOS really just going to use a macOS binary?" :)

@goerz
Copy link

goerz commented May 21, 2020

I wonder whether it might be feasible to use the pure-python gittle (or dulwich directly) to write a "fake" git executable providing the minimal requirements for the various vim plugins that rely on git, such as git-gutter and maybe even fugitive

@personalizedrefrigerator
Copy link
Contributor

personalizedrefrigerator commented Aug 5, 2020

@goerz It looks like it is, but I'm not sure if it satisfies the requirements for vim plugins... See #56.

@NightMachinery
Copy link

I check for both. However, what I mean by sideloading is:

  • compile git for iOS (using a cross-compiler)
  • make it a dynamic library
  • add this dynamic library to the a-Shell project
  • compile the a-Shell project
  • install the result to your iPad
    This is not an easy process; step 1 might be especially difficult.

Is it necessary that a-shell be recompiled? Can’t git be made available as a downloadable binary?

@holzschu
Copy link
Owner

holzschu commented Sep 7, 2020

iOS will only execute a binary or load a dynamic library if both conditions are met:

  • it is signed, with a signature specific to the application and device (computed at install time)
  • it is in a specific directory ($APPDIR/Frameworks/). That directory can only be accessed at install time.

Which is what makes adding binaries to applications so difficult. The only exception I know of is for webAssembly binaries.

@ricardokl
Copy link
Author

Back to this issue: If there's a GPL issue with the appstore, how the workingcopy app does it? Is it their own implementation of git?

@holzschu
Copy link
Owner

WorkingCopy uses libgit2, which has a different license... but no command line tool. https://github.com/libgit2/libgit2
(so there's been a lot of work on making the client interface). I heard there were developing a command line tool, which would change the situation.

@Emasoft
Copy link

Emasoft commented Mar 29, 2022

Any update on the git command?

@holzschu
Copy link
Owner

We now have the lg2 command, which is a git clone, but without the licensing issues. It's based on libgit2.

@Emasoft
Copy link

Emasoft commented Mar 29, 2022

I have troubles using lg2... it behaves quite differently from git..

$ lg2 config --list --show-origin
Unable to open repository '%s' '.' [-3] - could not find repository from '.'

$ lg2 config --global user.name "Emasoft"
Unable to open repository '%s' '.' [-3] - could not find repository from '.'

$ lg2 config --global init.defaultBranch main
Unable to open repository '%s' '.' [-3] - could not find repository from '.'

When I try to init an empty folder, it works:

$ lg2 init ./my_project
Initialized empty Git repository in /private/var/mobile/Containers/Data/Application/
57D0B943-BFE9-4312-A6A7-78E47884B6A8/Documents/repositories/my_project/

$ ls -al
total 0
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:23 .
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:22 ..
drwxr-xr-x  9 mobile  mobile  288 Mar 30 01:23 .git
$
$ cd .git
$ ls -al
total 24
drwxr-xr-x  9 mobile  mobile  288 Mar 30 01:44 .
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:23 ..
-rw-r--r--  1 mobile  mobile   23 Mar 30 01:23 HEAD
-rw-r--r--  1 mobile  mobile  204 Mar 30 01:44 config
-rw-r--r--  1 mobile  mobile   73 Mar 30 01:23 description
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:23 hooks
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:23 info
drwxr-xr-x  4 mobile  mobile  128 Mar 30 01:23 objects
drwxr-xr-x  4 mobile  mobile  128 Mar 30 01:23 refs
$ 
$ lg2 config user.name "Emasoft"
$ lg2 config user.email "fmuaddib@gmail.com"
$
$ cat config
[core]
        bare = false
        repositoryformatversion = 0
        filemode = true
        precomposeunicode = true
        logallrefupdates = true
[user]
        name = Emasoft
        email = fmuaddib@gmail.com
[init]
        defaultBranch = my_project
$ 
$ lg2 config --list --show-origin
Unable to set configuration: invalid config item name '--list'
$
$ lg2 config --global --list --show-origin
USAGE: lg2 config <KEY> [<VALUE>]
    This repository's configuration file should be located at /private/var/mobile/Co
ntainers/Data/Application/57D0B943-BFE9-4312-A6A7-78E47884B6A8/Documents/repositorie
s/my_project/.git/config
    To update global configurations, try editing ~/Documents/.gitconfig.
$
$ lg2 config --global init.defaultBranch my_project
USAGE: lg2 config <KEY> [<VALUE>]
    This repository's configuration file should be located at /private/var/mobile/Co
ntainers/Data/Application/57D0B943-BFE9-4312-A6A7-78E47884B6A8/Documents/repositorie
s/my_project/.git/config
    To update global configurations, try editing ~/Documents/.gitconfig.

But unfortunately no such file (~/Documents/.gitconfig) exists. :-(

@personalizedrefrigerator
Copy link
Contributor

I have troubles using lg2... it behaves quite differently from git..

$ lg2 config --list --show-origin
Unable to open repository '%s' '.' [-3] - could not find repository from '.'

$ lg2 config --global user.name "Emasoft"
Unable to open repository '%s' '.' [-3] - could not find repository from '.'

$ lg2 config --global init.defaultBranch main
Unable to open repository '%s' '.' [-3] - could not find repository from '.'

When I try to init an empty folder, it works:

$ lg2 init ./my_project
Initialized empty Git repository in /private/var/mobile/Containers/Data/Application/
57D0B943-BFE9-4312-A6A7-78E47884B6A8/Documents/repositories/my_project/

$ ls -al
total 0
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:23 .
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:22 ..
drwxr-xr-x  9 mobile  mobile  288 Mar 30 01:23 .git
$
$ cd .git
$ ls -al
total 24
drwxr-xr-x  9 mobile  mobile  288 Mar 30 01:44 .
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:23 ..
-rw-r--r--  1 mobile  mobile   23 Mar 30 01:23 HEAD
-rw-r--r--  1 mobile  mobile  204 Mar 30 01:44 config
-rw-r--r--  1 mobile  mobile   73 Mar 30 01:23 description
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:23 hooks
drwxr-xr-x  3 mobile  mobile   96 Mar 30 01:23 info
drwxr-xr-x  4 mobile  mobile  128 Mar 30 01:23 objects
drwxr-xr-x  4 mobile  mobile  128 Mar 30 01:23 refs
$ 
$ lg2 config user.name "Emasoft"
$ lg2 config user.email "fmuaddib@gmail.com"
$
$ cat config
[core]
        bare = false
        repositoryformatversion = 0
        filemode = true
        precomposeunicode = true
        logallrefupdates = true
[user]
        name = Emasoft
        email = fmuaddib@gmail.com
[init]
        defaultBranch = my_project
$ 
$ lg2 config --list --show-origin
Unable to set configuration: invalid config item name '--list'
$
$ lg2 config --global --list --show-origin
USAGE: lg2 config <KEY> [<VALUE>]
    This repository's configuration file should be located at /private/var/mobile/Co
ntainers/Data/Application/57D0B943-BFE9-4312-A6A7-78E47884B6A8/Documents/repositorie
s/my_project/.git/config
    To update global configurations, try editing ~/Documents/.gitconfig.
$
$ lg2 config --global init.defaultBranch my_project
USAGE: lg2 config <KEY> [<VALUE>]
    This repository's configuration file should be located at /private/var/mobile/Co
ntainers/Data/Application/57D0B943-BFE9-4312-A6A7-78E47884B6A8/Documents/repositorie
s/my_project/.git/config
    To update global configurations, try editing ~/Documents/.gitconfig.

But unfortunately no such file (~/Documents/.gitconfig) exists. :-(

At present, ~/Documents/.gitconfig needs to be edited with an editor like ViM.

@Emasoft
Copy link

Emasoft commented Mar 30, 2022

At present, ~/Documents/.gitconfig needs to be edited with an editor like ViM.

I tried to create the file, but it still says the same thing. Maybe there is some specific content that is looking for inside the .gitconfig?

@personalizedrefrigerator
Copy link
Contributor

At present, ~/Documents/.gitconfig needs to be edited with an editor like ViM.

I tried to create the file, but it still says the same thing. Maybe there is some specific content that is looking for inside the .gitconfig?

lg2 config --global isn't implemented yet. All changes to the global .gitconfig must be done using a text editor. If you have experience working with C, you may want to contribute to lg2 here.

@suckerSlayer
Copy link

Any progress on Pandoc implementation? Looking forward to it ^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants