Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git hooks do not work #6

Closed
philippneugebauer opened this issue Feb 2, 2015 · 25 comments
Closed

Git hooks do not work #6

philippneugebauer opened this issue Feb 2, 2015 · 25 comments
Assignees
Labels

Comments

@philippneugebauer
Copy link

Actually, I don't have any clue where I should post it, therefore I do it here.

I like your idea and tried to implement it for my blog: https://github.com/philippneugebauer/philippneugebauer.github.io

Unfortunately, the git hooks do not work for me. I use windows and maybe that's one of the problems.
I provided my access token only for public repos because I guess that must be sufficient.

The setup of the git hooks and the setting of the acces token to the file worked, but GitHub does not create new issues per commit.

@philippneugebauer philippneugebauer changed the title Git hooks do not work Git hooks do not work| windows? Feb 2, 2015
@philippneugebauer philippneugebauer changed the title Git hooks do not work| windows? Git hooks do not work | windows? Feb 2, 2015
@wireddown wireddown added the bug label Feb 2, 2015
@wireddown wireddown self-assigned this Feb 2, 2015
@wireddown
Copy link
Owner

Ok, thanks :-) I also use Windows, so there is another factor causing this defect. I will add some diagnostics and we can learn more. Please wait for an update.

In the mean time, would you share some more information?

  1. What do you see when you type this at your terminal?
which gpgcCreateCommentIssue.sh
  1. When you installed the git hooks, what was your present working directory?

@philippneugebauer
Copy link
Author

Hm, ok. I was doubtful abouth this Path. Now I know you meant the windows path. Therefore I added it to the the path, but which gpgcCreateCommentIssue.sh still isn't found.
1)

C:\Entwicklung\blog_tool>which gpgcCreateCommentIssue.sh
which: no gpgcCreateCommentIssue.sh in (/cygdrive/c/Entwicklung/blog_tool/gpgcCr
eateCommentIssue.sh:/cygdrive/c/Program Files (x86)/Git/bin:)
  1. The working directory of the repository

@philippneugebauer
Copy link
Author

Ok, part 1 is fixed. I needed to remove the file name. I will try the upload now again

@philippneugebauer
Copy link
Author

Ok, I think now the access token causes the problem. Which access rights does it need? I actually don't like to permit more than I'm required to do and public_repo do not seem to be enough.

That's the message:

{
  "message": "Bad credentials",
  "documentation_url": "https://developer.github.com/v3"
}
Error: could not create label "Post Comments" for "philippneugebauer/philippneugebauer.github.io"

@wireddown
Copy link
Owner

The token is used to create labels and issues on a repository. Looking at GitHub's definition of scopes public_repo appears to be enough, and so I am surprised that it is failing.

My OAuth token has three privileges:

  1. repo
  2. gist
  3. user

If you want to find the minimal set, try changing public_repo to repo. If that doesn't work, then add user, and finally gist.

@philippneugebauer
Copy link
Author

I tried it with all rights and it still didn't worked. Therefore, I assume there is any login problem, but I couldn't figure that out yet :/

@wireddown
Copy link
Owner

Ok, two more things:

  1. Would you redact all private information and post your console input/output?

  2. What are the contents of .git/gpgc_cache?

@philippneugebauer
Copy link
Author

Ok, the authentication works now and additionally it created the label:

Created label "Post Comments" for "philippneugebauer/philippneugebauer.github.io

public_repo is enough, but I had some trouble with the access token update in the git hooks file.

Can you confirm, that a second install does not change the token in the file? I actually assume it, because when I set up a new one and edited it manually, it worked.

Which exact commit message do I need to create an issue? That's what still does not work.

Already thanks for your support :)

@philippneugebauer
Copy link
Author

Ok, following your tutorial worked, although I get now another error message while trying to create the issue:

{
  "message": "Problems parsing JSON",
  "documentation_url": "https://developer.github.com/v3/issues/#create-an-issue"

}
Error: could not create issue "title" for "philippneugebauer/philippneugebauer.github.io"

FURTHERMORE:

Jekyll has in it's default post the title in ", leading to ""title"" in the error message. Anyway, I still don't know, where the " come from.

I'd like to see you giving an example of a commit message, because the actual text is a bit confusing

@wireddown
Copy link
Owner

public_repo is enough

Great, I'll add that to the setup instructions.

Can you confirm, that a second install does not change the token in the file? I actually assume it, because when I set up a new one and edited it manually, it worked.

You're correct: a second install will not change the hook -- the script will check to see if it is already installed and do nothing if so.

Which exact commit message do I need to create an issue? That's what still does not work.

The commit message does not affect gpgc's behavior; instead, it is the post's front matter.

Jekyll has in it's default post the title in ", leading to ""title"" in the error message.

Look at my example posts' front matter titles: 2015-01-18-the-phrenic-shrine-reveals-itself.md

---
layout: post
title: The Phrenic Shrine Reveals Itself
---

Please remove the bookend quotes from the title in your front matter. I believe this is the bug :-)

I'd like to see you giving an example of a commit message, because the actual text is a bit confusing.

Yes, I can add that as well.

@philippneugebauer
Copy link
Author

I would suggest you to change this behavior. I would expect it to be set again.

Yeah, I removed the ", but I still get this error. But now it's just one " per side in the error message as shown above and not anymore two " per side with the title in ".

Here is an example post called 2015-02-03-post_title4.markdown:

---
layout: post
title: title4
date: 2015-02-03 17:30:00
categories: test
---

test

This post file still leads to this error:

{
  "message": "Problems parsing JSON",
  "documentation_url": "https://developer.github.com/v3/issues/#create-an-issue"

}
Error: could not create issue "title4" for "philippneugebauer/philippneugebauer.github.io"

@wireddown
Copy link
Owner

I would suggest you to change this behavior. I would expect it to be set again.

Thanks. This is captured here: #7 -- Installing git hooks should create or update them

Yeah, I removed the ", but I still get this error.

Ok, let's get some specific diagnostics. Please insert a line in gpgcCreateCommentIssue.sh:

89 function Push
90 {
+    set -x
91   local gpgcDataFile="${GitRepoRoot}/_data/gpgc.yml"
92   local siteDataFile="${GitRepoRoot}/_config.yml"

and git commit and git push your test post again.

NOTE

This change will print your OAuth token to the terminal when you push. Before you place the output here, please redact your token.

@philippneugebauer
Copy link
Author

That's the output:

+ local gpgcDataFile=Y:/blog/_data/gpgc.yml
+ local siteDataFile=Y:/blog/_config.yml
++ grep '^repo_owner:' Y:/blog/_data/gpgc.yml
++ sed 's/^repo_owner: \+//g'
+ local repo_owner=philippneugebauer
++ grep '^repo_name:' Y:/blog/_data/gpgc.yml
++ sed 's/^repo_name: \+//g'
+ local repo_name=philippneugebauer.github.io
++ grep '^label_name:' Y:/blog/_data/gpgc.yml
++ sed 's/^label_name: \+//g'
+ local 'label_name=Post Comments'
++ grep '^label_color:' Y:/blog/_data/gpgc.yml
++ sed 's/^label_color: \+//g'
+ local label_color=666666
++ LabelExists philippneugebauer philippneugebauer.github.io 'Post Comments'
++ local owner=philippneugebauer
++ local repo=philippneugebauer.github.io
++ local 'label=Post Comments'
+++ curl -s https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels
++ local 'labelList=[
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/bug",
    "name": "bug",
    "color": "fc2929"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/duplicate",
    "name": "duplicate",
    "color": "cccccc"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/enhancement",
    "name": "enhancement",
    "color": "84b6eb"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/help%20wanted",
    "name": "help wanted",
    "color": "159818"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/invalid",
    "name": "invalid",
    "color": "e6e6e6"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/question",
    "name": "question",
    "color": "cc317c"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/wontfix",
    "name": "wontfix",
    "color": "ffffff"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/Post%20Comments",
    "name": "Post Comments",
    "color": "666666"
  }
]'
++ echo '[
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/bug",
    "name": "bug",
    "color": "fc2929"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/duplicate",
    "name": "duplicate",
    "color": "cccccc"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/enhancement",
    "name": "enhancement",
    "color": "84b6eb"
  },rep -q '"name": "Post Comments"'

  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/help%20wanted",
    "name": "help wanted",
    "color": "159818"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/invalid",
    "name": "invalid",
    "color": "e6e6e6"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/question",
    "name": "question",
    "color": "cc317c"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/wontfix",
    "name": "wontfix",
    "color": "ffffff"
  },
  {
    "url": "https://github.com/gitapi/repos/philippneugebauer/philippneugebauer.git
hub.io/labels/Post%20Comments",
    "name": "Post Comments",
    "color": "666666"
  }
]'
++ echo :
+ :
++ cat Y:/blog/.git/gpgc_cache
+ local 'allCommittedPosts=_posts/2015-02-03-post_title5.markdown
_posts/2015-02-03-post_title6.markdown'
+ local resetCacheFile=false
+ test -n '_posts/2015-02-03-post_title5.markdown
_posts/2015-02-03-post_title6.markdown'
+ for committed_post in '${allCommittedPosts}'
+ test -f _posts/2015-02-03-post_title5.markdown
++ grep '^title:' _posts/2015-02-03-post_title5.markdown
++ sed 's/^title: \+//g'
+ local post_title=title5
++ grep '^url:' Y:/blog/_config.yml
++ sed 's/^url: \+//g'
+ local 'site="http://philippneugebauer.net" # the base hostname & protocol for
your site'
++ basename _posts/2015-02-03-post_title5.markdown
++ awk -F - '{print $1}'
+ local year=2015
++ basename _posts/2015-02-03-post_title5.markdown
++ awk -F - '{print $2}'
+ local month=02
++ basename _posts/2015-02-03-post_title5.markdown
++ awk -F - '{print $3}'
+ local day=03
++ basename _posts/2015-02-03-post_title5.markdown
++ sed 's/^[0-9]\+-[0-9]\+-[0-9]\+-//'
++ sed 's/\.[a-zA-Z]\+$//'
+ local post_slug=post_title5
+ local 'post_url="http://philippneugebauer.net" # the base hostname & protocol
for your site/2015/02/03/post_title5'
++ IssueExists philippneugebauer philippneugebauer.github.io title5
++ local owner=philippneugebauer
++ local repo=philippneugebauer.github.io
++ local title=title5
+++ RawUrlEncode title5
+++ local string=title5
+++ local strlen=6
+++ local encoded=
+++ (( pos=0  ))
+++ (( pos<strlen  ))
+++ c=t
+++ case "$c" in
+++ o=t
+++ encoded+=t
+++ (( pos++  ))
+++ (( pos<strlen  ))
+++ c=i
+++ case "$c" in
+++ o=i
+++ encoded+=i
+++ (( pos++  ))
+++ (( pos<strlen  ))
+++ c=t
+++ case "$c" in
+++ o=t
+++ encoded+=t
+++ (( pos++  ))
+++ (( pos<strlen  ))
+++ c=l
+++ case "$c" in
+++ o=l
+++ encoded+=l
+++ (( pos++  ))
+++ (( pos<strlen  ))
+++ c=e
+++ case "$c" in
+++ o=e
+++ encoded+=e
+++ (( pos++  ))
+++ (( pos<strlen  ))
+++ c=5
+++ case "$c" in
+++ o=5
+++ encoded+=5
+++ (( pos++  ))
+++ (( pos<strlen  ))
+++ echo title5
++ local safeTitle=title5
+++ curl -s 'https://github.com/gitapi/search/issues?q=title5+repo:philippneugebaue
r/philippneugebauer.github.io+type:issue+in:title'
++ local 'issueList={
  "total_count": 0,
  "incomplete_results": false,
  "items": [

  ]
}'
++ echo '{
  "total_count": 0,
  "incomplete_results": false,
  "items": [

  ]
}'
++ grep -q '"title": "title5"'
++ echo false
+ false
++ CreateIssue philippneugebauer philippneugebauer.github.io title5 '"http://phi
lippneugebauer.net" # the base hostname & protocol for your site/2015/02/03/post
_title5' 'Post Comments'
++ local owner=philippneugebauer
++ local repo=philippneugebauer.github.io
++ local title=title5
++ local 'url="http://philippneugebauer.net" # the base hostname & protocol for
your site/2015/02/03/post_title5'
++ local 'label=Post Comments'
++ local 'body={"title":"title5","body":"This is the comment thread for [title5]
("http://philippneugebauer.net" # the base hostname & protocol for your site/201
5/02/03/post_title5).","assignee":"philippneugebauer","labels":["Post Comments"]
}'
+++ curl -s -H 'Authorization: token removed' -
d '{"title":"title5","body":"This is the comment thread for [title5]("http://phi
lippneugebauer.net" # the base hostname & protocol for your site/2015/02/03/post
_title5).","assignee":"philippneugebauer","labels":["Post Comments"]}' https://a
pi.github.com/repos/philippneugebauer/philippneugebauer.github.io/issues
++ local 'creationResponse={
  "message": "Problems parsing JSON",
  "documentation_url": "https://developer.github.com/v3/issues/#create-an-issue"

}'
++ echo '{
  "message": "Problems parsing JSON",
  "documentation_url": "https://developer.github.com/v3/issues/#create-an-issue"

}'
++ grep -q '"title": "title5"'
++ echo false
++ echo '{
  "message": "Problems parsing JSON",
  "documentation_url": "https://developer.github.com/v3/issues/#create-an-issue"

}'
{
  "message": "Problems parsing JSON",
  "documentation_url": "https://developer.github.com/v3/issues/#create-an-issue"

}
+ false
+ echo 'Error: could not create issue "title5" for "philippneugebauer/philippneu
gebauer.github.io"'
Error: could not create issue "title5" for "philippneugebauer/philippneugebauer.
github.io"
+ exit

