[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: howto produce a diff-files



Hi Kai-Martin,

On Mon, 2009-07-27 at 14:47 +0000, Kai-Martin Knaak wrote: 
> Hi.
> How would I produce a patch of my changes in the geda files to send to the 
> list? The geda wiki suggests: 
> 	git diff > name_of_patchfile
> http://geda.seul.org/wiki/geda:scm#format_a_patch_to_send_to_the_developers
> 

"git diff path/filename > name_of_diff_file"

would do the trick for a *git-diff* of a single file.

This produces not a file which can be easily applied to the upstream git
repo by someone with commit rights.

Best practice is to commit your changes to your local copy of the
upstream git repo and create patches with "git-format-patch" from the
local git-repo itself and send to the list or whomever by e-mail.

This way the author gets his/her honours as well as the committer
(upstream), these are the same if you have commit rights for the
upstream repo.

"man git-format-patch" is your friend ;) 

> However, this file includes not only my changes but also many, that seem 
> to be committed after I checked out my local copy. The "more complicated way"
> mentioned in the wiki puzzles me too. It suggests to use "git add -i" to 
> select the files I want to commit. 
> After "git add -i" I get a list of files and a number of commands:
> 	status
> 	update
> 	revert
> 	add untracked
> 	patch
> 	diff
> But no "select". 
> There seem to be two different kinds of changes detected by git. 
> 
> a) Changes I did locally to git registered files. These are the changes 
> I'd like to get a patch file from. 
> 
> b) Changes that appeared in HEAD after it I checked out.
> These changes should propagate to my local set of source files.
> 
> How would I achieve these conflicting goals? 
> 
> As you can see, I am still clueless how git works. Can you give a 
> concise explanation what staging means in this context? Is there
> a git HOWTO for dummies somewhere?
> 
> ---<(kaimartin>)---

What I have understand from git and staging is the following:

Edit a file and save on disk.

With git one can see what has changed, either with "git-status" or with
"git-diff" 

See the examples in "man git-diff"

Add *all* the changes of known files to the index (a.k.a. staging area) 
with "git-add path/filename" or create patchsets (preparing for a commit) 
in the interactive mode ("git-add -i") as you noticed above, each 
interactive session creating a patchset is followed by a "git-commit".

Subsequent adding to the index without committing, only updates the index 
and seperate patchsets maybe lost into one larger patchset.

See above for formatting patches of your local commits.

I do all this low level git stuff with "qgit", or the "git-gui" (usefull for 
amending the last commit you made, e.g. correcting a typo in the commit 
message or so).

Just my EUR 0.02 :)

Kind regards,

Bert Timmerman.






_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user