Giter Site home page Giter Site logo

mathieudutour / git-sketch-plugin Goto Github PK

View Code? Open in Web Editor NEW
2.4K 60.0 127.0 4.78 MB

:gem::octocat: A Git client generating pretty diffs built right into Sketch.

Home Page: https://mathieudutour.github.io/git-sketch-plugin

License: MIT License

JavaScript 93.59% CSS 4.36% HTML 2.06%
sketch-plugin sketch git

git-sketch-plugin's Introduction

This plugin was a first attempt to bring version control and collaboration to designers. Since then, Sketch evolved a lot and my new project takes advantages of them to unlock true version control. Check it out: http://kactus.io


git-sketch-plugin

GitHub release GitHub release

A Git client built right into Sketch. Generate pretty diffs so that everybody knows what are the changes!

From ... Ugly

... To Pretty

screen cast

Requirements

Installation

From a release (simplest)

  • Download the latest release of the plugin
  • Un-zip
  • Double-click on Git.sketchplugin

From the sources

  • Clone the repo
  • Install the dependencies (npm install)
  • Build (npm run build)
  • Double-click on Git.sketchplugin

Documentation

For a Getting started guide, FAQ, etc. check out our docs!

Want to contribute?

Anyone can help make this project better - check out our Contributing guide!

git-sketch-plugin's People

Contributors

dependabot[bot] avatar greymechanic avatar griffin-stewie avatar grrtbrtr avatar loklaan avatar mathieudutour avatar mattjbray avatar philschatz avatar tomonari-t avatar willdurand avatar yuchuanxi 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  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

git-sketch-plugin's Issues

Plugin installed but not working on Sketch 3.8.2

Hi,

I just installed this plugin on my Sketch version 3.8.2 but I keep getting an error message on every action the plugin allows me to do (e.g. init the repo).

{
    column = 37;
    line = 37;
    sourceURL = "/Users/pascal/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/Init.cocoascript";
}

iTerm

Hey would it be possible to make the "Open Terminal" feature open in iTerm 2?

I appreciate the response.

git-lfs: command not found

I’m getting an error when I try to commit, it’s something to do with git-lfs but I don’t fully understand what it means.

  • I ran the git lfs install && git lfs track '*.png' && git lfs track '*.sketch' && git add .gitattributes at the before trying to commit anything.
  • I made some changes to the names of my Artboards
  • I saved
  • I committed using the Git plugin UI
  • I then got this message:

capture d ecran 2016-03-07 a 11 40 57

git-lfs clean '.exportedArtboards/Jellyfish/1-Dashboard.png': git-lfs: command not found error: external filter git-lfs clean 0.000000 failed -1 error: external filter git-lfs clean 0.000000 failed fatal: .exportedArtboards/Jellyfish/1-Dashboard.png: clean filter 'lfs' failed

Any idea what’s causing the error? I don’t understand why it says git-lfs: command not found when I got the Git LFS initialized. message after running the git lfs install command.

Unsure how to point this plug-in at an existing repo

After installing the plug-in, and following the first setup step, I am faced with an error. Something about the remote origin already existing (which is definitely not the case). I'd much rather just create a repo myself, clone, and then point git-sketch-plugin at the directory that houses my cloned repo. How can I accomplish this?

Git Push Failed

Received this message when using the Push tool. Although this is not a blocker since I can just push via command line. Great tool, ty!
–––
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The current branch git-diff-test has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin git-diff-test

Error on Commit when using NVM and AVN

My guess is the plugin is CDing to the directory and avn is being activated to change the node version, the plugin is receiving the output of this as feedback from the commit and assuming it has failed because it's not what it was expecting.

screen shot 2016-05-26 at 09 44 52

Tutorial

Probably not an issue per se, but is there a manual for people who're not well-versed with git?

  • where does 'init-repo' push to?
  • where does 'push' go to? Is it using my git account if i'm logged in on www?
  • how does the creating pngs for diffs work – how do I view them?
  • troubleshooting

thanks for your time

update file when switching branch

when switching branches, the file doesn't update.

The bug has been reported to the customer service of Bohemian Coding.

Meanwhile, we can probably manually trigger a reopening of the file when switching.

Failed to init

Hello - I get the error pasted below after installing the plugin and attempting to Init the repo
Plugins > Git > Advanced > Init git repo
I use Sketch v3.8.3
{
column = 23;
line = 61;
sourceURL = "/Users/USER/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/Init.cocoascript";
}

bitbucket write to stderr on push

Really loving this tool, but I'm having an issue, that is only kind of an issue - after committing and writing notes, I then hit push and I always receive this error, but the thing is, it actually does push the file. Or it seems to be reflected in the online repo.

screen shot 2016-02-04 at 12 06 21 pm

ps. the blurred text is the repo and branch url. I'm using bitbucket, but I dont think that makes a difference, does it?

Info: Sketch 3.5.1 w/ latest sketchtool.

Cannot be used within an App Sandbox

When I try to run any of the actions in the plugin menu I get the following error:

xcrun error: cannot be used within an App Sandbox.

Is there a fix or workaround for this?

Error when generating files for pretty diff

When generating pretty diffs a Failed... error message pops up, and no commit on the repository is performed.

Steps to reproduce

Commiting

  • Edit/add a sketch file in a git repository
  • Show commit prompt via Plugins > Git > Commit
  • Generate files for pretty diffs is ticked
  • Enter commit message, hit `Commit``
Direct Invocation
  • Plugins > Git > Generate files for pretty diffs

Error message:

*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: 
attempt to insert nil object from objects[3]
((null) ECCommandLineDomain:5)

Used versions:

❯ chest list
(git)   git-sketch-plugin bb101a3bbc77947bb7c6890b5c4600b962b43bf9

❯ sketchtool -v
sketchtool Version 3.5.2 (25235)

Suggestion: Add minimal how-to in README for git lfs

When available, .png and .sketch should be tracked by git lfs.

This should be as easy as doing the following steps:

  1. Install git lfs onto your system
  2. git lfs install inside of your repo
  3. git lfs track "*.png" & git lfs track "*.sketch" inside of your repo

It should also be noted that your remote needs to have git lfs support.

This info is by no means critical to using this plugin, but it aids in maintaining a healthy git repo.

Ignore pages

It would be great if we could ignore a whole page instead of just artboards. Eg: Research pages.

Commit Error: resources.bundle doesn't exist?

Testing out the plugin. I first got an error that it couldn't find the sketchtool files so I installed it via terminal. Now I get this error. I'm guessing it's user error but I'm not sure what am I doing wrong here?

Thanks in advance for the help!!

screen shot 2016-05-20 at 3 46 42 pm

Unable to commit

How did it happen?

  1. ctrol + alt + cmd + C
  2. Entered git commit message and checked pretty diff box
  3. Press OK and I get error message

Error log

/bin/bash: /Users/matgriffiths/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git: No such file or directory

{}

More lines for Commit

Hello!
It would be great to have the Commit Field as an area with multiple lines. This would give one the opportunity to write a more detailed commmit, structured in a shot summary in the first line and details in the further paragraphs ...

I think this would be a cool improvement, especially for bigger teams that need to collaborate a lot.

What do you think? Is this possible?

Doesn't work on Sketch 3.5

After typing in commit message or when trying to generate pretty diffs, I receive the following error:

2016-01-27 12:43:17.856 sketchtool[31862:11553973] Error: caught exception whilst suppressing update events: *** -[MSUnarchiver decodeObjectForKey:]: cannot decode object of class (MSImmutableSharedStyleContainer) for key (layerStyles); the class may be defined in source code or a library that is not linked 2016-01-27 12:43:17.857 sketchtool[31862:11553973] Error: caught exception whilst decoding (version 76):*** -[MSUnarchiver decodeObjectForKey:]: cannot decode object of class (MSImmutableSharedStyleContainer) for key (layerStyles); the class may be defined in source code or a library that is not linked Failed to open document Playlist.sketch -- file:///Users/danross/design-android/ ((null) MSDocumentDomain:11)

Not working with 3.5.1

While init git repo, it's showing an error with message :
{ column = 25; line = 11; sourceURL = "/Users/USER/Library/Application Support/com.bohemiancoding.sketch3/Plugins/CSSketch-master/git-sketch-plugin-master/Git.sketchplugin/Contents/Sketch/Init.cocoascript"; }

Error when commit

screen shot 2016-03-23 at 10 13 27 am

Do you guys know, why I'm not being able to commit. I already have installed sketchtool

Have to close Sketch when switching branches

The plugin is working great. An issue I’ve noticed, however, is that when switching branches I have to:

  1. Close Sketch
  2. Switch branch git checkout branch-name
  3. Reopen Sketch

This isn’t that annoying, it’s just that in order for the updates from a branch to take effect in Sketch I have to close it while switching between branches.

Would there be any way to reload the file after having switched branches?

Thanks for the great plugin 👍

Failed Error

I haven't been able to commit or push any changes after pushing my first file.

Not seeing the unchanged file, just the final output file.

Here are the steps I'm taking:

  1. Checkout master
  2. Plugins > Git > New Branch > name Branch
  3. Make changes
  4. Plugins > Git > Commit > enter message (leave checkbox checked for pretty diffs)
  5. Plugins > Git > Push

But when I go to open a pull request on github.com, all I can see is the final output diff image. Here's where you can see what I'm talking about: https://github.com/sfotyler/sketch/compare/added_hat?expand=1.

Not sure if I'm doing something wrong. I L O V E this idea, thank you very much for the work and the help on this issue.

Switch and new branch

Sorry in advance if this is wrong, im semi-new to git.

When I use New Banch, it only makes this branch locally, I have to go to repo online and create a branch under exactly the same name. Or I cant push. Is there any way we can do this once in sketch and then just push the changes through the plugin?

When Switching branch, i'm finding that sketch is committing and pushing changes to the branch I switched to, and the one I was working on. Therefore im finding things publishing on 2 or 3 branches. This is a real pain point for me.

Failed commit – Can't encode character

How did it happen?

  1. trying to commit (with or without pretty diffs)

Error log

Failed..

Traceback (most recent call last):
  File "/Users/ricucit/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/getArtboardNames.py", line 13, in <module>
    print artboard["name"]
UnicodeEncodeError: 'ascii' codec can't encode character u' #\u2265' in position 16: ordinal not in range(128)

Sketchtool isn't exporting, giving an [MSUnarchiver decodeObjectForKey:]: cannot decode object of class (MSImmutableSharedStyleContainer) for key (layerStyles) error #630

Seems to be an integration error with Sketch 3.5 + Sketch Tool + git-sketch-plugin

  • Sketch 3.5
  • latest git-sketch-plugin
  • git 2.7.1

Full Error:

2016-02-12 09:39:13.501 sketchtool[69844:2892800] Error: caught exception whilst suppressing update events: *** -[MSUnarchiver decodeObjectForKey:]: cannot decode object of class (MSImmutableSharedStyleContainer) for key (layerStyles); the class may be defined in source code or a library that is not linked
2016-02-12 09:39:13.502 sketchtool[69844:2892800] Error: caught exception whilst decoding (version 76):*** -[MSUnarchiver decodeObjectForKey:]: cannot decode object of class (MSImmutableSharedStyleContainer) for key (layerStyles); the class may be defined in source code or a library that is not linked
Failed to open document test.sketch -- file:///Users/bryanberger/Desktop/test/
((null) MSDocumentDomain:11)

delete branch

How do you remove a branch from the Checkout branch pull down menu. I have deleted it from Git and it still appears in the menu. Need to remove the Dianna branch.
screen shot 2016-08-24 at 11 55 32 am

Error

{
column = 25;
line = 11;
sourceURL = "/Users/workstation001/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/Init.cocoascript";
}

Merge Sketch Files

How is the progress on merging sketch files? Awesome product, thank you!

`array argument is not an NSArray` on switch branch


2016-05-20 09:22:53.584 sketchtool[6079:429153] Error: caught exception whilst decoding (version 85):*** -[MSUnarchiver decodeObjectForKey:]: cannot decode object of class (MSImmutableSymbolMaster) for key (NS.object.0); the class may be defined in source code or a library that is not linked
Failed to open document source.sketch -- file:///Users/lajlev/Sites/boligportal/design/projects/160519�reate 0x7f92df6cf600lace220Upsell/
((null) MSDocumentDomain:11)

Trying to use with company enterprise git

I'm hoping I can get some help. I'm working on an internal, company git and keep getting the following:

screen shot 2016-06-08 at 5 46 10 pm

The URL is the address of my internal org's git. I should also mention this requires a login. Any help would be greatly appreciated!

can't commit with single apostrophes in comments

Try to commit with ' in a comment e.g.

fix it's problem

Result:

Failed...

/bin/bash: -c: line 0: unexpected EOF while looking for matching `''
/bin/bash: -c: line 1: syntax error: unexpected end of file

[RFC] workflow

I'm preparing a talk about emergent design process and in the startup I'm working there is only one designer so I'd love to have more point of views.

  • How many designers are working together in your company?
  • What is your general workflow?
  • Would you use something like git-sketch-plugin for personal project or do you only see value when working in team?
  • What are the pain points in your process?

I have some crazy ideas as well:

  • since we are exporting the artboards already, we could generate an online prototype using those and a bot could post the link to it when you open a pull request

What do you think of it? Do you have any other?

@Lesterng @edsonespindola @zeroxme @PatrickDattilio @Davst @aryaman765 @buughost @rnicholus @loklaan @every_body_else

Add check if no file is open

When I try to init git repo, I receive a "Failed" dialogue box with the following error message:

{
column = 23;
line = 64;
sourceURL = "/Users/diannakane/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git Sketch Plugin/Git.sketchplugin/Contents/Sketch/Init.cocoascript";
}

Negative padding found. Likely a problem in geometry of group error

How did it happen?

  1. Committing sketch file
  2. I ticked pretty diffs
  3. and error happens

Error log

2016-10-03 15:33:25.300 sketchtool[34249:265667] Negative padding found. Likely a problem in geometry of group: <MSImmutableLayerGroup: 0x7fd9c1f07a50> Page 1 (E4772E9F-A62C-483C-982C-A68E65CA5801)
2016-10-03 15:33:25.303 sketchtool[34249:265667] Negative padding found. Likely a problem in geometry of group: <MSImmutableLayerGroup: 0x7fd9c1c931f0> Page 1 (8375CFAE-6493-480B-BEE4-C832BE0EBCEB)
2016-10-03 15:33:25.305 sketchtool[34249:265667] Negative padding found. Likely a problem in geometry of group: <MSImmutableLayerGroup: 0x7fd9c1d610a0> Page 1 (FF67D365-BC73-482D-B88D-4A333D911216)
2016-10-03 15:33:25.307 sketchtool[34249:265667] Negative padding found. Likely a problem in geometry of group: <MSImmutableLayerGroup: 0x7fd9c1d81a90> Page 1 (2D532391-CFEC-4591-89AB-B603DCC1F02E)
2016-10-03 15:33:25.310 sketchtool[34249:265667] Negative padding found. Likely a problem in geometry of group: <MSImmutableLayerGroup: 0x7fd9c1d98ed0> Page 1 (AFB47E60-F11D-44E0-837D-2773A89ECAE0)
2016-10-03 15:33:25.312 sketchtool[34249:265667] Negative padding found. Likely a problem in geometry of group: <MSImmutableLayerGroup: 0x7fd9c1e389c0> Page 1 (65480237-9B45-49F4-A7A9-919B46C11AF7)
2016-10-03 15:33:25.314 sketchtool[34249:265667] Negative padding found. Likely a problem in geometry of group: <MSImmutableLayerGroup: 0x7fd9c1da9940> Page 1 (5D1AA18C-6767-4FEF-B546-39D3DF8D3CA6)
warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal',
whose behaviour will change in Git 2.0 with respect to paths you removed.
Paths like '.exportedArtboards/Project/01 - Artboard1.png' that are
removed from your working tree are ignored with this version of Git.

The error does not happen when i uncheck the pretty diffs option

Tried googling around and can't find a solution to this.

May i know if there's any workaround ?

Cheers

Two people working on the same file

I don't know if I'm doing anything wrong, but I think the way the plugin works today, if another person changes the file I'm working on, when I pull the changes, I can either save mine anyway and overwrite, or revert and lose my changes.

Are you currently working on a solution for that?

Would it be possible to, instead of just overwriting the file, add the commit number to the file coming from the remote and keep both? This way I could resolve the conflicts and/or merge them manually. Just a thought.

Awesome work, btw!

Thanks.

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.