Re: [U-Boot] Question about patches
On 7/20/2010 12:25 PM, Fabio Giovagnini wrote: Hi all, for sending a patch do I need to have on my PC two u-bbot tree, one original obtaned by git command, and another to make the modifications? Or can I produce the patches using the original tree resident on git server? Ciao Fabio, You can use git format patch command to produce numbered patches You can google it to know more Regards Vipin Thanks ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
Hi Vipin, I'm not so smart in diff / patch and git tools usage. Could be so kind to write to me how to build a patch for just one file I have modified in driver/mtd directory of u-boot? Thanks in advange and sorry for my request, but I read on the net and nothing appeared to be usfull. Thanks and sorry again In data martedì 20 luglio 2010 09:00:39, Vipin KUMAR ha scritto: : On 7/20/2010 12:25 PM, Fabio Giovagnini wrote: Hi all, for sending a patch do I need to have on my PC two u-bbot tree, one original obtaned by git command, and another to make the modifications? Or can I produce the patches using the original tree resident on git server? Ciao Fabio, You can use git format patch command to produce numbered patches You can google it to know more Regards Vipin Thanks -- Fabio Giovagnini Aurion s.r.l. P.I e C.F. 00885711200 skype: aurion.giovagnini Tel. +39.051.594.78.24 Cell. +39.335.83.50.919 www.aurion-tech.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
Hi Fabio 1. git clone git://git.denx.de/u-boot.git u-boot.upstream 2. cd u-boot.upstream/ 3. echo /* just for git test */ driver/mtd/dataflash.c 4. git diff 5. git commit -a -s -m this patch is for test 6. git format-patch -1 then you will got a 0001-***.patch file. On 07/20/2010 03:39 PM, Fabio Giovagnini wrote: Hi Vipin, I'm not so smart in diff / patch and git tools usage. Could be so kind to write to me how to build a patch for just one file I have modified in driver/mtd directory of u-boot? Thanks in advange and sorry for my request, but I read on the net and nothing appeared to be usfull. Thanks and sorry again In data martedì 20 luglio 2010 09:00:39, Vipin KUMAR ha scritto: : On 7/20/2010 12:25 PM, Fabio Giovagnini wrote: Hi all, for sending a patch do I need to have on my PC two u-bbot tree, one original obtaned by git command, and another to make the modifications? Or can I produce the patches using the original tree resident on git server? Ciao Fabio, You can use git format patch command to produce numbered patches You can google it to know more Regards Vipin Thanks -- Best Regards Xiangfu Liu http://www.openmobilefree.net ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
Many thanks to you and everybody Cheers In data martedì 20 luglio 2010 09:52:50, Xiangfu Liu ha scritto: : Hi Fabio 1. git clone git://git.denx.de/u-boot.git u-boot.upstream 2. cd u-boot.upstream/ 3. echo /* just for git test */ driver/mtd/dataflash.c 4. git diff 5. git commit -a -s -m this patch is for test 6. git format-patch -1 then you will got a 0001-***.patch file. On 07/20/2010 03:39 PM, Fabio Giovagnini wrote: Hi Vipin, I'm not so smart in diff / patch and git tools usage. Could be so kind to write to me how to build a patch for just one file I have modified in driver/mtd directory of u-boot? Thanks in advange and sorry for my request, but I read on the net and nothing appeared to be usfull. Thanks and sorry again In data martedì 20 luglio 2010 09:00:39, Vipin KUMAR ha scritto: : On 7/20/2010 12:25 PM, Fabio Giovagnini wrote: Hi all, for sending a patch do I need to have on my PC two u-bbot tree, one original obtaned by git command, and another to make the modifications? Or can I produce the patches using the original tree resident on git server? Ciao Fabio, You can use git format patch command to produce numbered patches You can google it to know more Regards Vipin Thanks -- Fabio Giovagnini Aurion s.r.l. P.I e C.F. 00885711200 skype: aurion.giovagnini Tel. +39.051.594.78.24 Cell. +39.335.83.50.919 www.aurion-tech.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
On 7/20/2010 1:09 PM, Fabio Giovagnini wrote: Hi Vipin, I'm not so smart in diff / patch and git tools usage. Could be so kind to write to me how to build a patch for just one file I have modified in driver/mtd directory of u-boot? Thanks in advange and sorry for my request, but I read on the net and nothing appeared to be usfull. No problems. It takes a little time to get used to git but then you start liking it. Anyway you can create a patch for each commit. You can see a summary of commits via git log Basically you need to run git format-patch -n reference reference is a branch name or tag or a direct reference to commit from which you want to create patches eg git format-patch -n origin/master would create numbered patches for commits after the commit pointed to by origin/master Also, run gitk --all -1000 to get an understanding of what exactly is happening in the background when you commit a change Hope this helps a little Vipin Thanks and sorry again In data martedì 20 luglio 2010 09:00:39, Vipin KUMAR ha scritto: : On 7/20/2010 12:25 PM, Fabio Giovagnini wrote: Hi all, for sending a patch do I need to have on my PC two u-bbot tree, one original obtaned by git command, and another to make the modifications? Or can I produce the patches using the original tree resident on git server? Ciao Fabio, You can use git format patch command to produce numbered patches You can google it to know more Regards Vipin Thanks ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
No problems. It takes a little time to get used to git but then you start liking it. Anyway you can create a patch for each commit. You can see a summary of commits via git log Basically you need to run git format-patch -n reference reference is a branch name or tag or a direct reference to commit from which you want to create patches eg git format-patch -n origin/master would create numbered patches for commits after the commit pointed to by origin/master Also, run gitk --all -1000 to get an understanding of what exactly is happening in the background when you commit a change Hope this helps a little I would also recommend looking at 'Stacked Git' (stgit) - It is basically a wrapper around it which allows you to manage a set of patches and move back and forth between them, merge, re-order etc. It makes life a lot easier when you make a mess of things :) Regards, Graeme ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
Dear Fabio Giovagnini, In message 201007200855.01581.fabio.giovagn...@aurion-tech.com you wrote: for sending a patch do I need to have on my PC two u-bbot tree, one original obtaned by git command, and another to make the modifications? No. You can work in a single tree, for example by using one or more development branches. Try to read one of the available introductions into git. Or can I produce the patches using the original tree resident on git server? There is no such thing as a git server. Each copy of the git repository is complete and independent - kind of it's own server. Once you have cloned the repository somewhere, you can work independently. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If something is different, it's either better or worse, and usually both.- Larry Wall ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
Dear Graeme Russ, In message aanlktil1czc80pisucnoxqk0lvhftudbwvnnsoz9c...@mail.gmail.com you wrote: I would also recommend looking at 'Stacked Git' (stgit) - It is basically a wrapper around it which allows you to manage a set of patches and move back and forth between them, merge, re-order etc. It makes life a lot easier when you make a mess of things :) What exactly can stgit do that cannot be done with a number of branches and git rebase -i ? [Sorry for the stupid question, but I haven't used stgit yet...] Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de We have phasers, I vote we blast 'em! -- Bailey, The Corbomite Maneuver, stardate 1514.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
On Tue, Jul 20, 2010 at 7:52 PM, Wolfgang Denk w...@denx.de wrote: Dear Graeme Russ, In message aanlktil1czc80pisucnoxqk0lvhftudbwvnnsoz9c...@mail.gmail.com you wrote: I would also recommend looking at 'Stacked Git' (stgit) - It is basically a wrapper around it which allows you to manage a set of patches and move back and forth between them, merge, re-order etc. It makes life a lot easier when you make a mess of things :) What exactly can stgit do that cannot be done with a number of branches and git rebase -i ? [Sorry for the stupid question, but I haven't used stgit yet...] Probably nothing, but it is more straightforward Lets say you are working on a branch, say 'Testing' git checkout testing stg new (opens an editor, allows you to write up a commit message) edit stg refresh stg new / edit / stg refresh (as many as you like) Now you will have a bunch of commits, but maybe they are in the wrong order eg [arch commit 1] [common commit 1] [arch commit 2] [board commin 1] [arch commit 3] etc, etc you can then use stg pop/push/merge to re-arrange and merge commits together to get them in a more logical arrangement before submitting Sometimes when I'm in the middle of a very long development session I tend to end up with one 'big patch' which has multiple logical change units. In this case, you can pop the 'big patch', insert a new smaller patch implementing some of the 'big patch' then when you push the 'big patch', all the duplicate changes are stripped. So you can basically whittle down a big, complex commit into multiple smaller commits very easily. I'm sure you'll argue that this is poor development management, but I find myself more efficient if a 'get in the zone' and then go back and break things up. It also serves as a really good self imposed code review It also has some inter-branch managment commands I have never used Regards, Graeme ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
Dear Graeme Russ, In message aanlktilaj7mvv7vxxrebkccszyszvsqulk_3i5ahl...@mail.gmail.com you wrote: Now you will have a bunch of commits, but maybe they are in the wrong order ... you can then use stg pop/push/merge to re-arrange and merge commits together to get them in a more logical arrangement before submitting With git rebase -i I get an editor started like this: pick 3e9b349 NAND: show manufacturer and device ID for unknown chips pick 1445f6f NAND: add Toshiba TC58NVG0 identifier pick bc1a884 mtd: nand_plat: add simple GPIO framework DEV_READY option pick 67ceefa Blackfin: convert plat-nand code to GPIO framework pick c9f7351 NAND: environment offset in OOB (CONFIG_ENV_OFFSET_OOB) pick 53504a2 NAND: formatting cleanups from env.oob support ... # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like squash, but discard this commit's log message I can reorder, drop, combine (squash), edit patches... Sometimes when I'm in the middle of a very long development session I tend to end up with one 'big patch' which has multiple logical change units. In this case, you can pop the 'big patch', insert a new smaller patch implementing some of the 'big patch' then when you push the 'big patch', all the duplicate changes are stripped. So you can basically whittle down a big, complex commit into multiple smaller commits very easily. We can use git add -i to do this as well. You can even split hunks to add them to different commits. I'm sure you'll argue that this is poor development management, but I find myself more efficient if a 'get in the zone' and then go back and break things up. It also serves as a really good self imposed code review No, I don't argue. I'm trying to undestand. I am well aware that there are many tools for the same tasks, and the most efficient ones are these you know well, so vi is probably much more eficient to me than your favorite editor is to you. But I always like at least to know what the tools can do that I don't use or don't know that well - sometimes - sometimes i's time to make room in the toolbox for a new tool or another :-) Thanks! Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Engineering without management is art. - Jeff Johnson ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
Hi (share my info :) I am always use stg like this: for example there are three commit: commit1, commit2, commit3, then I edit file: a.c, b.c, c.c and I want a.c goto commit1. b.c goto commit2. c.c goto commit3. then stg refresh a.c -p commit1 stg refresh b.c -p commit2 stg refresh c.c -p commit3 I know this is not good. because this may lose change history. but I use this for create patches for OpenWrt system. On 07/20/2010 08:59 PM, Wolfgang Denk wrote: Dear Graeme Russ, In messageaanlktilaj7mvv7vxxrebkccszyszvsqulk_3i5ahl...@mail.gmail.com you wrote: Now you will have a bunch of commits, but maybe they are in the wrong order ... you can then use stg pop/push/merge to re-arrange and merge commits together to get them in a more logical arrangement before submitting With git rebase -i I get an editor started like this: pick 3e9b349 NAND: show manufacturer and device ID for unknown chips pick 1445f6f NAND: add Toshiba TC58NVG0 identifier pick bc1a884 mtd: nand_plat: add simple GPIO framework DEV_READY option pick 67ceefa Blackfin: convert plat-nand code to GPIO framework pick c9f7351 NAND: environment offset in OOB (CONFIG_ENV_OFFSET_OOB) pick 53504a2 NAND: formatting cleanups from env.oob support ... # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like squash, but discard this commit's log message -- Best Regards Xiangfu Liu http://www.openmobilefree.net ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Question about patches
On Tue, Jul 20, 2010 at 10:59 PM, Wolfgang Denk w...@denx.de wrote: Dear Graeme Russ, In message aanlktilaj7mvv7vxxrebkccszyszvsqulk_3i5ahl...@mail.gmail.com you wrote: I'm sure you'll argue that this is poor development management, but I find myself more efficient if a 'get in the zone' and then go back and break things up. It also serves as a really good self imposed code review No, I don't argue. I'm trying to undestand. I am well aware that there are many tools for the same tasks, and the most efficient ones are these you know well, so vi is probably much more eficient to me than your favorite editor is to you. But I always like at least to know what the tools can do that I don't use or don't know that well - sometimes - sometimes i's time to make room in the toolbox for a new tool or another :-) Knowing what tools others use (and those tools influence how people work) is very helpful in understanding how and why people do what they do You have a very good grip on git, and I would suggest stg is not really going to make your life any easier. I know only a few git commands, so stg is good for me. Who knows, over time I may get to know git well enough to not need stg any more ;) -- Graeme ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot