Tiny Core Linux
General TC => Programming & Scripting - Unofficial => Topic started by: nick65go on March 06, 2023, 02:57:20 PM
-
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.
-
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.
-
>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
I am not a programmer, so I do not know.
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
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
afair
to download and install git in core its possible to use
tce-load -iw git
** 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
-
I created also a git account.
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*
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" ;
this should/will be pre-configured with the Xhub / $user / $project URL as the "git remote" (used for git push / pull )
# https://stackoverflow.com/questions/10183724/list-of-remotes-for-a-git-repository
#list of any configured remote URLs
git remote -v
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
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
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 :)
-
@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.
-
I do not intent to "fork" a project.
as greg mentioned above
But as you don't have write access to the git repository, I think you need to fork it first.
... having a git account (unless you mean a local user called git ?)
would imho usually mean working with the account server and other account-having-users
any who
idk if any one might find this script useful / interesting ...
https://github.com/whiteinge/ok.sh - A Bourne shell GitHub API client library focused on interfacing with shell scripts
https://github.com/whiteinge/ok.sh/blob/master/ok.sh
https://raw.githubusercontent.com/whiteinge/ok.sh/master/ok.sh #plain-texta
perhaps some section idea of the script in quot above might inspire similar scripts for other git hosts ...
https://github.com/search?p=5&q=tinycorelinux&type=Repositories
it seams used by some projects relevant to tcl.
-
Here are one more link to learn git.
https://rogerdudler.github.io/git-guide/
-
Thank you very much.
Everything started when juanito suggested to put my small patch on git for tinycore; git was an alien word for me.
Looking at the overwhelming majority of information, I think I have bitten off more than I can swallow.
I don't think it's what I imagined at the beginning.
But it's good that we have all the information gathered in one post, easy to digest later, for amateurs like me.
-
Even though IANAP, I find git to be absolutely essential for software development.
It really was an OMG moment, "how did I not know about this!".
For me, it did require a bit of effort. I can only do basic day to day git operations.
-
I don't think it's what I imagined at the beginning.
begging the question what was your initial impression ?
afaik ! (g)its yan-dvcs
https://en.wikipedia.org/wiki/Distributed_version_control
..with fast(er) branching (i read some place today)
-
Here are one more link to learn git.
https://rogerdudler.github.io/git-guide/
+
http://travistidwell.com/blog/2014/06/11/fun-with-git-and-awk/
;D
-
What you'll usually need
1. Use the web browser to fork a project into your account.
2. Clone it to your local storage
git clone git@github.com:your_user_name/the_project.git
Note that you'll need to setup ssh access to github as they have changed their policy years ago.
3. Do your coding...
4. Check your status
git status
5. Save your changes
git add -A
6. Keep coding...
7. You blow up something and you want to discard the changes
git restore your_file
8. More coding...
9. All done, ready to upload
git add -A
git diff --cached # just to double check
git commit -m "some message about your change"
git push # upload to github
10. Open your browser, navigate to your latest commit and send a pull request.
11. Wait for someone to review and merge / reject your work.