Jump to content

Git handling


Igor

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.

Link to comment
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

Link to comment
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 ...

Link to comment
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
Link to comment
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.

Link to comment
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?

Link to comment
Share on other sites

Perhaps better solution exists?

Perhaps: https://stackoverflow.com/a/19528379

 

I will try to rework Git handling either before new Armbian release or after, so there is enough time to test.

 

I would try to split the code for tags (safe to assume they don't need any update from remote logic) and branches (fetch with depth 1 if remote was updated).

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines