General TC > Programming & Scripting - Unofficial
tips / lessons for patch submited from git
nick65go:
Hi, is any experienced programmer here, willing to spare a little time to teach the summary of submitting patches from git?
I am not a programmer, so I do not know. But it will be interesting to know.
I can use " diff -U0 file.old file.new > x.diff "; I created also a git account. And then?
How to comment /open an issue? How to upload the patch, where, from where? How to ask for it to be approved / pulled / pushed into other person git?
YouTube links to learn by example will be nice also. Because reading tens of pages for a simple task is ... not productive, or my patience is low.
Greg Erskine:
IANAP but I use git. I usually have write access to my git repositories so the process is a little different.
But as you don't have write access to the git repository, I think you need to fork it first.
You don't generate diff files manually, git handles all that for you.
You can use the git(hub) web interface, or use a git client on your local computer. The git clients can be CLI or have a graphics interface. I use SmartGIT on Windows 10.
mocore:
>Hi, is any experienced programmer here,
all though i :'( fail to meat this criteria , ... i do have access to a keyboard ( non midi ) , and once mapped some samples on a akai
--- Quote from: nick65go on March 06, 2023, 02:57:20 PM ---I am not a programmer, so I do not know.
--- End quote ---
generally i see these kind of statement/assertions written hear and there on the web... (and wander what they are raven about https://en.wikipedia.org/wiki/Raven_paradox )
??? do all programmers know git ?...
any way ;)
to answer the subject of this topic generally where x = git ; how to do y with x
hear is a link to a quick reference for the git command line tool which (hopefully) might be usefull to answer this AND similar questions
^---> ** https://learnxinyminutes.com/docs/git/
specifically wrt your question / specified work flow : "using git to create a diff"
this is the relevant section from the above link
--- Quote ---diff
Shows differences between a file in the working directory, index and commits.
# Show difference between your working dir and the index
$ git diff
# Show differences between the index and the most recent commit.
$ git diff --cached
# Show differences between your working dir and the most recent commit
$ git diff HEAD
--- End quote ---
afair
to download and install git in core its possible to use
--- Code: ---tce-load -iw git
--- End code ---
** the (markdown) plain text from the above link can be found/downloaded @ https://raw.githubusercontent.com/adambard/learnxinyminutes-docs/master/git.html.markdown
it is also view able @ https://github.com/adambard/learnxinyminutes-docs/blob/master/git.html.markdown marked up with html :o
mocore:
--- Quote from: nick65go on March 06, 2023, 02:57:20 PM --- I created also a git account.
--- End quote ---
there are many domains that you could create an account for git:// access ( git over http / https is also an option afaik)
with (afaik) hub lab and bucket being the most popular(ised)
ftr : hear https://en.wikipedia.org/wiki/Comparison_of_source-code-hosting_facilities is a list .
to contribute to *some project* hosted on Xhub an account at Xhub could be useful
once you have an account
you can fork the project
git clone a local copy of (your fork of)*some project*
--- Code: ---project_url=https://Xhub.com/*Xhub-user-name*/*some project fork url*
# when you don't need the full project history use the
# --depth 1 argument
# to
# shallow clone - faster cloning that pulls only latest snapshot
$ git clone --depth 1 "$project_url" ;
--- End code ---
this should/will be pre-configured with the Xhub / $user / $project URL as the "git remote" (used for git push / pull )
--- Code: ---# https://stackoverflow.com/questions/10183724/list-of-remotes-for-a-git-repository
#list of any configured remote URLs
git remote -v
--- End code ---
to let (any) git (client) authenticate (as your user account)
its usually possible to create an access token for a user (or project , if implemented by what ever git repo/host )
a token is like a temporary revocable password , user / token
once you have a token granting access to the remote
pick a method to give the git client access to your token
one way to let programs access relevant auth info is the ".netrc" file
an example .netrc
@ https://gist.github.com/technoweenie/1072829?permalink_comment_id=1503529
--- Code: ---machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
--- End code ---
many other methods are available : https://coolaj86.com/articles/vanilla-devops-git-credentials-cheatsheet/
im shore i have fudged / omitted some subtle but important detail(s) ...
perhaps the above has enough gist to spare the op/others afew pages of scrolling :)
nick65go:
@mocore: many thanks!
I intended to emphasize more on words like "willing to spare a little time", and less on "experienced programmer" part. Instinctively I avoid (if I can) anything owned by M$soft (like github).
I do not intent to "fork" a project. I was just trying to contribute a little back. To make a small diff text file and send it; Not caring about fame/ ranking while using a nick-name.
My philosophy is to not complicate my life with things that I would not use often.
Navigation
[0] Message Index
[#] Next page
Go to full version