@wireddown
Copy link
Owner

I see a second bug :-)

Change your _config.yml line for your url variable:

Before

url: "http://philippneugebauer.net" # the base hostname & protocol for your site

After

# the base hostname & protocol for your site
url: http://philippneugebauer.net

The script needs to accommodate yml syntax more gracefully than it currently does.

@philippneugebauer
Copy link
Author

That was the problem :) Thanks a lot :)

@wireddown
Copy link
Owner

Sure thing :-)

I'll create a few more issues from this thread, and it looks like I have some hardening to do :-)

@wireddown wireddown changed the title Git hooks do not work | windows? Git hooks do not work Feb 2, 2015
@wireddown
Copy link
Owner

Issues created:

wireddown added a commit that referenced this issue Feb 3, 2015
wireddown added a commit that referenced this issue Feb 3, 2015
Harden parsing yml from bash:
* Allow but ignore whitespace before nad after a key's name so that the script can always find it
* Delete any in-line comments after the value since they're not part of the value
* Delete any double-quotes since they break the JSON format
wireddown added a commit that referenced this issue Feb 3, 2015
* YML requires variable keys start on the beginning of the line, so don't allow leading whitespace
* Only use the first hit for a key; perhaps the user is using the key in their post
* Delete any leading white space before in-line comments
@wireddown wireddown removed the in work label Feb 3, 2015
@wireddown
Copy link
Owner

Two pages show that this issue has been fixed:

@dotmilk
Copy link

dotmilk commented Aug 4, 2016

Well i'm in osx and my commit hooks do not fire, so i am having to run gpgcCreateCommentIssue.sh push bootstrap and manually run gpgcCreateCommentIssue.sh push after my commit and push.

At first i noticed they didn't have execute priv so i changed them to have it. But still no joy.

Is there something in the code somewhere that is checking to see what branch you are on / pushing etc?

@wireddown
Copy link
Owner

Well i'm in osx and my commit hooks do not fire

Aside from the symptom of the comment thread not being created when you git push, did you try anything else to confirm that the git hooks are not running? For example, adding a simple echo "Hello from a git hook" to the pre-commit and pre-push hooks in .git\hooks would print to the console when you commit and push.

If you see the test messages when you git commit and git push, would you enable diagnostics and post the output from a terminal session?

Is there something in the code somewhere that is checking to see what branch you are on / pushing etc?

What's your hypothesis?

@dotmilk
Copy link

dotmilk commented Aug 5, 2016

I will run those tests in a moment. My hypothesis is that I push my _site to master and the the rest of it to 'sources' branch. see here. So i'm wondering if there is a branch check in there wherein if im not pushing to master the .sh the hooks call somehow decided not to open the issue. But I figure it isn't the case.

@dotmilk
Copy link

dotmilk commented Aug 5, 2016

Hmm never mind, for some reason after putting in the echo and turning on diagnostics it worked when i pushed this time. I hope this doesn't turn out to be a heisenbug.

~/milk/cheshirecatalyst.github.io sources* ⇡
❯ git commit -m "a test post for diagnostics"
(global): enable_diagnostics == true
(global): GitRepoRoot == /Users/sethprice/milk/cheshirecatalyst.github.io
(global): GpgcCacheFile == /Users/sethprice/milk/cheshirecatalyst.github.io/.git/gpgc_cache
(global): GpgcDataFile == /Users/sethprice/milk/cheshirecatalyst.github.io/_data/gpgc.yml
(global): operation == commit
Commit: changedPosts == A   _posts/2016-08-04-comments-and-questions.html
Commit: allChangedPosts == _posts/2016-08-04-comments-and-questions.html
AddPostsToCache: Adding _posts/2016-08-04-comments-and-questions.html to /Users/sethprice/milk/cheshirecatalyst.github.io/.git/gpgc_cache
[sources 9693a83] a test post for diagnostics
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 _posts/2016-08-04-comments-and-questions.html

~/milk/cheshirecatalyst.github.io sources ⇡
❯ git push
(global): enable_diagnostics == true
(global): GitRepoRoot == /Users/sethprice/milk/cheshirecatalyst.github.io
(global): GpgcCacheFile == /Users/sethprice/milk/cheshirecatalyst.github.io/.git/gpgc_cache
(global): GpgcDataFile == /Users/sethprice/milk/cheshirecatalyst.github.io/_data/gpgc.yml
(global): operation == push
Push: siteDataFile == /Users/sethprice/milk/cheshirecatalyst.github.io/_config.yml
GetValueFromYml: ymlFile == /Users/sethprice/milk/cheshirecatalyst.github.io/_data/gpgc.yml
GetValueFromYml: ymlKey == repo_owner
GetValueFromYml: value == cheshirecatalyst
GetValueFromYml: ymlFile == /Users/sethprice/milk/cheshirecatalyst.github.io/_data/gpgc.yml
GetValueFromYml: ymlKey == repo_name
GetValueFromYml: value == cheshirecatalyst.github.io
GetValueFromYml: ymlFile == /Users/sethprice/milk/cheshirecatalyst.github.io/_data/gpgc.yml
GetValueFromYml: ymlKey == label_name
GetValueFromYml: value == Post Comments
GetValueFromYml: ymlFile == /Users/sethprice/milk/cheshirecatalyst.github.io/_data/gpgc.yml
GetValueFromYml: ymlKey == label_color
GetValueFromYml: value == 666666
LabelExists: Querying "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels" for "Post Comments"
LabelExists: [
  {
    "url": "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels/bug",
    "name": "bug",
    "color": "ee0701"
  },
  {
    "url": "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels/duplicate",
    "name": "duplicate",
    "color": "cccccc"
  },
  {
    "url": "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels/enhancement",
    "name": "enhancement",
    "color": "84b6eb"
  },
  {
    "url": "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels/help%20wanted",
    "name": "help wanted",
    "color": "128A0C"
  },
  {
    "url": "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels/invalid",
    "name": "invalid",
    "color": "e6e6e6"
  },
  {
    "url": "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels/question",
    "name": "question",
    "color": "cc317c"
  },
  {
    "url": "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels/wontfix",
    "name": "wontfix",
    "color": "ffffff"
  },
  {
    "url": "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/labels/Post%20Comments",
    "name": "Post Comments",
    "color": "666666"
  }
]
Push: allCommittedPosts ==
_posts/2016-08-04-comments-and-questions.html
GetValueFromYml: ymlFile == _posts/2016-08-04-comments-and-questions.html
GetValueFromYml: ymlKey == title
GetValueFromYml: value == Comments and Questions
GetValueFromYml: ymlFile == /Users/sethprice/milk/cheshirecatalyst.github.io/_config.yml
GetValueFromYml: ymlKey == url
GetValueFromYml: value ==              https://cheshirecatalyst.github.io
RawUrlEncode: Encoding "Comments and Questions"
RawUrlEncode: Result: "Comments%20and%20Questions"
IssueExists: Querying "https://github.com/gitapi/search/issues?q=Comments%20and%20Questions+repo:cheshirecatalyst/cheshirecatalyst.github.io+type:issue+in:title" for "Comments and Questions"
IssueExists: {
  "total_count": 0,
  "incomplete_results": false,
  "items": [

  ]
}
CreateIssue: Posting to "https://github.com/gitapi/repos/cheshirecatalyst/cheshirecatalyst.github.io/issues" with '{"title":"Comments and Questions","body":"This is the comment thread for [Comments and Questions](             https://cheshirecatalyst.github.io/2016/08/04/2016-08-04-comments-and-questions.html).","assignee":"cheshirecatalyst","labels":["Post Comments"]}'
Created issue "Comments and Questions" for "cheshirecatalyst/cheshirecatalyst.github.io"
Push: Resetting /Users/sethprice/milk/cheshirecatalyst.github.io/.git/gpgc_cache
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 827 bytes | 0 bytes/s, done.
Total 7 (delta 3), reused 0 (delta 0)
To git@github.com:cheshirecatalyst/cheshirecatalyst.github.io.git
   4f2ef3f..9693a83  sources -> sources

@wireddown
Copy link
Owner

Would you describe your workflow for creating and publishing a new post?

The hooks assume blog posts live in the _posts folder, but it looks like you have a different topology. I'd like to make the script accommodate other publishing techniques.

@dotmilk
Copy link

dotmilk commented Aug 8, 2016

TBH right now I have it disabled as there is one post that works when diagnostic is enabled and throws an error when it isn't, and I am rewriting my emacs config at the moment and haven't had time to track it down.

However I use the standard workflow, just from emacs:

I export from my .org file it places the post in _posts
I build
I push to github sources branch
I cd into my _site
I push to github master branch

In this way i push the rendered stuff to be displayed, and my sources branch keeps track of the un-rendered content. I will look back In to this when done with emacs.

The thing i find most odd is that running bootstrap and then push works where as the hooks do not. When they appear to be doing generally the same thing.

@wireddown
Copy link
Owner

Thanks, I'd like a few more details because my understand isn't complete.

I export from my .org file it places the post in _posts

I don't understand any of this :-(

I build

Ok, so it's a local build on your Mac.

I push to github sources branch

What is the result of this action?

I cd into my _site

Ok.

I push to github master branch

What is the result of this action?

Why do you push twice for a single post? Is that how you separate rendered pages from static pages and resources (or, why do you keep those in different branches)?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants