Fun with Git, Redux

2015-08-27 Thread David T.
I apologize in advance for my utter inability to understand this whole Git 
realm.

I have a sincere desire to help with the documentation, but what I would like 
to do is focus on the writing, and not with the Gitting. Unfortunately, instead 
of writing or editing documentation, I spend hours trying to understand the 
simplest of steps in the Git world, and this has me exceedingly frustrated.

Let me begin by saying that I am using a Mac on OS X 10.10.5, and the Git tool 
I am using is SourceTree 2.0.5.2. I am not a programmer, but I used to think I 
was, back in the days of Visual Basic.

After my patches from February resulted in an insurmountable (for me, at least) 
conundrum of patches that would not apply, I completely nuked my local copy of 
the docs and re-cloned from github, as per the Writing Documentation page. 

With a fresh copy of the docs, I began by creating new branches—one for each 
bug I was working on. I named each branch with the bug number to keep things 
straight. This was based on advice I received here. 

I then worked on Bug A in file A, used SourceTree’s Create Patch menu option 
and got a diff file for this bug. I uploaded the file, and proceeded to the 
next. I repeated these steps for the other two bugs. (Conveniently, each of 
these bugs was in a separate chapter of the documentation).

OK, so now my SourceTree window includes multiple patches and branches. Geert 
has gone in to the respective bugs on Bugzilla and committed the patches 
(thanks, Geert!, and sorry about the errors!) into the main repository, which 
means my own patches and branches are superceded and superfluous. I don’t know 
how to get rid of them, and I don’t know how to update my local docs with the 
repository. With my current level of skill with Git, the only method I know to 
clean this up is to nuke it all again and start over, which I am reasonably 
sure is The Stupidest Way Possible.

On to actual questions:

How do I tell my local copy to sync with the newer version online?

How do I tell my local copy that my changes went into the main repository and 
no longer need to live locally?

Am I supposed to check something out? (besides passersby)

Should my patches be committed? (or should I?)

Would all of this be easier if I dropped SourceTree altogether and put together 
a dummy’s list of commandline commands that will walk me through this process?

During my last Git episode, I created my own github account and mirrored 
gnucash-docs, but I have no idea how to utilize this in a meaningful way. 

I would be extremely grateful for assistance.

David T.



___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git, Redux

2015-08-27 Thread David T.
Derek, John, and Geert,

Thank you all for providing me with a great deal of hand-holding. I will once 
again peruse the wealth of information each of you has given me here, and see 
how much further I can push the Git-rock up the hill before it rolls back down. 

I hope to dig into the Import Chapter thing now.

Cheers,
David

P.S. In my half-assed attempts to restart the process yet again, I ran into 
some troubles with the boilerplate command sequence listed on the Writing 
Documentation page that I’d like to mention. Specifically, when I nuked 
everything, the git clone command resulted in 403 errors that had me puzzled. I 
learned that OS X includes a version of git that is too old for the command 
(1.6.1), and that an upgrade of the git tool remedied the situation. You all 
probably know about these things, but I thought I’d put it into the list in 
case some other neophyte encounters the same problem…


 On Aug 27, 2015, at 12:45 PM, Geert Janssens geert.gnuc...@kobaltwit.be 
 wrote:
 
 On Thursday 27 August 2015 17:29:06 John Ralls wrote:
   On Aug 27, 2015, at 3:34 PM, David T. sunfis...@yahoo.com 
   mailto:sunfis...@yahoo.com wrote:
   
   I apologize in advance for my utter inability to understand this
   whole Git realm.
   
   I have a sincere desire to help with the documentation, but what I
   would like to do is focus on the writing, and not with the Gitting.
   Unfortunately, instead of writing or editing documentation, I spend
   hours trying to understand the simplest of steps in the Git world,
   and this has me exceedingly frustrated.
   
 I sympathize with your frustration. Git is a powerful tools and unfortunately 
 that comes with a learning curve.
  
 Luckily you don't need to know all of git to get to documentation writing. 
 John and Derek already gave their insights on the initial work.
  
 What I'd add is: don't spend hours searching for how to do things in git. Ask 
 early on instead. Either here on the list or on irc (the latter allow for a 
 more interactive conversation, but we're not always there).
  
 snip
  
   How do I tell my local copy that my changes went into the main
   repository and no longer need to live locally?
  There are two ways, rebase the branch onto maint which would normally
  make it go away because maint will already have the commit or just
  force-delete the branch unmerged. In this particular case rebasing
  will have conflicts because Geert had to make some changes first.
  
 I pushed my fixes in separate commits, so the rebase would probably still 
 work in this case (that's also why I decided to make separate commits).
  
 snip
  
   During my last Git episode, I created my own github account and
   mirrored gnucash-docs, but I have no idea how to utilize this in a
   meaningful way.
  Once you’ve created a branch and committed changes to it you can push
  that branch to Github and use Github to issue a pull request. That’s
  less work than writing up a bug report just to contribute a change;
  in the case of a multi-commit branch it’s a lot less work at both
  ends.
  
 So to be clear, this is optional. But can come in handy when you're getting 
 more used to working with git and commits.
  
 Good luck !
  
 Regards,
  
 Geert

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git, Redux

2015-08-27 Thread David T.
John,

 On Aug 27, 2015, at 12:29 PM, John Ralls jra...@ceridwen.us wrote:
 
 
 On Aug 27, 2015, at 3:34 PM, David T. sunfis...@yahoo.com wrote:
 snip
 which means my own patches and branches are superceded and superfluous. I 
 don’t know how to get rid of them, and I don’t know how to update my local 
 docs with the repository. With my current level of skill with Git, the only 
 method I know to clean this up is to nuke it all again and start over, which 
 I am reasonably sure is The Stupidest Way Possible.
 
 Have you read http://git-scm.com/documentation? It’s not the manpage. It’s a 
 well-written book that will help you understand how git works and how to use 
 it effectively.

I have looked at that; unfortunately, I don’t get very far before I lose touch 
with reality. Like, chapter 2.3 or so. The documentation is, as you say, 
well-written, but I think the trouble arises in that the book of necessity 
takes things from a very simple perspective, whereas everything in the Gnucash 
development realm is far far more complex. I will say that this time around, a 
few things in the Gitrealm don’t seem quite as foreign to me, so there may 
still be hope for me.

David
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git, Redux

2015-08-27 Thread John Ralls

 On Aug 27, 2015, at 3:34 PM, David T. sunfis...@yahoo.com wrote:
 
 I apologize in advance for my utter inability to understand this whole Git 
 realm.
 
 I have a sincere desire to help with the documentation, but what I would like 
 to do is focus on the writing, and not with the Gitting. Unfortunately, 
 instead of writing or editing documentation, I spend hours trying to 
 understand the simplest of steps in the Git world, and this has me 
 exceedingly frustrated.
 
 Let me begin by saying that I am using a Mac on OS X 10.10.5, and the Git 
 tool I am using is SourceTree 2.0.5.2. I am not a programmer, but I used to 
 think I was, back in the days of Visual Basic.
 
 After my patches from February resulted in an insurmountable (for me, at 
 least) conundrum of patches that would not apply, I completely nuked my local 
 copy of the docs and re-cloned from github, as per the Writing Documentation 
 page. 
 
 With a fresh copy of the docs, I began by creating new branches—one for each 
 bug I was working on. I named each branch with the bug number to keep things 
 straight. This was based on advice I received here. 
 
 I then worked on Bug A in file A, used SourceTree’s Create Patch menu option 
 and got a diff file for this bug. I uploaded the file, and proceeded to the 
 next. I repeated these steps for the other two bugs. (Conveniently, each of 
 these bugs was in a separate chapter of the documentation).
 
 OK, so now my SourceTree window includes multiple patches and branches. Geert 
 has gone in to the respective bugs on Bugzilla and committed the patches 
 (thanks, Geert!, and sorry about the errors!) into the main repository, which 
 means my own patches and branches are superceded and superfluous. I don’t 
 know how to get rid of them, and I don’t know how to update my local docs 
 with the repository. With my current level of skill with Git, the only method 
 I know to clean this up is to nuke it all again and start over, which I am 
 reasonably sure is The Stupidest Way Possible.

Have you read http://git-scm.com/documentation? It’s not the manpage. It’s a 
well-written book that will help you understand how git works and how to use it 
effectively.

 
 On to actual questions:

For the following I’m using “maint” as the public branch because that’s where 
we’re doing all of the documentation changes for now. There may be times where 
you’ll use “master” instead.
 
 How do I tell my local copy to sync with the newer version online?

Check out maint by control-clicking on it in the branches list and selecting 
“Checkout foo” from the context menu where foo is the branch name. Click on the 
“Pull” button in the toolbar. If you’ve kept all of your changes in separate 
branches then you can just click “OK”, but if you have local commits on maint 
check the “rebase” first. But see below in “Should my patches be committed? (Or 
should I?)”. Since you didn’t actually commit anything, you can just reset your 
repo (RepositoryReset or shift-cmd-R, select Discard File Changes in the 
toolbar, check all files, click the Discard all Changes button) and then check 
out maint and delete each branch by control-clicking on it in the sidebar and 
selecting “Delete foo” from the context menu.

 
 How do I tell my local copy that my changes went into the main repository and 
 no longer need to live locally?
There are two ways, rebase the branch onto maint which would normally make it 
go away because maint will already have the commit or just force-delete the 
branch unmerged. In this particular case rebasing will have conflicts because 
Geert had to make some changes first. However, it looks like you made the 
patches by just diffing the changes rather than making commits and formatting 
them into patches. More on that below.

To rebase in SourceTree, check out each branch and then control-click on maint 
then select “Rebase current changes onto maint”.

SourceTree won’t let you force-delete a branch, so go to Terminal, cd to the 
repo directory, and do
  git branch -D foo
where foo is the branch name.

 Am I supposed to check something out? (besides passersby)

“Check out” is gittish for changing your working directory to what is in the 
repo for a particular commit. Each branch is actually just a pointer to the 
commit at the head of a series, so when you “checkout maint” or “checkout 
master” you’re setting your working directory to that commit. I explained how 
in SourceTree above, the command line way is 
  git checkout foo

 
 Should my patches be committed? (or should I?)

You should have made commits and then made patches out of them. If you don’t 
commit your changes then making branches to work in doesn’t actually do 
anything, and switching branches may wipe out your changes if they conflict 
with what’s in the branch. In this case you were switching between branches 
pointed at the same commit (maint’s HEAD) so nothing happened.

When you make a commit you tag it with your name and write up a short 

Re: Fun with Git, Redux

2015-08-27 Thread Geert Janssens
On Thursday 27 August 2015 17:29:06 John Ralls wrote:
  On Aug 27, 2015, at 3:34 PM, David T. sunfis...@yahoo.com wrote:
  
  I apologize in advance for my utter inability to understand this
  whole Git realm.
  
  I have a sincere desire to help with the documentation, but what I
  would like to do is focus on the writing, and not with the Gitting.
  Unfortunately, instead of writing or editing documentation, I spend
  hours trying to understand the simplest of steps in the Git world,
  and this has me exceedingly frustrated.
  
I sympathize with your frustration. Git is a powerful tools and unfortunately 
that comes with a 
learning curve.

Luckily you don't need to know all of git to get to documentation writing. John 
and Derek 
already gave their insights on the initial work.

What I'd add is: don't spend hours searching for how to do things in git. Ask 
early on instead. 
Either here on the list or on irc (the latter allow for a more interactive 
conversation, but we're 
not always there).

snip

  How do I tell my local copy that my changes went into the main
  repository and no longer need to live locally?
 There are two ways, rebase the branch onto maint which would normally
 make it go away because maint will already have the commit or just
 force-delete the branch unmerged. In this particular case rebasing
 will have conflicts because Geert had to make some changes first.

I pushed my fixes in separate commits, so the rebase would probably still work 
in this case 
(that's also why I decided to make separate commits).

snip

  During my last Git episode, I created my own github account and
  mirrored gnucash-docs, but I have no idea how to utilize this in a
  meaningful way.
 Once you’ve created a branch and committed changes to it you can push
 that branch to Github and use Github to issue a pull request. That’s
 less work than writing up a bug report just to contribute a change;
 in the case of a multi-commit branch it’s a lot less work at both
 ends.
 
So to be clear, this is optional. But can come in handy when you're getting 
more used to 
working with git and commits.

Good luck !

Regards,

Geert
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git, Redux

2015-08-27 Thread Derek Atkins
Hi David,

On Thu, August 27, 2015 10:34 am, David T. wrote:
 I apologize in advance for my utter inability to understand this whole Git
 realm.
=
No worries.  We all had a learning curve to understand git.
[snip]
 On to actual questions:

 How do I tell my local copy to sync with the newer version online?

I don't know how to use SourceTree, only git command line.  BUT in git it
would be git pull

 How do I tell my local copy that my changes went into the main repository
 and no longer need to live locally?

You can 'rm' the branch/directory checkouts?  (Again, I'm not sure how to
do this is SourceTree).

 Am I supposed to check something out? (besides passersby)

I dont think so.

 Should my patches be committed? (or should I?)

There's no need to check them in locally.   The only time a local commit
would make sense is if you're building patches on top of patches (e.g.
changing the same files multiple times overlapping).  But then it would
make your patch submission more challenging, too.

 Would all of this be easier if I dropped SourceTree altogether and put
 together a dummy’s list of commandline commands that will walk me through
 this process?

Possibly, yes.  What I would do is:

git clone github/...gnucash-docs
git clone gnucash-docs gnucash-docs-BUGID1
git clone gnucash-docs gnucash-docs-BUGID2
...

Then you can work in gnucash-docs-BUGIDn, make a patch via 'git diff', and
when you're done just completely delete the gnucash-docs-BUGIDn directory.

To update, go into gnucash-docs and run 'git pull'.  Then future clones
will have the updated version.

 During my last Git episode, I created my own github account and mirrored
 gnucash-docs, but I have no idea how to utilize this in a meaningful way.

There's no need to use github that way if you don't want to.  But Geert or
John could help you through that process if you wish.

 I would be extremely grateful for assistance.

I hope I've helped some?

 David T.

-derek

-- 
   Derek Atkins 617-623-3745
   de...@ihtfp.com www.ihtfp.com
   Computer and Internet Security Consultant

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git, Redux

2015-08-27 Thread John Ralls

 On Aug 27, 2015, at 6:51 PM, David T. sunfis...@yahoo.com wrote:
 
 John,
 
 On Aug 27, 2015, at 12:29 PM, John Ralls jra...@ceridwen.us wrote:
 
 
 On Aug 27, 2015, at 3:34 PM, David T. sunfis...@yahoo.com wrote:
 snip
 which means my own patches and branches are superceded and superfluous. I 
 don’t know how to get rid of them, and I don’t know how to update my local 
 docs with the repository. With my current level of skill with Git, the only 
 method I know to clean this up is to nuke it all again and start over, 
 which I am reasonably sure is The Stupidest Way Possible.
 
 Have you read http://git-scm.com/documentation? It’s not the manpage. It’s a 
 well-written book that will help you understand how git works and how to use 
 it effectively.
 
 I have looked at that; unfortunately, I don’t get very far before I lose 
 touch with reality. Like, chapter 2.3 or so. The documentation is, as you 
 say, well-written, but I think the trouble arises in that the book of 
 necessity takes things from a very simple perspective, whereas everything in 
 the Gnucash development realm is far far more complex. I will say that this 
 time around, a few things in the Gitrealm don’t seem quite as foreign to me, 
 so there may still be hope for me.

GnuCash’s use of git is really pretty straightforward, particularly if you work 
only with maint. Maybe it seems complex because there’s so much of it. Perhaps 
it would help you to just create a little repository to play with. You can use 
a single, simple text file and try out committing, branching, and merging.

Regards,
John Ralls
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-11 Thread David T.
Well, ha ha, the joke’s on me, as the second patch I submitted wouldn’t go 
through, because I have intervening crapola on my end. (Geert put it 
differently in the bug).

For me, the easiest way to back out is to start over, so I have copied the 
three files I messed with to a different location and nuked my local copy 
(including the .git folder in that location). 

I have created my own (currently hidden) account on github.com, and have forked 
gnucash-docs. At least I think I did.

As I understand it, I should create a clone on my computer of some gnucash-docs 
repository (my github fork, or the main gnucash-docs repository? inquiring 
minds wish to know!). Then I should create many branches (I imagine one per 
chapter I am editing).

Assuming that I get that far (and that it’s the road I’m supposed to go down), 
I will see how much more trouble I can get into then. Assuming that I am 
starting over, John, can I use atlassian to carry out the steps you outlined 
here? 

David

P.S. I will admit to feeling quite gitty right now.

On Feb 10, 2015, at 6:58 AM, John Ralls jra...@ceridwen.us wrote:

 
 On Feb 10, 2015, at 2:52 AM, Geert Janssens geert.gnuc...@kobaltwit.be 
 wrote:
 
 On Tuesday 10 February 2015 09:17:29 Colin Law wrote:
 On 10 February 2015 at 05:36, David T. sunfis...@yahoo.com wrote:
 Thanks for the leads. I have been reading, but the descriptions of
 how it’s supposed to work aren’t matching my experience.
 Specifically, the manuals all talk about pushing changes onto the
 repository—but I don’t have push capabilities with the gnucash-docs
 repository. Thus, when I get errors about needing to push my
 changes, I don’t know how to get out of the situation.
 
 I'm happy to hear you're making progress in your documentation adventure.
 
 Push access to the main repositories is currently limited to a small set of 
 core developers. So 
 it's normal you get an error when you try to push your changes.
 
 My realm is
 “3 ahead”, and I cannot figure out how to proceed. I followed the
 prompts that said to stash my changes, but now I can’t locate the
 changes I want to submit for bug 693156. I see the changes in the
 files on my hard drive, so I know they are there, but for the life
 of me, I can’t figure out how to get git to get them.
 
 If your local branch is 3 commits ahead of origin (the upstream repository), 
 that means you 
 have successfully created 3 commits with the combination of git add/git 
 commit.
 
 To review what is actually in these commits, I usually fire up gitk from 
 within my local 
 repository directory. That allows me to visually inspect which changes I 
 made and whether they 
 are in a shape I want to send upstream.
 
 This may be worthwhile for you as well since these are your first steps and 
 perhaps you did 
 things you didn't intend.
 
 If you are satisfied with the way the commits are, you can execute
 
 git format-patch parent-branch
 
 parent-branch is the branch you originally started off from which I can't 
 deduce from your 
 mails. Most likely it should be origin/master in your case.
 
 This command will generate independent patch files, usually called 
 000x-something in the root of your local repository. These patch files can 
 then be attached to 
 a bug report.
 
 As for the stashed changes, Colin already explained how you can recall 
 those. You can also 
 display an overview of stashed changes using
 git stash --list
 
 In general stashing changes is only needed if you are in the middle of some 
 work you don't 
 deem good enough yet to commit, but need to set aside quickly to work on 
 something else first. 
 I wouldn't recommend it as the primary management mechanism in git.
 
 You're better of creating lots of branches. For example one branch for each 
 bug you are working 
 on. Unless the work on two bugs has big overlaps that is affecting the same 
 lines in the same 
 files. In that case you are probably better of doing those changes on the 
 same branch.
 
 One more potential pitfall: create your new branches when you have checked 
 out master, not 
 another branch.
 
 Perhaps you can post a screenshot of the gitk window - that would allow me 
 to give you much 
 more precise guidance.
 
 David,
 
 One more thing: Make a Github account and fork Gnucash/gnucash-docs into it. 
 That will give you a remote to push to and generate pull requests from. That 
 will save you having to make patches and upload them to BZ and will be easier 
 to review.
 
 You'll use
 git remote rename origin upstream
 git remote add origin git@github:youraccount/gnucash-docs.git
 to create the new remote. After the initial fork you'll need to periodically
 git checkout master
 git pull --rebase upstream master
 git checkout maint
 git pull --rebase upstream maint
 git push origin master maint
 to keep your github repository in sync with the canonical one. You'll also 
 push your change branches there.
 
 Geert's advice to make lots of branches is really good. Git works 

Re: Fun with Git

2015-02-11 Thread John Ralls

 On Feb 11, 2015, at 11:17 AM, David T. sunfis...@yahoo.com wrote:
 
 Well, ha ha, the joke’s on me, as the second patch I submitted wouldn’t go 
 through, because I have intervening crapola on my end. (Geert put it 
 differently in the bug).
 
 For me, the easiest way to back out is to start over, so I have copied the 
 three files I messed with to a different location and nuked my local copy 
 (including the .git folder in that location). 
 
 I have created my own (currently hidden) account on github.com, and have 
 forked gnucash-docs. At least I think I did.
 
 As I understand it, I should create a clone on my computer of some 
 gnucash-docs repository (my github fork, or the main gnucash-docs repository? 
 inquiring minds wish to know!). Then I should create many branches (I imagine 
 one per chapter I am editing).
 
 Assuming that I get that far (and that it’s the road I’m supposed to go 
 down), I will see how much more trouble I can get into then. Assuming that I 
 am starting over, John, can I use atlassian to carry out the steps you 
 outlined here? 
 
 David
 
 P.S. I will admit to feeling quite gitty right now.

David,

Yes, you can use SourceTree to do all of that.

At this point I'd suggest cloning your fork and adding the official repo as a 
second remote named upstream.

Be sure to create at least one new branch for your patches. That will prevent 
you from getting ahead of master or maint.
Since I imagine that you want your changes to appear in 2.6.6, you should 
branch off of maint, since that's what we'll need to merge them into.

Regards,
John Ralls




___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-10 Thread Colin Law
On 10 February 2015 at 05:36, David T. sunfis...@yahoo.com wrote:
 Thanks for the leads. I have been reading, but the descriptions of how it’s 
 supposed to work aren’t matching my experience. Specifically, the manuals all 
 talk about pushing changes onto the repository—but I don’t have push 
 capabilities with the gnucash-docs repository. Thus, when I get errors about 
 needing to push my changes, I don’t know how to get out of the situation. My 
 realm is “3 ahead”, and I cannot figure out how to proceed. I followed the 
 prompts that said to stash my changes, but now I can’t locate the changes I 
 want to submit for bug 693156. I see the changes in the files on my hard 
 drive, so I know they are there, but for the life of me, I can’t figure out 
 how to get git to get them.

To pick up your stashed changes again use
git stash apply
See http://git-scm.com/book/en/v1/Git-Tools-Stashing for a users
friendly discussion of stashing.

I don't know about your other question.  Are you supposed to push them
at all or are you just supposed to do your work on a local branch on
your PC and send off the patches for those with permissions to push?

Colin


 David

 On Feb 9, 2015, at 12:44 AM, Colin Law clan...@gmail.com wrote:

 On 8 February 2015 at 22:35, John Ralls jra...@ceridwen.us wrote:

 On Feb 7, 2015, at 3:41 PM, David T. sunfis...@yahoo.com wrote:

 OK, so, I am now duly anointed with Just Enough Knowledge in the GnuCash 
 documentation procedures to be dangerous. Woe is unto the Devel mailing 
 list, as I have run into a couple of Problems.

 Simply put, I have edited a number of sections in the Guide in response to 
 a number of bugs. I turned in a patch for one of those bugs (634181), but 
 I have other changes that I would like to send in. The patches affect 
 ch_oview.xml and ch_basics.xml. Following the commands in the wiki (git 
 commit -a) suggested that I was going to get a patch with all the changes 
 to both files, but I just wanted one file at a time. I tried “git commit 
 ch_oview.xml”, which seemed to set me up to create the one file patch, but 
 when I issue the next command prescribed in the wiki (“git pull —rebase”), 
 I get the following:

 dht-retina:C david$ git pull --rebase
 Cannot pull with rebase: You have unstaged changes.
 Please commit or stash them.

 I do not know how to proceed from this.

 Now it’s time for you to get dangerous with git. Github has a nice 
 collection of resources at 
 https://help.github.com/articles/good-resources-for-learning-git-and-github/;
  there’s also Scott Chacon’s excellent book at 
 http://git-scm.com/documentation.

 I also highly recommend Atlassian’s free (as in beer) Git GUI SourceTree 
 http://www.sourcetreeapp.com/ which makes tailoring commits really easy.

 The immediate answer to your question is `git add`: Use that to put 
 individual files into the index and `git commit` *without* the -a to commit 
 just the files in the index. You can use `git status` to show which files 
 are changed and which files are already in the index.

 Also I recommend git gui which shows a graphical interface showing the
 changes you have made allows you to mark the ones you want to commit
 and commit them.  Also gitk is nice for seeing the history.

 Colin


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-10 Thread Geert Janssens
On Tuesday 10 February 2015 09:17:29 Colin Law wrote:
 On 10 February 2015 at 05:36, David T. sunfis...@yahoo.com wrote:
  Thanks for the leads. I have been reading, but the descriptions of
  how it’s supposed to work aren’t matching my experience.
  Specifically, the manuals all talk about pushing changes onto the
  repository—but I don’t have push capabilities with the gnucash-docs
  repository. Thus, when I get errors about needing to push my
  changes, I don’t know how to get out of the situation.

I'm happy to hear you're making progress in your documentation adventure.

Push access to the main repositories is currently limited to a small set of 
core developers. So 
it's normal you get an error when you try to push your changes.

  My realm is
  “3 ahead”, and I cannot figure out how to proceed. I followed the
  prompts that said to stash my changes, but now I can’t locate the
  changes I want to submit for bug 693156. I see the changes in the
  files on my hard drive, so I know they are there, but for the life
  of me, I can’t figure out how to get git to get them.

If your local branch is 3 commits ahead of origin (the upstream repository), 
that means you 
have successfully created 3 commits with the combination of git add/git commit.

To review what is actually in these commits, I usually fire up gitk from 
within my local 
repository directory. That allows me to visually inspect which changes I made 
and whether they 
are in a shape I want to send upstream.

This may be worthwhile for you as well since these are your first steps and 
perhaps you did 
things you didn't intend.

If you are satisfied with the way the commits are, you can execute

  git format-patch parent-branch

parent-branch is the branch you originally started off from which I can't 
deduce from your 
mails. Most likely it should be origin/master in your case.

This command will generate independent patch files, usually called 
000x-something in the root of your local repository. These patch files can 
then be attached to 
a bug report.

As for the stashed changes, Colin already explained how you can recall those. 
You can also 
display an overview of stashed changes using
git stash --list

In general stashing changes is only needed if you are in the middle of some 
work you don't 
deem good enough yet to commit, but need to set aside quickly to work on 
something else first. 
I wouldn't recommend it as the primary management mechanism in git.

You're better of creating lots of branches. For example one branch for each bug 
you are working 
on. Unless the work on two bugs has big overlaps that is affecting the same 
lines in the same 
files. In that case you are probably better of doing those changes on the same 
branch.

One more potential pitfall: create your new branches when you have checked out 
master, not 
another branch.

Perhaps you can post a screenshot of the gitk window - that would allow me to 
give you much 
more precise guidance.

Geert
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-10 Thread John Ralls

 On Feb 10, 2015, at 12:11 PM, David T. sunfis...@yahoo.com wrote:
 
 Everyone,
 
 Thanks for the help. I have a lot of information to digest now, so I'm sure 
 I'll be back in a month or so... ;)
 
 FWIW, I know that I am not going to be pushing to gnucash-docs; I didn't know 
 how to get around the fact that I am ahead of the repository...
 

Make a branch with your changes. The easiest way is to rename the current 
branch and then make a new maint or master, whichever you’re currently on:
  git branch rename foo mybranch #Where foo is either maint or master
  git branch -t origin/foo foo #If you’ve already renamed your remotes, then 
you probably want to track upstream/master instead of origin/foo

Regards,
John Ralls


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-10 Thread John Ralls

 On Feb 10, 2015, at 2:52 AM, Geert Janssens geert.gnuc...@kobaltwit.be 
 wrote:
 
 On Tuesday 10 February 2015 09:17:29 Colin Law wrote:
 On 10 February 2015 at 05:36, David T. sunfis...@yahoo.com wrote:
 Thanks for the leads. I have been reading, but the descriptions of
 how it’s supposed to work aren’t matching my experience.
 Specifically, the manuals all talk about pushing changes onto the
 repository—but I don’t have push capabilities with the gnucash-docs
 repository. Thus, when I get errors about needing to push my
 changes, I don’t know how to get out of the situation.
 
 I'm happy to hear you're making progress in your documentation adventure.
 
 Push access to the main repositories is currently limited to a small set of 
 core developers. So 
 it's normal you get an error when you try to push your changes.
 
 My realm is
 “3 ahead”, and I cannot figure out how to proceed. I followed the
 prompts that said to stash my changes, but now I can’t locate the
 changes I want to submit for bug 693156. I see the changes in the
 files on my hard drive, so I know they are there, but for the life
 of me, I can’t figure out how to get git to get them.
 
 If your local branch is 3 commits ahead of origin (the upstream repository), 
 that means you 
 have successfully created 3 commits with the combination of git add/git 
 commit.
 
 To review what is actually in these commits, I usually fire up gitk from 
 within my local 
 repository directory. That allows me to visually inspect which changes I made 
 and whether they 
 are in a shape I want to send upstream.
 
 This may be worthwhile for you as well since these are your first steps and 
 perhaps you did 
 things you didn't intend.
 
 If you are satisfied with the way the commits are, you can execute
 
 git format-patch parent-branch
 
 parent-branch is the branch you originally started off from which I can't 
 deduce from your 
 mails. Most likely it should be origin/master in your case.
 
 This command will generate independent patch files, usually called 
 000x-something in the root of your local repository. These patch files can 
 then be attached to 
 a bug report.
 
 As for the stashed changes, Colin already explained how you can recall those. 
 You can also 
 display an overview of stashed changes using
 git stash --list
 
 In general stashing changes is only needed if you are in the middle of some 
 work you don't 
 deem good enough yet to commit, but need to set aside quickly to work on 
 something else first. 
 I wouldn't recommend it as the primary management mechanism in git.
 
 You're better of creating lots of branches. For example one branch for each 
 bug you are working 
 on. Unless the work on two bugs has big overlaps that is affecting the same 
 lines in the same 
 files. In that case you are probably better of doing those changes on the 
 same branch.
 
 One more potential pitfall: create your new branches when you have checked 
 out master, not 
 another branch.
 
 Perhaps you can post a screenshot of the gitk window - that would allow me to 
 give you much 
 more precise guidance.

David,

One more thing: Make a Github account and fork Gnucash/gnucash-docs into it. 
That will give you a remote to push to and generate pull requests from. That 
will save you having to make patches and upload them to BZ and will be easier 
to review.

You'll use
git remote rename origin upstream
git remote add origin git@github:youraccount/gnucash-docs.git
to create the new remote. After the initial fork you'll need to periodically
git checkout master
git pull --rebase upstream master
git checkout maint
git pull --rebase upstream maint
git push origin master maint
to keep your github repository in sync with the canonical one. You'll also push 
your change branches there.

Geert's advice to make lots of branches is really good. Git works amazingly 
well with branches, and branches provide a convenient point to make pull 
requests, so make at least a separate branch for each topic you're addressing 
and push each to Github. As soon as they're there we'll be able to look over 
your work and tell you if you're on the right track or if you need to change 
something, and we can do it line-by-line right in Github.

If you do all of your work in topic branches then you won't need to rebase your 
pulls from upstream.

Regards,
John Ralls


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-10 Thread John Ralls

 On Feb 10, 2015, at 3:38 PM, John Ralls jra...@ceridwen.us wrote:
 
 
 On Feb 10, 2015, at 12:11 PM, David T. sunfis...@yahoo.com wrote:
 
 Everyone,
 
 Thanks for the help. I have a lot of information to digest now, so I'm sure 
 I'll be back in a month or so... ;)
 
 FWIW, I know that I am not going to be pushing to gnucash-docs; I didn't 
 know how to get around the fact that I am ahead of the repository...
 
 
 Make a branch with your changes. The easiest way is to rename the current 
 branch and then make a new maint or master, whichever you’re currently on:
  git branch rename foo mybranch #Where foo is either maint or master
  git branch -t origin/foo foo #If you’ve already renamed your remotes, then 
 you probably want to track upstream/master instead of origin/foo
 

Sorry, that first command should be
  git branch -m foo mybranch

Regards,
John Ralls



___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-09 Thread Colin Law
On 8 February 2015 at 22:35, John Ralls jra...@ceridwen.us wrote:

 On Feb 7, 2015, at 3:41 PM, David T. sunfis...@yahoo.com wrote:

 OK, so, I am now duly anointed with Just Enough Knowledge in the GnuCash 
 documentation procedures to be dangerous. Woe is unto the Devel mailing 
 list, as I have run into a couple of Problems.

 Simply put, I have edited a number of sections in the Guide in response to a 
 number of bugs. I turned in a patch for one of those bugs (634181), but I 
 have other changes that I would like to send in. The patches affect 
 ch_oview.xml and ch_basics.xml. Following the commands in the wiki (git 
 commit -a) suggested that I was going to get a patch with all the changes to 
 both files, but I just wanted one file at a time. I tried “git commit 
 ch_oview.xml”, which seemed to set me up to create the one file patch, but 
 when I issue the next command prescribed in the wiki (“git pull —rebase”), I 
 get the following:

 dht-retina:C david$ git pull --rebase
 Cannot pull with rebase: You have unstaged changes.
 Please commit or stash them.

 I do not know how to proceed from this.

 Now it’s time for you to get dangerous with git. Github has a nice collection 
 of resources at 
 https://help.github.com/articles/good-resources-for-learning-git-and-github/; 
 there’s also Scott Chacon’s excellent book at 
 http://git-scm.com/documentation.

 I also highly recommend Atlassian’s free (as in beer) Git GUI SourceTree 
 http://www.sourcetreeapp.com/ which makes tailoring commits really easy.

 The immediate answer to your question is `git add`: Use that to put 
 individual files into the index and `git commit` *without* the -a to commit 
 just the files in the index. You can use `git status` to show which files are 
 changed and which files are already in the index.

Also I recommend git gui which shows a graphical interface showing the
changes you have made allows you to mark the ones you want to commit
and commit them.  Also gitk is nice for seeing the history.

Colin

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-09 Thread David T.
Thanks for the leads. I have been reading, but the descriptions of how it’s 
supposed to work aren’t matching my experience. Specifically, the manuals all 
talk about pushing changes onto the repository—but I don’t have push 
capabilities with the gnucash-docs repository. Thus, when I get errors about 
needing to push my changes, I don’t know how to get out of the situation. My 
realm is “3 ahead”, and I cannot figure out how to proceed. I followed the 
prompts that said to stash my changes, but now I can’t locate the changes I 
want to submit for bug 693156. I see the changes in the files on my hard drive, 
so I know they are there, but for the life of me, I can’t figure out how to get 
git to get them.

David

On Feb 9, 2015, at 12:44 AM, Colin Law clan...@gmail.com wrote:

 On 8 February 2015 at 22:35, John Ralls jra...@ceridwen.us wrote:
 
 On Feb 7, 2015, at 3:41 PM, David T. sunfis...@yahoo.com wrote:
 
 OK, so, I am now duly anointed with Just Enough Knowledge in the GnuCash 
 documentation procedures to be dangerous. Woe is unto the Devel mailing 
 list, as I have run into a couple of Problems.
 
 Simply put, I have edited a number of sections in the Guide in response to 
 a number of bugs. I turned in a patch for one of those bugs (634181), but I 
 have other changes that I would like to send in. The patches affect 
 ch_oview.xml and ch_basics.xml. Following the commands in the wiki (git 
 commit -a) suggested that I was going to get a patch with all the changes 
 to both files, but I just wanted one file at a time. I tried “git commit 
 ch_oview.xml”, which seemed to set me up to create the one file patch, but 
 when I issue the next command prescribed in the wiki (“git pull —rebase”), 
 I get the following:
 
 dht-retina:C david$ git pull --rebase
 Cannot pull with rebase: You have unstaged changes.
 Please commit or stash them.
 
 I do not know how to proceed from this.
 
 Now it’s time for you to get dangerous with git. Github has a nice 
 collection of resources at 
 https://help.github.com/articles/good-resources-for-learning-git-and-github/;
  there’s also Scott Chacon’s excellent book at 
 http://git-scm.com/documentation.
 
 I also highly recommend Atlassian’s free (as in beer) Git GUI SourceTree 
 http://www.sourcetreeapp.com/ which makes tailoring commits really easy.
 
 The immediate answer to your question is `git add`: Use that to put 
 individual files into the index and `git commit` *without* the -a to commit 
 just the files in the index. You can use `git status` to show which files 
 are changed and which files are already in the index.
 
 Also I recommend git gui which shows a graphical interface showing the
 changes you have made allows you to mark the ones you want to commit
 and commit them.  Also gitk is nice for seeing the history.
 
 Colin


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Fun with Git

2015-02-08 Thread John Ralls

 On Feb 7, 2015, at 3:41 PM, David T. sunfis...@yahoo.com wrote:
 
 OK, so, I am now duly anointed with Just Enough Knowledge in the GnuCash 
 documentation procedures to be dangerous. Woe is unto the Devel mailing list, 
 as I have run into a couple of Problems.
 
 Simply put, I have edited a number of sections in the Guide in response to a 
 number of bugs. I turned in a patch for one of those bugs (634181), but I 
 have other changes that I would like to send in. The patches affect 
 ch_oview.xml and ch_basics.xml. Following the commands in the wiki (git 
 commit -a) suggested that I was going to get a patch with all the changes to 
 both files, but I just wanted one file at a time. I tried “git commit 
 ch_oview.xml”, which seemed to set me up to create the one file patch, but 
 when I issue the next command prescribed in the wiki (“git pull —rebase”), I 
 get the following:
 
 dht-retina:C david$ git pull --rebase
 Cannot pull with rebase: You have unstaged changes.
 Please commit or stash them.
 
 I do not know how to proceed from this.

Now it’s time for you to get dangerous with git. Github has a nice collection 
of resources at 
https://help.github.com/articles/good-resources-for-learning-git-and-github/; 
there’s also Scott Chacon’s excellent book at http://git-scm.com/documentation.

I also highly recommend Atlassian’s free (as in beer) Git GUI SourceTree 
http://www.sourcetreeapp.com/ which makes tailoring commits really easy.

The immediate answer to your question is `git add`: Use that to put individual 
files into the index and `git commit` *without* the -a to commit just the files 
in the index. You can use `git status` to show which files are changed and 
which files are already in the index.

Regards,
John Ralls


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Fun with Git

2015-02-07 Thread David T.
OK, so, I am now duly anointed with Just Enough Knowledge in the GnuCash 
documentation procedures to be dangerous. Woe is unto the Devel mailing list, 
as I have run into a couple of Problems.

Simply put, I have edited a number of sections in the Guide in response to a 
number of bugs. I turned in a patch for one of those bugs (634181), but I have 
other changes that I would like to send in. The patches affect ch_oview.xml and 
ch_basics.xml. Following the commands in the wiki (git commit -a) suggested 
that I was going to get a patch with all the changes to both files, but I just 
wanted one file at a time. I tried “git commit ch_oview.xml”, which seemed to 
set me up to create the one file patch, but when I issue the next command 
prescribed in the wiki (“git pull —rebase”), I get the following:

dht-retina:C david$ git pull --rebase
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.

I do not know how to proceed from this.

TIA,
David
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel