0
Igor

Git handling

Recommended Posts

Is there any simple way that we automatically produce a patch of changes made to the (kernel / uboot) source? Of course also if files are added.

Share this post


Link to post
Share on other sites

@Igor

 

Then you have to commit existing changes before that to create a reference point to differentiate one patch set from another.

 

To make a commit in new git environment you will have to pass some dummy author and email for "git commit" command.

Share this post


Link to post
Share on other sites

Well, longsleep suggested using Quilt a while ago (haven't looked into myself yet)

I saw this. I've read quilt documentation, and if I understood it correctly, quilt requires explicit configuration in order to work, so simple "drop patch file in a directory and it will be picked up automatically in LC_ALL=C sorting order" and overriding base patches by placing file with same name in userpatches will not work without extra configuration. Current stateless patching code is simple but easy to understand and easy to work with IMO.

Share this post


Link to post
Share on other sites

I came out with this solution:

# define this @start
git config --global user.name 'John Doe' 
git config --global user.email johndoe@somedomain.com

# at source tree
git add .
git diff --staged > userpatches/$family-$unixtime.patch.disabled

# check if there are changes
if  patch not empty echo "There was changes"
        patch is here ->
        do you want to include it into build?
        yes -> enable ()
fi
# go back 
git reset --soft HEAD~ 

# after each compile execute this at source
find . -name \*.rej | xargs rm -f
git add .
git commit

Share this post


Link to post
Share on other sites
# after each compile execute this at source
find . -name \*.rej | xargs rm -f
git add .
git commit

What is the point of this? Am I missing something? We are resetting sources on each compilation, so this will only add useless commits to git history.

Share this post


Link to post
Share on other sites

Main point is to create a patch if sources has been changed manually, on the next run.

 

This must be under some switch of course - "developer / debug mode". Now we have this:

 

FORCE_CHECKOUT="yes"                                    # ignore manual changes to source

 

but if set to "NO" it of course does not work if we run patch series once again. And we need to extract our manual change ...

Share this post


Link to post
Share on other sites

Then maybe do something like this

If this new parameter is set

# force checkout sources
# apply usual patches
# commit changes
echo "Now make your changes in $LINUXSOURCEDIR"
echo "Press <Enter> after you are done"
read
cd $LINUXSOURCEDIR
git add .
git diff --staged > $SRC/userpatches/patch/99-$LINUXFAMILY-$(date +'%d.%m.%Y').patch
echo "Grab your patch from $SRC/userpatches/patch/99-$LINUXFAMILY-$(date +'%d.%m.%Y').patch"
# proceed with compilation

Share this post


Link to post
Share on other sites

Speaking of git handling - why are we creating new working copy on each update instead of pulling changes into existing tree (I mean in case we are checking out branches, not tags)?

Not only "fetch_from_github" looks unnecessarily complicated, it also appears to be broken at least for sunxi-tools repository.

Share this post


Link to post
Share on other sites

Updating on shallow clone was not working properly.

 

Many times, when changes was made on remote, git pull was updating / downloading everything with whole history.

 

Perhaps better solution exists?

Share this post


Link to post
Share on other sites

OK.

 

It's also a good time to create a new tag before this / any major rework. Current system is building fine / without major flaws.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0