holzschu / a-shell

A terminal for iOS, with multiple windows
BSD 3-Clause "New" or "Revised" License
2.69k stars 117 forks source link

Please add Git and Pandoc #10

Open ricardokl opened 4 years ago

ricardokl commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

FYI Pandoc is also covered by the GPL.

holzschu commented 4 years ago

Good to know, thanks.

rmchale commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

ryanbooker commented 4 years ago

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

goerz commented 4 years ago

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 commented 4 years ago

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

NightMachinery commented 4 years ago

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 commented 4 years ago

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

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

ricardokl commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

Any update on the git command?

holzschu commented 2 years ago

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

Emasoft commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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