Giter VIP home page Giter VIP logo

Comments (15)

Andr3as avatar Andr3as commented on June 24, 2024

Do you mean the terminal plugin from fluidbyte?

Could you run git status --branch --porcelain in this terminal?

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

Yes I did mean the terminal plugin.

git status --branch --porcelain
error: unknown option `branch'
usage: git status [options] [--] ...

-v, --verbose         be verbose
-s, --short           show status concisely
--porcelain           show porcelain output format
-z, --null            terminate entries with NUL
-u, --untracked-files[=<mode>]
                      show untracked files, optional modes: all, normal, no. (Default: all)

git --version
git version 1.7.1

from codiad-codegit.

Andr3as avatar Andr3as commented on June 24, 2024

Okay, I see the problem, I checked the reference and the option -b/--branch is only available since version 1.7.2. Are you able to update git?

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

I'll check with the host.

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

Ok, my host upgraded to 2.0.2 and now the plugin displays changes properly, thanks for that.

Next problem. If I try to commit, I get a "Failed Commit" error popup. Is there anyway to see what the error was? Any other ideas?

from codiad-codegit.

Andr3as avatar Andr3as commented on June 24, 2024

There is currently no way to see why a commit failed. I will think about a way to get this information.

Do you told git who you are? If not, use the settings of CodeGit to save these informations.

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

Whereabouts do I set this? The CodeGit settings prompt me for username and E-Mail.

from codiad-codegit.

Andr3as avatar Andr3as commented on June 24, 2024

Git requires an email address and an username to identify and mark your commits: Details: Git website. Even if they are fictitious.

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

There was already a username, I added an email and that seemed to help. I had some commits succeed. But most of them do still fail.

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

I'm doing some debugging and figured out that the problem is that a commit is getting called without an add first getting called.

Whereabouts does it call 'git add...' to stage the file prior to commit?

from codiad-codegit.

Andr3as avatar Andr3as commented on June 24, 2024

git add get immediately called before git commit, see init.js

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

Ok I finally made it all go, had to make some code changes though.

1: In init.js:add the this variable is getting corrupted, so changed to use the _this you already had

2: the JSON.stringify in init.js:add is escaping quotes with a '' character, which causes the json_decode in controller.php:add to fail, so strip them out prior

3: I also added an error condition to controller.php:add, as the fail was appearing as a success

Below is a diff:

diff /home/aohunga/tmp/Codiad-CodeGit-master/controller.php ./controller.php
68a69,70
>             $filelist = $_POST['files'];
>             $filelist = str_replace('\\', '', $filelist);
70c72
<                 $files = json_decode($_POST['files']);
---
>                 $files = json_decode($filelist);
72,76c74,82
<                 foreach($files as $file) {
<                     $result = !(!$result | !$git->add(getWorkspacePath($_GET['path']), $file));
<                 }
<                 if ($result) {
<                     echo '{"status":"success","message":"Files added"}';
---
>                 if ($files) {
>                    foreach($files as $file) {
>                        $result = !(!$result | !$git->add(getWorkspacePath($_GET['path']), $file));
>                    }
>                    if ($result) {
>                        echo '{"status":"success","message":"Files added"}';
>                    } else {
>                        echo '{"status":"error","message":"Failed add files!"}';
>                    }
78c84
<                     echo '{"status":"error","message":"Failed add files!"}';
---
>                    echo '{"status":"error","message":"Could not decode files to add \'' . $_POST['files'] . '\'!"}';
diff /home/aohunga/tmp/Codiad-CodeGit-master/init.js ./init.js
217c217
<             $.post(this.path + 'controller.php?action=add&path=' + path, {files : JSON.stringify(this.files)}, function(result){
---
>             $.post(this.path + 'controller.php?action=add&path=' + path, {files : JSON.stringify(_this.files)}, function(result){

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

Also multiple checkin wasn't working. To fix it changed class.git.php:add to

    public function add($path, $file) {
        if (!is_dir($path)) return false;
        $cwd = getcwd();
        chdir($path);
        $result = $this->executeCommand("git add " . $file);
        chdir($cwd);

        if ($result === 0) {
            return true;
        } else {
            return false;
        }
    }

from codiad-codegit.

Andr3as avatar Andr3as commented on June 24, 2024

Thanks for your bug hunting. I added your solution for the multiple checkin. But I can not reproduce your problems with JSON.stringify and this.files. Which browser do you use and on which files does this happen?

from codiad-codegit.

tekurinui avatar tekurinui commented on June 24, 2024

No problem :)

I'm on Chrome. I thought there must have been something environmental,
otherwise it never would have worked, which clearly is not the case.

Changing this.files to _this.files makes sense even if it is only a problem
in some environments right, because it will work in both cases?

I was checking in silverstripe template files. So they were pretty much
html with some php in them with a file extension of .ss. Again replacing
" with " should work because it will replace the slash delimiter if it
exists but leave it as is if it's not there.

Mauri Ora

Jeremy Banks

On 3 August 2014 03:00, Andr3as [email protected] wrote:

Thanks for your bug hunting. I added your solution for the multiple
checkin. But I can not reproduce your problems with JSON.stringify and
this.files. Which browser do you use and on which files does this happen?

β€”
Reply to this email directly or view it on GitHub
#8 (comment)
.

from codiad-codegit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.