
To be honest, I’d probably just take the coward’s way out and make a copy of the file, switch to the dev branch, copy it into place and commit it. You’d lose the commit history within the branch, but if it was my work, I probably wouldn’t care...
On Nov 19, 2016, at 21:09 , Elisa Beshero-Bondar <ebbondar@gmail.com> wrote:
Syd— Tell me if I understand you about the problem and what’s not working:
1) You need to be able to identify files you’ve changed on sydb-occurs branch by comparing them against their counterparts on the dev. And you’ve figured that out—problem solved, right? 2) You know you only want to merge one or two specific files in sydb-occurs into dev., and you’re having trouble getting that to happen. From what I can see in your commands, you’re looking at the origin/dev on your local computer and (unless I missed something here) I don’t think you’ve pulled in changes from the master (remote) dev branch. I expect that’s part of the problem here…
Okay, so this is what I thought should work, if you’ve identified the one file you want to merge into dev: (it’s the example from the Jason Rudolph tutorial): You checkout sydb-occurs and indicate the path to the file(s) you want to merge, as in the example below:
****
We can simply give git checkout the name of the feature branch [1] and the paths to the specific files that we want to add to our master branch.
$ git branch * master twitter_integration $ git checkout twitter_integration app/models/avatar.rb db/migrate/20090223104419_create_avatars.rb test/unit/models/avatar_test.rb test/functional/models/avatar_test.rb $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: app/models/avatar.rb # new file: db/migrate/20090223104419_create_avatars.rb # new file: test/functional/models/avatar_test.rb # new file: test/unit/models/avatar_test.rb # $ git commit -m "'Merge' avatar code from 'twitter_integration' branch" [master]: created 4d3e37b: "'Merge' avatar code from 'twitter_integration' branch" 4 files changed, 72 insertions(+), 0 deletions(-) create mode 100644 app/models/avatar.rb create mode 100644 db/migrate/20090223104419_create_avatars.rb create mode 100644 test/functional/models/avatar_test.rb create mode 100644 test/unit/models/avatar_test.rb ****
Hope this is helping…but I may not be understanding the problem! E
On Nov 19, 2016, at 8:30 PM, Syd Bauman <s.bauman@northeastern.edu> wrote:
EB> On Stack Overflow I discover this, which might help: git diff EB> --name-only <some-other-branch> will show you what files are EB> different between your current branch and <some-other-branch> EB> Here’s the post: EB> http://stackoverflow.com/questions/10641361/git-get-all-files-that-have-been... EB> Does that work?
Not exactly what I was looking for, but very helpful. Probably close enough for now, thank you.
EB> And on merging just one file into dev, here’s something to look EB> at: EB> http://stackoverflow.com/questions/10784523/how-do-i-merge-changes-to-a-sing... EB> Following the advice here, you’d checkout the dev branch, and EB> apply a patch from your sydb-occurs branch to just one of the EB> files there…
I had tried this, and it did not seem to work. Executing the command gave me a bunch of choices for each "hunk" of text that was different. I said 'a' (apply all hunks). This seemed to make a modification to the local file awaiting to be committed; i.e. `git status` said the file in question was modified. But then when I asked git what changes had been made to that file, it said there were none; i.e., `git diff` reported no differences.
But then I tried again to demonstrate to you that this didn't work. On this 2nd test run I actually ran a regular diff against a known copy, rather than git diff for working copy vs committed (local repo) copy. And it seems to have worked! But it is awfully peculiar, and quite unnerving, that `git diff` does not think it worked. Now I don't know what to do.
EB> Wait a second…This might be a better solution, on how to select EB> particular files from one branch to merge into another branch: EB> http://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-... EB> Seems simpler! Let us know what works..!
It might be, but the exact same thing happens. See below. I had not tried this method at first, because the prose specifically says this method is for files that don't yet exist in the dev branch. But after you posted I did try it, and the exact same thing happens as with the '--patch' switch, except I don't get a choice as to which hunks to apply. See below.
RV> Also a simple way to check which files have been changed and not RV> yet committed in your branch is RV> git status RV> To see the changes themselves use RV> git diff
True, but not the problem I'm having here.
below ----- I have 3 copies of the Stylesheets/ repo here in my current directory: _dev and _sydb-occurs are checked out to the named branch, up-to-date, and read-only. _test is read-write for experimenting. | dr-xr-xr-x 50 4.0K Nov 18 11:20 Stylesheets_dev/ | dr-xr-xr-x 49 4.0K Nov 15 16:29 Stylesheets_sydb-occurs/ | drwxrwxr-x 49 4.0K Nov 15 16:29 Stylesheets_test/ Here is an abbreviated and annotated console listing of what I did.
| $ cd Stylesheets_test/ | $ git status -uno | On branch dev | Your branch is up-to-date with 'origin/dev'. | nothing to commit (use -u to show untracked files) | $ git checkout sydb-occurs | Branch sydb-occurs set up to track remote branch sydb-occurs from origin. | Switched to a new branch 'sydb-occurs' | $ git pull | Already up-to-date. | $ git checkout dev | Switched to branch 'dev' | Your branch is up-to-date with 'origin/dev'. | $ git status -uno | On branch dev | Your branch is up-to-date with 'origin/dev'. | nothing to commit (use -u to show untracked files) | | ; # first, make sure there are no mods to local working copy vs local dev repo | ; # (There should not be, `git status` says there aren't) | $ git --no-pager diff -U0 odds/odd2odd.xsl | ; # Good, no differences | | ; # test that local test copy is same as local dev copy ... | $ diff -C0 odds/odd2odd.xsl ../Stylesheets_dev/odds/odd2odd.xsl | ; # (it is) | | $ # ... and different from local sydb-occurs copy ... | $ diff -C0 odds/odd2odd.xsl ../Stylesheets_sydb-occurs/odds/odd2odd.xsl | *** odds/odd2odd.xsl 2016-11-19 19:44:13.818808272 -0500 | --- ../Stylesheets_sydb-occurs/odds/odd2odd.xsl 2016-11-19 14:15:57.035837976 -0500 | *************** | *** 25 **** | ! | --- 25 ---- | ! | *************** | *** 61 **** | ! <xsl:param name="defaultSource"></xsl:param> | --- 61 ---- | ! <xsl:param name="defaultSource"/> | $ ######### 1600 lines of `diff` output deleted here ######### | *************** | *** 2240 **** | ! <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="pass4"/> | --- 2171 ---- | ! <xsl:apply-templates select="@*|*|text()|processing-instruction()" mode="pass4"/> | *************** | *** 2247 **** | ! <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="pass4"/> | --- 2178 ---- | ! <xsl:apply-templates select="@*|*|text()|processing-instruction()" mode="pass4"/> | *************** | *** 2252 **** | - | --- 2182 ---- | ; # (and it is *very*) different | | ; # issue command we are testing | $ git checkout sydb-occurs odds/odd2odd.xsl | | ; # did it do anything? | $ git status -uno | On branch dev | Your branch is up-to-date with 'origin/dev'. | Changes to be committed: | (use "git reset HEAD <file>..." to unstage) | | modified: odds/odd2odd.xsl | | Untracked files not listed (use -u option to show untracked files) | | ; # Yay! We have a modified version, modifications must be the ones we want. | ; # Let's actually see what the difference is (between new local copy | ; # and the committed dev version): | $ git --no-pager diff -U0 odds/odd2odd.xsl | ; # Oops ... no difference. ??? | | ; # So if there's no difference there, there should be no difference | ; # between this local copy and the dev working copy. Let's see ... | $ diff -C0 odds/odd2odd.xsl ../Stylesheets_dev/odds/odd2odd.xsl | *** odds/odd2odd.xsl 2016-11-19 19:45:56.985390835 -0500 | --- ../Stylesheets_dev/odds/odd2odd.xsl 2016-11-18 11:54:22.943262068 -0500 | *************** | *** 25 **** | ! | --- 25 ---- | ! | *************** | *** 61 **** | ! <xsl:param name="defaultSource"/> | --- 61 ---- | ! <xsl:param name="defaultSource"></xsl:param> | ; ######### 1605 lines of diff output deleted here ######### | *************** | *** 2178 **** | ! <xsl:apply-templates select="@*|*|text()|processing-instruction()" mode="pass4"/> | --- 2247 ---- | ! <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="pass4"/> | *************** | *** 2182 **** | --- 2252 ---- | + | ; # oh dear, they are *very* different | | ; # is the local working copy the same as the sydb-occurs working copy? | $ diff -C0 odds/odd2odd.xsl ../Stylesheets_sydb-occurs/odds/odd2odd.xsl | ; # Yup. -- tei-council mailing list tei-council@lists.tei-c.org http://lists.lists.tei-c.org/mailman/listinfo/tei-council
PLEASE NOTE: postings to this list are publicly archived
-- tei-council mailing list tei-council@lists.tei-c.org http://lists.lists.tei-c.org/mailman/listinfo/tei-council
PLEASE NOTE: postings to this list are publicly archived