Giter VIP home page Giter VIP logo

dugite's Introduction

GitHub Desktop is an open-source Electron-based GitHub app. It is written in TypeScript and uses React.

A screenshot of the GitHub Desktop application showing changes being viewed and committed with two attributed co-authors

Where can I get it?

Download the official installer for your operating system:

Linux is not officially supported; however, you can find installers created for Linux from a fork of GitHub Desktop in the Community Releases section.

Beta Channel

Want to test out new features and get fixes before everyone else? Install the beta channel to get access to early builds of Desktop:

The release notes for the latest beta versions are available here.

Community Releases

There are several community-supported package managers that can be used to install GitHub Desktop:

  • Windows users can install using winget c:\> winget install github-desktop or Chocolatey c:\> choco install github-desktop
  • macOS users can install using Homebrew package manager: $ brew install --cask github

Installers for various Linux distributions can be found on the shiftkey/desktop fork.

Is GitHub Desktop right for me? What are the primary areas of focus?

This document describes the focus of GitHub Desktop and who the product is most useful for.

I have a problem with GitHub Desktop

Note: The GitHub Desktop Code of Conduct applies in all interactions relating to the GitHub Desktop project.

First, please search the open issues and closed issues to see if your issue hasn't already been reported (it may also be fixed).

There is also a list of known issues that are being tracked against Desktop, and some of these issues have workarounds.

If you can't find an issue that matches what you're seeing, open a new issue, choose the right template and provide us with enough information to investigate further.

The issue I reported isn't fixed yet. What can I do?

If nobody has responded to your issue in a few days, you're welcome to respond to it with a friendly ping in the issue. Please do not respond more than a second time if nobody has responded. The GitHub Desktop maintainers are constrained in time and resources, and diagnosing individual configurations can be difficult and time consuming. While we'll try to at least get you pointed in the right direction, we can't guarantee we'll be able to dig too deeply into any one person's issue.

How can I contribute to GitHub Desktop?

The CONTRIBUTING.md document will help you get setup and familiar with the source. The documentation folder also contains more resources relevant to the project.

If you're looking for something to work on, check out the help wanted label.

Building Desktop

To setup your development environment for building Desktop, check out: setup.md.

More Resources

See desktop.github.com for more product-oriented information about GitHub Desktop.

See our getting started documentation for more information on how to set up, authenticate, and configure GitHub Desktop.

License

MIT

The MIT license grant is not for GitHub's trademarks, which include the logo designs. GitHub reserves all trademark and copyright rights in and to all GitHub trademarks. GitHub's logos include, for instance, the stylized Invertocat designs that include "logo" in the file title in the following folder: logos.

GitHub® and its stylized versions and the Invertocat mark are GitHub's Trademarks or registered Trademarks. When using GitHub's logos, be sure to follow the GitHub logo guidelines.

dugite's People

Contributors

adamsteen avatar anaisbetts avatar binarymuse avatar chriscn avatar daniel-mccarthy avatar dennisameling avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar greenkeeper[bot] avatar iamwillshepherd avatar joshaber avatar kittaakos avatar kuychaco avatar maifeeulasad avatar martinbenninger avatar mathieudutour avatar niik avatar outofambit avatar rafeca avatar richardo2016 avatar rudloff avatar ryancavanaugh avatar say25 avatar sergiou87 avatar shiftkey avatar theofficialgman avatar tidy-dev avatar ysabri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dugite's Issues

Are there any plans to have a more verbose model and command API in `dugite`?

Hi there,

I found the dugite library very useful, lightweight and convenient. I've read a thread why it is better to use dugite instead of using nodegit.

In the desktop code base, you have already implemented a lot of git commands with the corresponding models, which is awesome.

Unfortunately, I was unable to figure out a way to use them in my code. I assume it is not published to npm yet or I must be blind. Also, in some places, I can see UI dependency in the model code which should not harm for instance a backend application (that we are working on) but it does not either make much sense. So our plan is to create an npm package that contains dugite (as an upstream npm dependency) and the stripped down version of the commands and models you guys have been working. And redistribute it under MIT license.

Could you guys give me some feedback whether

  • it should be possible to reuse desktop commands and models in a downstream npm package. (Please note, we cannot have a dependency on electron.)
  • you have already planned to decouple the commands and model from the UI and redistribute them without the electron application.

Thanks for your effort so far and in advance for your feedback!

Android support

Hello,

When trying to install dugite on Android, I get this error:

yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⠠ dugite
[-/1] ⠐ waiting...
[-/1] ⠐ waiting...
[-/1] ⠐ waiting...
error /data/data/com.termux/files/home/node_modules/dugite: Command failed.
Exit code: 1
Command: node ./script/download-git.js
Arguments: 
Directory: /data/data/com.termux/files/home/node_modules/dugite
Output:
/data/data/com.termux/files/home/node_modules/dugite/script/config.js:32
  const index = pathName.lastIndexOf('/')
                         ^

TypeError: Cannot read property 'lastIndexOf' of null
    at getConfig (/data/data/com.termux/files/home/node_modules/dugite/script/config.js:32:26)
    at Object.<anonymous> (/data/data/com.termux/files/home/node_modules/dugite/script/download-git.js:11:35)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)

This is because process.platform == 'android'.

I don't expect you to provide an ARM Android binary but I understand we can use another Git binary with GIT_EXEC_PATH, so I guess the install script could just ignore the download (maybe with a warning) when on Android.

handle and propagate GH007 error

relevant Git output (with an exit code of 1)

...
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
remote: error: GH007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: http://github.com/settings/emails
...

Manual override environment variable

Support an environment variable that lets users override the bundled binaries with an external git binary that they've built elsewhere. This provides advanced users an escape hatch to use on older Linux distributions than we support, as opposed to them just being SOL.

We'd have to be careful to specify the git version we expect -- part of the benefit of using git-kitchen-sink is not having to worry about compatibility with older git versions, after all. Maybe include the git version in the environment variable name?

As suggested in desktop/dugite-native#13 (comment).

The Number Of Dependencies Is Too Damn High

The majority of dependencies this package needs are related to the postinstall script, rather than runtime. It'd be great if we could move that out to peerDependencies or something similar to make this clearer.

Compile embedded git with USE_LIBPCRE

I use a commit hook that does git grep -P, i.e. uses Perl regexps which is a compile time dependency. This works everywhere but Atom's git support, where it fails because that git is built without it.

It seems that just about everyone else compiles with pcre. Short list of git versions we use where this works:

  • Linux and Homebrew distributions
  • Github Desktop on Mac and Windows
  • Recent Apple versions (Apple Git-98). The system (xcode) git used to not have PCRE a while back (when it was an ancient 1.8.something) but it does as of High Sierra.
  • Official git-scm.org package for Mac

Having an embedded git, while convenient, should follow mainstream git as closely as possible in my opinion. And PCRE in turn is probably the "mainstream RE" these days and not some esoteric option.

I've taken to telling people who use Atom to simply remove the dugite git-core, forcing it to use system, but this seems sub-optimal if you guys are relying on the behaviors of a fixed version. Eliminating the grep -P is non-trivial.

Repo cloning error dialogue

Perhaps we can change the error dialogue to something more understandable to the layman? and do we need some validation on the url field? I entered some jiberish in the url field and got this:

33733870-ff4b191a-db3f-11e7-92f5-92d63e12b50f

33733867-ff1ce9dc-db3f-11e7-948a-9baa8f16140e

1.0.11-beta0, mac

related to: desktop/desktop#3539

provide a git process wrapper

This should:

  • be able to resolve Git
  • provide a simple promise-based interface - take in text, return text (or void)

npm install fails when behind a proxy

Installing the dugite package from npm fails on Windows. It works fine on Linux though.

It seams to be an error with how the checksum is being calculated in the download-git.js script. I have checked and the expected checksum matches what is posted on the dugite-native releases page.

Here is the console output when attempting to install v1.49.0

PS H:\> npm install dugite

> [email protected] postinstall H:\node_modules\dugite
> node ./script/download-git.js

Validation failed. Expected 'a54b64be0976c3f919a52d4dd6dcfb9434744072860df980767d662275a9f235' but got 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
Downloading Git from: https://github.com/desktop/dugite-native/releases/download/v2.15.0-rc1/dugite-native-v2.15.0-win32
-25.tar.gz
Error raised while downloading https://github.com/desktop/dugite-native/releases/download/v2.15.0-rc1/dugite-native-v2.1
5.0-win32-25.tar.gz { Error: connect ETIMEDOUT 192.30.253.113:443
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '192.30.253.113',
  port: 443 }
npm WARN enoent ENOENT: no such file or directory, open 'H:\package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./script/download-git.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\z0039cjb\AppData\Roaming\npm-cache\_logs\2017-11-17T08_36_18_434Z-debug.log

It also happens with v1.48.0

PS H:\test> npm install [email protected]

> [email protected] postinstall H:\test\node_modules\dugite
> node ./script/download-git.js

Validation failed. Expected 'db14ddc1281606b001a44b70f2fc3deda6e60686de06d135056205216c2a5663' but got 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
Downloading Git from: https://github.com/desktop/dugite-native/releases/download/v2.14.3-rc1/dugite-native-v2.14.3-win32
-23.tar.gz
Error raised while downloading https://github.com/desktop/dugite-native/releases/download/v2.14.3-rc1/dugite-native-v2.1
4.3-win32-23.tar.gz { Error: connect ETIMEDOUT 192.30.253.113:443
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '192.30.253.113',
  port: 443 }
npm WARN enoent ENOENT: no such file or directory, open 'H:\test\package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./script/download-git.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\z0039cjb\AppData\Roaming\npm-cache\_logs\2017-11-17T08_43_27_174Z-debug.log

I haven't tested with older versions.

I ran into this problem when installing the npm packages needed for GitHub Desktop on my Windows 7 x64 machine. I later tried this on my Ubuntu 17.10 x64 setup and it installed without errors.

Support streaming output in GitProcess

For commands that generate a lot of output, it is hard to anticipate an adequate buffer size. I think it would be cool if there was an equivalent spawn() method in GitProcess that worked like child_process.spawn and allowed reading unlimited output streams.

Update the delete branch error message for Protected branches

Attempting to delete a protected branch is blocked as expected. Perhaps we could make the error message a little more readable?

31897897-fb5c6192-b817-11e7-89a3-157e22627e10

repro:

  • make one of your dotcom branches protected (via settings)
  • try deleting it on Desktop

tested in v1.0.5beta0, mac

Logs in console:

install.ts:31 Executing checkRemoteBranchExistence: git -c credential.helper= ls-remote --heads origin dupe (took 1.363s)
install.ts:31 Executing deleteRemoteBranch: git -c credential.helper= push origin :dupe (took 2.324s)
install.ts:23 `git -c credential.helper= push origin :dupe` exited with an unexpected code: 1.
remote: error: GH006: Protected branch update failed for refs/heads/dupe.        
remote: error: Cannot delete a protected branch        
To https://github.com/tierninho-tester/trterdgdfgdf.git
 ! [remote rejected] dupe (protected branch hook declined)
error: failed to push some refs to 'https://github.com/tierninho-tester/trterdgdfgdf.git'
error @ install.ts:23
t.git @ core.ts:175```

Clean up the error message

When reverting a commit I got an error message that looks to include double "hints" even though it appears to be one sentence.

I believe it should read:

error: Reverting is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>',
as appropriate, to mark resolution and make a commit.
fatal: revert failed

Current error:
screen shot 2017-12-12 at 9 14 29 am

1.0.11-beta0, mac

Ref:
desktop/desktop#3579


It looks like this is coming from git itself:

https://github.com/git/git/blob/7668cbc60578f99a4c048f8f8f38787930b8147b/advice.c#L106-L107

https://github.com/git/git/blob/7668cbc60578f99a4c048f8f8f38787930b8147b/advice.c#L48-L65

So to customize this we'd need to parse this error in dugite.

Easier cross platform building

I'm doing some cross compilation stuff for GHD and the usage of process.platform at build time in https://github.com/desktop/dugite/blob/master/script/config.js isn't great for that.

JS/Node isn't my usual cup of tea so I might be doing something dumb here but this works! On GHD I just replaced all instances of process.platform with this:

function getTargetPlatform () {
  const platform = process.env.TARGET_PLATFORM || process.platform
  if(platform != 'darwin' && platform != 'win32') {
    console.error(`Exiting - I'm not set up to work on ${platform} yet! :(`)
    process.exit(1)
  }

  return platform
}

Which lets me build like: TARGET_PLATFORM=win32 npm run build:dev

Could we do something like that here as well or is there a better way to override process.platform?

[electron-builder] symlink issue when bundling dugite

I have problems when I am trying to bundle my electron application with dugite. I do not know whether this is a dugite issue or an electron-builder one.

I have forked a boilerplate electron application and added dugite as a dependency. It works as expected when I start the application from the source with: npm i && npm start.

The problem occurs when I am bundling it. As I see, ASAR does not handle symlinks properly, so I have configured "asar": false. When I am running my bundler task with npm run release, it does not fail but it logs the following error. Is it safe to just ignore it?

Unhandled rejection Error: ENOENT: no such file or directory, symlink 'git' -> '/Users/akos.kitta/Desktop/electron-boilerplate/dist/mac/Electron.app/Contents/Resources/app/node_modules/dugite/git/libexec/git-core/git-check-ignore'
    at /Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/util/appFileCopier.ts:70:38
From previous event:
    at /Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/util/appFileCopier.ts:70:21
    at Generator.next (<anonymous>)
    at xfs.mkdir.er (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:37:14)
    at FSReqWrap.oncomplete (fs.js:137:15)
From previous event:
    at copyAppFiles (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/out/util/appFileCopier.js:62:21)
    at taskManager.addTask.default.each.it (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/platformPackager.ts:238:86)
From previous event:
    at MacPackager.copyAppFiles (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/platformPackager.ts:238:43)
    at /Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/platformPackager.ts:186:10
    at Generator.next (<anonymous>)
    at runCallback (timers.js:785:20)
    at tryOnImmediate (timers.js:747:5)
    at processImmediate [as _immediateCallback] (timers.js:718:5)
From previous event:
    at MacPackager.doPack (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/out/platformPackager.js:267:11)
    at /Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/macPackager.ts:87:71
    at Generator.next (<anonymous>)
From previous event:
    at MacPackager.pack (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/out/macPackager.js:183:11)
    at /Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/packager.ts:260:24
From previous event:
    at Packager.doBuild (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/out/packager.js:332:11)
    at /Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/packager.ts:186:52
    at Generator.next (<anonymous>)
From previous event:
    at Packager.build (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/out/packager.js:261:11)
    at /Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/builder.ts:283:40
    at Generator.next (<anonymous>)
From previous event:
    at build (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/out/builder.js:63:21)
    at then (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/cli/cli.ts:49:4)
    at runCallback (timers.js:785:20)
    at tryOnImmediate (timers.js:747:5)
    at processImmediate [as _immediateCallback] (timers.js:718:5)
From previous event:
    at Object.args [as handler] (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/cli/cli.ts:49:4)
    at Object.runCommand (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/yargs/lib/command.js:228:22)
    at Object.parseArgs [as _parseArgs] (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/yargs/yargs.js:1041:24)
    at Object.get [as argv] (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/yargs/yargs.js:957:21)
    at Object.<anonymous> (/Users/akos.kitta/Desktop/electron-boilerplate/node_modules/electron-builder/src/cli/cli.ts:43:15)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Function.Module.runMain (module.js:653:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

Probably you have quite good experience with both electron and dugite after putting GitHub Desktop together, so I thought, it worth asking here.

Steps to reproduce:

mkdir electron-dugite-tmp \
&& cd electron-dugite-tmp \
&& git clone https://github.com/kittaakos/electron-boilerplate.git \
&& cd electron-boilerplate \
&& npm i \
&& npm run release 

Thank you!

repeatable Git builds for each platform

What

The ability to fire off Git builds from source for the platforms we currently support and generate standalone packages, wherever upstream binaries are unavailable.

No need to do this for Windows as Git for Windows publishes a 64-bit MinGit with each release.

How

To ensure repeatable builds, perhaps something like Docker images so that installed dependencies and flags to make are documented and version controlled.

Prior Art

It would be great to have tests that use an external Git executable

  • So one could run npm run test:external.
  • Running npm run test would run the external tests besides the fast and slow tests.
  • The external tests would be skipped if no Git executable could be discovered on the host system.
  • My plan is to add these tests under test/external.

handle and propagate pull with distinct histories

The repro is loosely related to initializing a repository with it's own commit, and then connecting it to a local repository with it's own distinct commit, and then trying to git pull.

$ git pull
error: unable to merge unrelated histories

Make this a first class error.

handling GitHub-specific server-side errors

  • error: GH001: Large files detected.
  • error: GH002: Sorry, branch or tag names consisting of 40 hex characters are not allowed.
  • error: GH003: Sorry, force-pushing to %s is not allowed.
  • error: GH005: Sorry, refs longer than %d bytes are not allowed.
  • error: GH006: Protected branch update failed for %d

Support FreeBSD

Currently dugite supports only 3 platforms(Windows, Linux and OSX). Requesting to support FreeBSD as well. I will submit a pull request if you guys are ready to incorporate.

don't set the GIT_SSL_CAINFO when an external Git is used

If you're using dugite on Linux but want to use an external Git, you won't have the dugite-native distribution and it's CA bundle available. This means this file might not exist on disk.

If a LOCAL_GIT_DIRECTORY is defined as per #85, we should not set GIT_SSL_CAINFO and instead assume the user has their GIT_SSL_CAINFO environment variable set to point to their own bundle.

document packaging steps

Relates to #43

Goals:

  • script the packaging step for macOS so that you can generate a new Git archive with checksum
  • script the packaging step for Ubuntu so that you can generate a new Git archive with checksum
  • drop those into repository, publish artefacts somewhere
  • document how versioning works and fix it where it doesn't make sense

Include captures in parsed errors

Some of our error regexes include captures, but they aren't actually passed up and out to consumers. We should do that, though it'll require some refactoring of errors.

How to use `dugite` with the locally available and configured git executable?

I am trying to use dugite with the local git executable if available, if not, simply fall back to the one shipped with your library.

I already have some logic that tries to locate the executable. Let assume, it works correctly on all platforms, and it returns with /usr/local/bin/git in my case. When I set the executable path to the LOCAL_GIT_DIRECTORY environment variable, then the resolveGitBinary function in the git-environment module appends the bin/git to the path. The execution obviously fails, because git is not available under /usr/local/bin/git/bin/git.

Is there a way to avoid doing that? It would be great, to have an option to set a LOCAL_GIT_PATH variable too (or something similar), and if that is present, use that without any modifications. Or did I completely misunderstand how to configure and use a custom git executable from dugite?

Any feedbacks are much appreciated! Cheers.

Embeded git's low performance

Is there any plan to improve emebed git's excute performance especially on windows system ?
It runs too slowlier rather than the git version which installed locally.

Perl files aren't writeable

So I figured out why updates are broken.

On macOS, we have to remove a quarantine attribute from newly downloaded files. That requires that the files be owner-writable.

But it turns out the following files aren't writable, for whatever reason. They were in a previous version of git-kitchen-sink, but no mas.

git/lib/perl5/site_perl/Git/I18N.pm
git/lib/perl5/site_perl/Git/IndexInfo.pm
git/lib/perl5/site_perl/Git/SVN/Editor.pm
git/lib/perl5/site_perl/Git/SVN/Fetcher.pm
git/lib/perl5/site_perl/Git/SVN/GlobSpec.pm
git/lib/perl5/site_perl/Git/SVN/Log.pm
git/lib/perl5/site_perl/Git/SVN/Memoize/YAML.pm
git/lib/perl5/site_perl/Git/SVN/Migration.pm
git/lib/perl5/site_perl/Git/SVN/Prompt.pm
git/lib/perl5/site_perl/Git/SVN/Ra.pm
git/lib/perl5/site_perl/Git/SVN/Utils.pm
git/lib/perl5/site_perl/Git/SVN.pm
git/lib/perl5/site_perl/Git.pm

So at minimum, we need to chmod these files so they're writable. But I'm wondering if we even need these? It kinda looks like they're a Perl API that we wouldn't care about. So maybe we can just throw a NO_PERL=1 on the build script?

@shiftkey 💰 for your thoughts?

How does the library resolve the the git executable when not given in env vars?

So I have been wondering how does dugite resolve the the git executable path.

From what I have seen in the code; if given, it uses either the GIT_EXEC_PATH or the LOCAL_GIT_DIRECTORY, which after reading the documentation I am not sure what is the difference between them?

My problem is when the library is not given any of the above vars, how does it resolve the git executable path?

I am wondering this, because when I included the library in my app and ran git config --list both my email and name were configured already. How does this happen if dugite is using its own installation of git? What happens if there is no local install of git because as far as I know git won't commit without a name and email setup. Thanks!

Git clone results in "fatal: Unable to find remote helper for 'https'" when using a local git executable

... and it works as expected both when I use the executable with dugite and when I use child_process. Maybe it is not the appropriate channel to ask for help, but I was unable to clone any public repositories (without required authentication) when I set the LOCAL_GIT_DIRECTORY environment variable. Does anyone have a pointer what am I doing wrong? Any help would be greatly appreciated.

Here a very stupid simple module that does the cloning with both dugite and with the child_process.

index.js

const fs = require('fs');
const path = require('path');
const gp = require('dugite').GitProcess;
const cp = require('child_process');


getVersionWithDugite();
cloneWithDugite('https://github.com/desktop/dugite.git');

process.env.LOCAL_GIT_DIRECTORY = '/usr/local/';

getVersionWithDugite();
cloneWithDugite('https://github.com/desktop/what-the-changelog.git');

getVersionWithChildProcess();
cloneWithChildProcess('https://github.com/desktop/dugite-native.git');


function getVersionWithDugite() {
    gp.exec(['--version']).then(result => {
        console.log("_____________________");
        console.log("OUT", result.stdout.trim());
        console.log("ERR", result.stderr.trim());
        console.log("_____________________");
    });
}

function cloneWithDugite(url) {
    gp.exec(['clone', url]).then(result => {
        console.log("_____________________");
        console.log("OUT", result.stdout.trim());
        console.log("ERR", result.stderr.trim());
        console.log("_____________________");
    });
}

function getVersionWithChildProcess() {
    cp.execFile('/usr/local/bin/git', ['--version'], (error, stdout, stderr) => {
        console.log('stdout', stdout)
        console.log('stderr', stderr)
    });
}

function cloneWithChildProcess(url) {
    cp.execFile('/usr/local/bin/git', ['clone', url], (error, stdout, stderr) => {
        console.log('stdout', stdout)
        console.log('stderr', stderr)
    });
}

package.json

{
  "name": "dugite-clone",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "kittaakos <[email protected]>",
  "license": "ISC",
  "dependencies": {
    "dugite": "^1.39.0"
  }
}

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.