Difference between pages "Git Merging Guide" and "Package:Sublime Text Editor"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
This page is here to show Funtoo Linux developers different techniques that can be used to merge various things.
{{Ebuild
|Summary=Sublime Text is an advanced commercial text editor.
|CatPkg=app-editors/sublime-text
|Maintainer=Oleg,
|Homepage=http://sublimetext.com
}}
Sublime Text is a very complete text editor with lots of features, and support for plugins. It's free, but often shows a popup showing that's unregistered, so you can purchase the license for USD$70.


== Comparing Experimental and Master ==
== Install ==
First, you must have installed [[Package:Layman|Layman]] with Git support. Then, add the overlay ''sublime-text'':


The best way to get a quick and dirty understanding of the differences between experimental and master is to do this:
<console>###i## layman -a sublime-text</console>


<console>
Now, install the version you want. For the version 2:
# ##i##cd /root/git/funtoo-overlay
<console>###i## emerge -av sublime-text:2</console>
# ##i##git diff --stat origin/master origin/experimental
</console>


This will show a summary of what modifications where made on a file-by-file basis.
For the version 3 (default):
<console>###i## emerge -av sublime-text:3</console>


== Package Replacement: Funtoo Overlay (branch to branch) ==
You can have installed both versions, so you must install it with the USE flag ''multislot'', that also brings the package eselect-sublime.
 
{{EbuildFooter}}
When merging in funtoo-overlay, we might want to merge things from experimental to master. To do this, first pick a specific package to compare changes:
 
<console>
# ##i##cd /root/git/funtoo-overlay
# ##i##git diff --stat origin/master origin/experimental app-shells/bash
app-shells/bash/bash-3.1_p17.ebuild  |  150 -------------------------
app-shells/bash/bash-3.2_p51.ebuild  |  199 ---------------------------------
app-shells/bash/bash-4.0_p37.ebuild  |  193 --------------------------------
app-shells/bash/bash-4.0_p38.ebuild  |  193 --------------------------------
app-shells/bash/bash-4.1_p10.ebuild  |  191 -------------------------------
app-shells/bash/bash-4.1_p7-r1.ebuild |  189 -------------------------------
app-shells/bash/bash-4.1_p9-r1.ebuild |  189 -------------------------------
app-shells/bash/bash-4.2_p10.ebuild  |    5 +-
8 files changed, 2 insertions(+), 1307 deletions(-)</console>
 
The "----" in the diff above shows that several ebuilds were removed ("----" means many lines were removed) in the experimental branch, and <tt>bash-4.2_p10.ebuild</tt> had slight modifications. This looks like a good candidate for grabbing from experimental to replace entirely what is in master. Here's an example of something that is ''not'' a good candidate for a wholesale replacement:
 
<console>
# ##i##git diff --stat origin/master origin/experimental sys-apps/pciutils
sys-apps/pciutils/Manifest                        |    3 -
sys-apps/pciutils/files/conf.d-pciparm            |  28 -------
sys-apps/pciutils/files/init.d-pciparm            |  80 --------------------
.../files/pciutils-3.1.4-install-lib.patch        |  40 ----------
sys-apps/pciutils/files/pciutils-3.1.7-fbsd.patch  |  11 ---
.../files/pciutils-3.1.7-install-lib.patch        |  41 ----------
.../pciutils-3.1.8-avoid-segfault-on-init.patch    |  16 ----
sys-apps/pciutils/files/pciutils.cron              |    2 -
sys-apps/pciutils/pciutils-3.1.8-r1.ebuild        |  76 -------------------
9 files changed, 0 insertions(+), 297 deletions(-)
</console>
 
In this example above, <tt>sys-apps/pciutils</tt> had a lot of cleanups in experimental, but the output above indicates that there is a new <tt>pciutils-3.1.8-1.ebuild</tt> in master that is not experimental. If we replace what is in master with that in experimental, we will lose the new ebuild! So we wouldn't want to do a wholesale replacement in this case. Old ebuilds that disappear are cleanups, but new ebuilds that disappear are not. Be sure to pay attention to whether the ebuilds that are being removed are old or new.
 
