jingo icon indicating copy to clipboard operation
jingo copied to clipboard

Document list is empty

Open jradek opened this issue 8 years ago • 9 comments

If I go to Tools -> All Pages, a page with title 'Document list – Most recent updates shown first' opens but doesn't show any pages

jradek avatar May 10 '16 09:05 jradek

The list of documents in the demo site (which runs the latest version of jingo) works as expected though

http://jingo.cica.li/wiki

claudioc avatar May 10 '16 18:05 claudioc

Hi. I know it works on the demo server. That's why I noticed that is something wrong on my machine. See the attached screenshot. I have one simple page Home which doesn't show up in the document list.

I'm running jingo version 1.6.1 and my configuration is straight forward: I only set the Repository and enabled local authentication (disabled google).

jingo1

jradek avatar May 11 '16 08:05 jradek

OK, I cannot reproduce it (using a fresh 1.6 installation and a new repo on OSX).

Which version of git and OS are you using?

claudioc avatar May 16 '16 08:05 claudioc

My git version is git version 2.8.2.windows.1

on Windows 10 Pro (64bit) version 1511, build 10568.318.

BTW: I don't think git is the problem, because other git related commands in jingo work. E.g. I can browse the history of a page or compare the differences between two versions. Only the document list doesn't work.

I'm not an javascript expert and I don't even know the template engine 'jade', but I tried to solve the issue on my own and played with your code. IMHO the file views/list.jade is responsible to layout the document overview. There is a main loop

ul.doc-list
  each item in items
    li

and the items container seems so be empty (I don't know where and how it is/should be filled).

jradek avatar May 16 '16 14:05 jradek

Hi,

sorry for the delay. Unfortunately I have to say that Windows is not fully supported, meaning that I never tested or run Jingo on it. Supporting OSX and Linux is already complicated enough, and in my use cases I always thought of Jingo as something you run on some server, hence a unix based system.

Sorry about that.

claudioc avatar Jun 01 '16 20:06 claudioc

I had the same issue on Windows and in my case I isolated it to be because of the pattern matching in the git ls command. Removing "+ pattern" from the ls function in lib/gitmech.js made it work, but I did not find out how to make it work with the pattern on Windows.

devpab avatar Jun 02 '16 06:06 devpab

Thanks to @devpab insight, I was able to do this hack in my Windows setup:

https://github.com/fmalk/jingo/commit/3ef41672d97a1926e7b926a979b97369d87d2a7a

I don't think this is a good candidate for a PR right now, because I don't know how it'll affect OS X users like @claudioc . I also don't know how it affects people using docSubdir. But I do think we can iterate on this and merge eventually.

Explanation: It seems "All Pages" is trying to filter .MD files only by using: git ls-tree --name-only -r HEAD -- *.md But that doesn't work on Windows. What does work is: git ls-tree --name-only -r HEAD | grep .md Trying to maintain the wildcard *.md on Windows also didn't work, so I had to drop using pattern variable

fmalk avatar Jun 13 '16 21:06 fmalk

I'm also using Windows and @fmalk 's patch is working for me.

scytalezero avatar Aug 18 '16 14:08 scytalezero

I just ran into this issue and found a solution / work-around.

The problem for me originates with how gitCommands parses the gitDir and workTree variables when the path to my repository contains a space. Since neither gitDir nor therefore workTree add "..." quotations around the path, git --git-path ... does not parse properly whenever there is whitespace in a folder path. As a result, the method gitExec([ 'ls-tree', '--name-only', '-r', 'HEAD', '--', docSubdir + pattern ], function (err, data) { ... }) returns an empty string... ending up in gitmech.ls returning an empty array.

Unfortunately, gitCommands is a dependency for a number of other methods... most notably gitSpawn so I had to write a special variable into my gitmech.js called gitCommandsQuote in order to avoid breaking other methods as well as a method gitExecFix for just gitmech.ls to call. As a result, my code is quite hackish and would break with any update to my install.

rj919 avatar Jul 13 '18 16:07 rj919