a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

Please add Git and Pandoc

Open ricardokl opened this issue 4 years ago • 23 comments

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!

ricardokl avatar Nov 06 '19 16:11 ricardokl

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).

holzschu avatar Dec 09 '19 21:12 holzschu

FYI Pandoc is also covered by the GPL.

somelinguist avatar Jan 06 '20 20:01 somelinguist

Good to know, thanks.

holzschu avatar Jan 06 '20 22:01 holzschu

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?

rmchale avatar Feb 18 '20 02:02 rmchale

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.

ricardokl avatar Feb 18 '20 16:02 ricardokl

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.

holzschu avatar Feb 18 '20 17:02 holzschu

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 avatar Apr 26 '20 10:04 ryanbooker

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

ryanbooker avatar Apr 26 '20 10:04 ryanbooker

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.

holzschu avatar Apr 26 '20 12:04 holzschu

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

ryanbooker avatar Apr 27 '20 01:04 ryanbooker

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

goerz avatar May 21 '20 18:05 goerz

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

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?

NightMachinery avatar Sep 07 '20 07:09 NightMachinery

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.

holzschu avatar Sep 07 '20 08:09 holzschu

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?

ricardokl avatar Nov 18 '20 12:11 ricardokl

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.

holzschu avatar Nov 18 '20 13:11 holzschu

Any update on the git command?

Emasoft avatar Mar 29 '22 18:03 Emasoft

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

holzschu avatar Mar 29 '22 18:03 holzschu

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 "[email protected]"
$
$ cat config
[core]
        bare = false
        repositoryformatversion = 0
        filemode = true
        precomposeunicode = true
        logallrefupdates = true
[user]
        name = Emasoft
        email = [email protected]
[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. :-(

Emasoft avatar Mar 29 '22 23:03 Emasoft

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 "[email protected]"
$
$ cat config
[core]
        bare = false
        repositoryformatversion = 0
        filemode = true
        precomposeunicode = true
        logallrefupdates = true
[user]
        name = Emasoft
        email = [email protected]
[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.

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?

Emasoft avatar Mar 30 '22 00:03 Emasoft

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.

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

suckerSlayer avatar Jun 13 '23 10:06 suckerSlayer