Back to our bash example. To inspect changes in more detail to make sure they are acceptable, specify the modified ebuild directly and drop the <tt>--stat</tt> option:
 
<console>
# ##i##git diff origin/master origin/experimental app-shells/bash/bash-4.2_p10.ebuild
diff --git a/app-shells/bash/bash-4.2_p10.ebuild b/app-shells/bash/bash-4.2_p10.ebuild
index 0c497ea..e603c15 100644
--- a/app-shells/bash/bash-4.2_p10.ebuild
+++ b/app-shells/bash/bash-4.2_p10.ebuild
@@ -37,7 +37,7 @@ SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)
LICENSE="GPL-3"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+KEYWORDS="*"
IUSE="afs bashlogger examples mem-scramble +net nls plugins vanilla"
DEPEND=">=sys-libs/ncurses-5.2-r2
@@ -69,7 +69,6 @@ src_unpack() {
        cd lib/readline
        [[ ${READLINE_PLEVEL} -gt 0 ]] && epatch $(patches -s ${READLINE_PLEVEL} readline ${READLINE_VER})
        cd ../..
-     
        epatch "${FILESDIR}"/${PN}-4.1-document-system-bashrc.patch
}
@@ -104,7 +103,7 @@ src_compile() {
        myconf="${myconf} --with-curses"
        myconf="${myconf} --without-lispdir" #335896
-     
+
        use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
        econf \
                $(use_with afs) \
</console>
 
OK, these look like changes we want to merge into the master branch. Actually, we want to basically 'adopt' all these bash changes into master -- a wholesale import so that <tt>app-shells/bash</tt> in master looks exactly like that in experimental. To do this, we want to wipe out what is currently in the master branch related to <tt>app-shells/bash</tt>, and replace it entirely with the exact contents of <tt>app-shells/bash</tt> in the experimental branch.
 
This can be done as follows:
 
<console>
# ##i##git rm -rf app-shells/bash
# ##i##git checkout origin/experimental -- app-shells/bash
</console>
 
Now, let's review the changes git made. These are not yet committed:
<console>
# ##i##git diff --cached --stat
app-shells/bash/bash-3.1_p17.ebuild  |  150 -------------------------
app-shells/bash/bash-3.2_p51.ebuild  |  199 ---------------------------------
app-shells/bash/bash-4.0_p37.ebuild  |  193 --------------------------------
app-shells/bash/bash-4.0_p38.ebuild  |  193 --------------------------------
app-shells/bash/bash-4.1_p10.ebuild  |  191 -------------------------------
app-shells/bash/bash-4.1_p7-r1.ebuild |  189 -------------------------------
app-shells/bash/bash-4.1_p9-r1.ebuild |  189 -------------------------------
app-shells/bash/bash-4.2_p10.ebuild  |    5 +-
8 files changed, 2 insertions(+), 1307 deletions(-)
</console>
 
Looks good. These changes are already staged for commit -- notice the <tt>--cached</tt> option above. If you don't use <tt>--cached</tt>, you won't see any changes, because they're already cached for commit. Let's commit them:
 
<console>
# ##i##git commit -m "bash updates from experimental"
# ##i##git push origin master
</console>
 
If we made any local changes to existing files that had not yet been added, and wanted to include those with the commit, we could use the <tt>-a</tt> option with <tt>git commit</tt>, above. Once the commit has been made, you should no longer see anything related to <tt>app-shells/bash</tt> listed when doing a diff of the branches.
 
[[Category:Development]]
[[Category:Featured]]
[[Category:Tutorial]]

Latest revision as of 04:52, January 3, 2015

Sublime Text Editor

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Sublime Text is a very complete text editor with lots of features, and support for plugins. It's free, but often shows a popup showing that's unregistered, so you can purchase the license for USD$70.

Install

First, you must have installed Layman with Git support. Then, add the overlay sublime-text:

root # layman -a sublime-text

Now, install the version you want. For the version 2:

root # emerge -av sublime-text:2

For the version 3 (default):

root # emerge -av sublime-text:3

You can have installed both versions, so you must install it with the USE flag multislot, that also brings the package eselect-sublime.