0
Igor

Git handling

Recommended Posts

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0