GIT

From Wine-Wiki

Jump to: navigation, search

Contents

Git and Wine Development

This page is a compilation of comments taken from the wine mailing lists. The official developer Wine Wiki is the reference page for using Git with Wine and has benefited from constant updates based on user queries. It was even listed in a survey of GIT users where they described where they learnt to use GIT. The Official Wine Wiki should be your first point of reference. See the Links section for further information.

You can browse commits for wine here:

Introducing Git

Get the right Git. In debian, git, the filemanager with GNU Interactive Tools, is now called gitfm. If you are looking for git, Linus Torvald's content tracker, install the cogito and git-core packages and see README.Debian and git(7). [update dec 09: with the changes to git, cogito has been for a while deprecated and effectively replaced by improvements to git.]


Git is relatively new software which has a number of advantages over CVS. Since its beginning in 2005, A. Juliard and the wine project have been some of the early adopters. In Dec 05 the Developer Wiki noted that WineHQ's master repository is no longer CVS but is now stored in a GIT tree and then mirrored into CVS. As of 24 Aug 2006 many references to CVS have been removed from Wine's official site apparently to reflect the greater use of Git. The powerful software called git is still undergoing rapid development.

According to it's own documation the name "git" has no particular significance as it appears that it can "mean anything, depending on your mood."

Wine Developers may want to spend some time learning git as this can help their patches to be applied: M. McCormack [Aug 06]: I think Alexandre would prefer to receive patch submissions in Git format, as they are easier to apply and waste less of his time. M. Stefaniuc: For the casual/new Wine patch submitter CVS is easier to use. If those submitters do more Wine work they will see the light anyway and migrate to git ;) A. Julliard: More patches are good, but if they are in a broken format they are not really useful. And CVS unfortunately makes it much too easy to submit broken patches, so it's not necessarily better for new submitters.

A Julliard 2008-04-09 --- I've enabled the <daily> snapshot feature in gitweb, we'll see if it overloads the server

GIT vs CVS

M. Stefaniuc[Aug 06]: Are there any plans to get rid of CVS? I would guess keeping the CVS tree sync from the git tree is low maintanance so it can be kept around "forewever".

A. Julliard: Yes, as long as it doesn't require any maintenance it will be kept around. But if it breaks for some reason, I'm not going to spend time fixing it. wine archive

M.McCormack explained further: Git isn't CVS, and might be confusing coming from the background of using CVS. If you have problems using Git, it shouldn't be too hard to get help. We answer questions about Git on the IRC channels and wine mailing lists, and have a page dedicated to it on the Wiki. Though Git is a little more difficult that CVS, I'm still pretty sure that learning it is worth the effort. Unlike CVS, Git was designed with sending patches via email in mind, so Git makes life easier for regular contributors, and for Alexandre.

In the last three months, Alexandre has averaged over 800 commits per month, which is higher than we ever had when using CVS. When we standardize on using Git to send patches, things will improve more. <math>Insert formula here</math>

Git Scripts for Wine

C. Lachner: [Jul 06] here's a new Version of getwinegit.sh. It is now at 0.4. There is no need to comfigure the pathes to the programs getwinegit needs. Everything happens automatically now ;). I hope you enjoy this release... Here's the readme and the changelog: :: Intro' getwinegit is a script which was designed to download/update, compile and install the current wine-source-tree from a git-repository. wine archive

M. Ploujnikov [Aug 06] Since Christian's last update to his getwinegit script I have tried to improve it to be more general and work in my special setup. wine archive

For Regression testing git has a handy command called git-bisect http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html

Feel free to add tips about wine and the SCM git.

The Git Index

M. McCormack [Jul 06]: The git "index" can be thought of as a record of what's checked out, or the thing you're about to commit. If the index is the same as the HEAD branch, you won't commit any changes when you run wine archive

"git commit".

If it's different, you will commit changes.

"git status" gives a nice summary of that.

You change the git index with "git update-index". eg.

git update-index --add foo.c # add foo.c to the index
git update-index --remove foo.c # remove foo.c from the index
git update-index foo.c # add changes in foo.c to the index

You can collect changes that you plan to commit one by one with that command. If you decide you no longer want to commit them "git reset" will reset the index back to HEAD without changing the checked out files themselves.

You can compare the index to HEAD with the following command, as I mentioned:

git diff-index -p HEAD

Using Git to update your local wine

Determining which Patches have been applied

A developer queried: If CVS goes, is there another way to see what patches have been applied to the tree? The git does not seem to do that for me and cvs.winehq.org is a fairly easy lookup.

M. McCormack[Aug 06]: If you have a local git tree,

git whatchanged

will give you the complete commit history. There's also the GitWeb interface at: http://source.winehq.org/git/ If you like graphical interfaces, try "gitk" on your local repository.

These are all described at http://wiki.winehq.org/GitWine.

I expect that CVS will go away sooner or later. Git is a better way to manage Wine's source code, and we should encourage people to use it.

T. Wickline: To visualize the history just do something like this.

$ gitk --since="6 days ago" dlls/

And you will see all commits made to the dlls directory over the past six days.

$ gitk --since="3 weeks ago" dlls/

And you will see all commits made to the dlls directory over the past three weeks. You can change the number of days or weeks to fit your needs.

E. Durbin noted at present: You can view the wine-cvs@winehq.org over newsreader. wine archive

Updating your end when a patch was applied but modified

J. Latimer [Aug 06]: I have a patch that Alexandre modified and when I get fetch and git rebase origin I am told to fix the merge problems, which I have. However after that I end up with this:

[redacted]$ git rebase --continue You must edit all merge conflicts and then mark them as resolved using git update-index

M. McCormack:If Alexandre has applied your patch, and in the middle of a rebase, you get a conflict with the version of the patch in your tree, it's often enough to do one of:

  1. preserve the diff in all.diff just in case git diff-index -p HEAD >all.diff
    patch -p1 -R < all.diff
    git reset
    git rebase --skip
  2. OR get rid of the diff from this tree
    git reset --hard
    git rebase --skip

both will skip the patch, and continue the rebase, the first one simply saves the diff just in case. If you're not sure, you can check which files are uncommitted with:

git diff-index HEAD

As for the rebase options, the manual page is useful: http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html wine archive

Applying a patch

[May 2007 wine devel] You might want to try the following: Select the patch from http://thread.gmane.org/gmane.comp.emulators.wine.patches/ , select the link after "Direct link" on the bottom, append "/raw" without quotation marks after the URL. Now you can save the file at that URL as is and use it with patch, it will ignore the headers.

the developer reported: It works! Cool! (but a little complicated ;-) Thanks a lot for hint!

save your work, update and and then re apply your latest work

git-stash Saves your uncommitted changes, which can allow you to use "git rebase origin" without losing your current work. Example:

$ git stash && git rebase origin && git stash apply

Split, modify and reorder your patches

The -i options for git rebase makes it easier to modify, re-order, merge together, and split patches multiple patches you have created.Example:

$ git rebase -i origin

The difference between fetch and pull

M. Stefaniuc [Jul 06]: If you do not do any development there is none. Git pull is just easier to type. If you do development and apply patches then there are differences.

J. White: The pattern I always followed was:

git fetch <source-server>

(retrieve new objects from a source)

git rebase <source-branch> <my-current-branch>

(change my current branch by applying new patches from the source-branch). e.g.

git fetch winehq
git rebase winehq master


R. Shearman: git pull prevents you using git-format-patch to send the patches back. Also note that "git fetch" will automatically forward your current branch to the latest version if you have no patches in the current branch, so if you then try to rebase you will get a message saying "nothing to do". If that happens, you should get a message from "git fetch" saying something like "fast-forward..."


M. Stefaniuc [Jul 06] wine archive: If you do development and apply patches then there are differences. The main difference is what happens under the hood in the repository and not in the checkout code:

git pull == git fetch origin + merge origin back into your active branch. All history is preserved; [the] pull command can be seen as "merge commit" in the history.
git rebase origin == git format-patch old origin + throw away your active branch and replace it with a copy of the new origin + apply all the patches git format-patch generated.

As Rob pointed out with git pull you loose the ability to use git format-patch as that uses the commit history to decide what the differences are. The code in the origin and your master can be bit by bit identical but have a totaly different history how those branches got to have that code. Different history means git format-patch will spit patches out even if the source is the same(*). Been there did that. No thanks. With git rebase your not yet submitted/accepted patches will be always on top of the origin. The master has always a clean history so git format-patch dosn't get confused.

Eric says that using stgit would be even better for this task of following the main Wine devel tree carrying around a couple of patches but didn't try it out yet.

If you want want to visualize the difference between git pull and git rebase just create two branches and commit a couple of patches to both. One of those branches you keep up to date by using git pull and the other by git fetch+rebase. After a week or so look with gitk at both branches:

  • git rebase: 1 straight line with the applied patches at the top
  • git pull: 1 line that branches into two lines: origin and your branch connected by short lines going from

origin to your branch which represent the merges (git pull).

(*) If *ALL* the patches from origin and master are the same diff but differ only in the commit message (timestamp, commiter, changelog, etc.) then it looks like git format-patch is still able to do it's work and get a meaningfull output. But [if] Alexandre modified your patch before commiting or you merged two of your commits into one before sending the patch upstream or you used git revert or you [... then] git format-patch origin will produce garbage.

Git usage

Getting a copy of Wine

According to the official wiki: Checking out from the WineHQ Git repository:

git clone git://source.winehq.org/git/wine.git ~/wine-git
cd ~/wine-git

If you just want to track wine for example watching for regressions and regression testing, you can pull in the new changes using git pull in the wine-git directory.

cd wine-git
git pull

Checkout

A user asked; Is there a way I can [get..] to version 1.1.15?

vitamin [Mar 09]: GIT repository contains _ALL_ versions of Wine ever made, starting from 0.0.1. To get the source of a particular Wine version you [want,] just do [i.e. for wine-1.1.15]

git checkout -f wine-1.1.15

To compile a version of wine Winehq Bugzilla entry 18595 how would I build a specific version from git?

git checkout wine-1.x.y && ./configure && make depend && make

Temporary Branches

When A. Julliard is not accepting patches (eg on holiday)

All official Patches for wine are examined by A. Julliard and applied to his Git tree. In April 06 while A. Juliard was on holiday, for the very first time, wine continued development in a way never before possible. M. McCormack posted a temporary git branch and provisionally accepted patches, subject to Alexanders approval when he returned. This does not occur every time he goes on holiday so you might watch for his announcement when he goes on holiday.

D. Kegel posted a handy and interested summary of how this worked out for him [Apr 06]: I just started using git so I could track Mike McCormack's tree. I first followed the instructions at http://wiki.winehq.org/GitWine to get a winehq tree, then followed Mike's instructions at http://www.winehq.org/pipermail/wine-devel/2006-April/047208.html to grab the latest changes.

The commands I used on my Ubuntu box were, all in all:

sudo apt-get install git-core git-doc git clone
git://source.winehq.org/git/wine.git wine-git cat > .git/remotes/mmbranch <<EOF
URL: http://mandoo.dyndns.org/wine.git Pull: refs/heads/master:refs/heads/mmbranch EOF
git fetch mmbranch
git pull . mmbranch

Everything went smoothly; it was rather fabulous. Then I ran into a regression, and wanted to roll back to Mike's tree as of a certain patch, http://www.winehq.org/pipermail/wine-patches/2006-April/026126.html

I gather the right command for this is "git reset", so I read the man page. It wants a "commit-ish" as the argument. (Boy, that's helpful.) Looking at that patch, I saw its filename was an md5 sum, so I figured maybe that was the "commit-ish", and tried

$ git reset --soft b32ae7a40c601427fea7cb9f145138221030f869 fatal: Needed a single revision

[...]. At this point I punted, sent an email to James asking for help, ate a cookie, and periodically re-read google and the man pages. Eventually it dawned on me that you can specify a particular commit by how many back from the head it is, e.g. HEAD~5 is 5 back from the tip. I also stumbled on the command "git log", which shows you all changes, most recent first. Sure enough, the change I wanted was eight back from the head. So I tried

$ git reset --soft HEAD~8

And voila, it worked; "git log" now showed the desired change as the latest! [..]

Annoyingly, "make" did nothing after this, but I knew the changes I wanted to revert were all in one DLL, so I just removed that DLL's .o files and ran make again. I feel a bit more comfortable with git now! - Dan

M. McCormack: You can get a "commit-ish" SHA-1 IDs for your tree using "git whatchanged".

A commit is an SHA1 ID of the commit it was based off, the patch committer's name+email, the patch author's name+email, the time of the commit and the root directory of the tree committed. Since James's tree had him as the committer, and my tree has me as the committer, the SHA1 IDs won't be the same. If I were to pull/merge his tree, then they would be. [...]

"git reset" as used above will only modify the commit history. "git diff" should now show you the diff between the old HEAD and the old HEAD~8.

You can use "git reset --hard" to change the checked out tree too, but it will reset it to the point you specify, and you will lose any changes not committed at that point. So, to reset your whole tree (commit log and checked out files) to the state it was just after the previous commit, you do:

git reset --hard HEAD^

wine archive

Watching Temporary Branches

While A. Julliard was on a brief holiday in Sept 06, M.McCormack provided a temporary Git tree and accepted patches, pending Alexanders final review and approval. Currently he does not run gitweb on his server (cpu Mhz: 266.776) but he explained how to follow his changes. M. McCormack [Sept 06]:You can fetch a branch without messing up your current tree wine archive:

git fetch http://mandoo.dyndns.org/wine.git master:mmbranch git

[you can see what had been added by running]

whatchanged mmbranch
Updating Patches and Temporary Branches

A developer wondered: I've sent in a patch that got some remarks by Juan Lang. The patch is already applied to mmbranch [Mike's Temporary, Julliard is on Holiday branch]. [But] Most patches sent to wine-patches that have (valid) comments will not be applied by AJ. Should I now resend to make sure it gets applied when AJ is back AND sent a patch to fixup mmbranch. Or will the previous one be reverted and the next applied to mmbranch?

M. McCormack: Resend the whole patch as it should be, and I'll revert the old one and reapply the one you send. That's what I've done with Roderick's x11drv/opengl patches, and it should make it easier for Alexandre to just pick the newest one from wine-patches when he gets back from holidays. wine archive

Deleting Temporary Branches

S. Krasuckas [Sept 06]: Now that I downloaded mmbranch, saw its changelog, I would like to reclaim disk space used by it. I deleted it with git branch -D, but only ~100 kB were gained. Do you know of any way to get all the space back? There should be ~40 additional MB freed. I've tried git-fsck-objects just now to no avail.

M. McCormack pointed to the right command to use: http://www.kernel.org/pub/software/scm/git/docs/git-prune.html


Further Reading

Sending Patches using Git

Removing Trailing White Spaces

One Developer wrote: I've discovered that if you use git-add to fully stage your commit, you can then run:

git-diff-index --check HEAD

immediately prior to committing; that will catch such warnings while it's easy to fix them.

F. Gouget [Mar 09] What I do is:

chmod a+x .git/hooks/pre-commit

in my repository's top-level directory. With this, git-commit issues an error if my code has bad whitespaces (trailing or tab/space mixups), and I get back to the prompt. So then I get to fix my code, or I add the '-n' option to tell git-commit to not bother me.

Git Format Patch

K. Blin [Sept 06]:git-format-patch creates incomplete headers, as it expects you're using this messages as a draft in your email client. Now, I'm not 100% sure how to do that in mutt, but I think mutt will understand a maildir format postponed mailbox. Just try and dump the patches generated by git-format-patch there. (Haven't tried that myself)

M. Stefanuic: You can add custom email headers in the git config for git-format-patch. There's where i add the "To: wine-patches@winehq.org". Then i just do a

mutt -H 0001-.....

and send the email normally (not bounce it). wine archive

Attaching a Patch

Sometimes to your horror, when you try to send your patch it is mangled by your email software. Never fear, there is a workaround.

K. Blin [Jun 07 wine devel] Your mail client mangled the long lines. Please make sure to actually attach the patch before sending. git-format-patch does that when given the --attach parameter.

Git and Thunderbird

Thunderbird can cause problems but in Feb 09 a discussion on the git mailing list led to some options. M. Gruber wrote: all sides have worked constructively together to make things work for all MUAs and all users. Dscho even cooked up a Thunderbird extension, Ben provided input for git-imap-send.

Archived-At: <http://permalink.gmane.org/gmane.comp.version-control.git/109593>

Some hints may be found here:

Archived-At: <http://permalink.gmane.org/gmane.comp.version-control.git/109624>
http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email
Git and Gmail

A post to the git mailing list write: This is the setup I use for emailing patches using git: [Watch out for the spelling of [sendemail] this can easily be misspelled by forgetting the 'e']

~/.gitconfig
[sendemail]
smtpserver = smtp.gmail.com
smtpserverport = 587
smtpuser = your.email@gmail.com
smtppass = yourPassword
smtpencryption = tls
$ git format-patch <options>
  1. add comments to 00*.patch files.
$ git send-email 00*

I've never seen any mangling using send-email, and the gmail SMTP server. I've never actually tried using imap-send. "git imap-send" doesn't use the [sendmail] section of the .gitconfig. It uses the [imap] section. The [sendmail] configuration is if you're using "git send-email".

If you setup the smtp* options, you don't need a local MTA, since send-email will use the SMTP server you configured. <http://permalink.gmane.org/gmane.comp.version-control.git/109762>

Git and Evolution

A programmer wrote: I want to apply patches by running git am directly on one of my Evolution mail folders. Archived-At: <http://permalink.gmane.org/gmane.comp.version-control.git/109672>

Using Git to set your Wine Changelog Sender Address

A Developer queried [May 2007]: How does the email address get into the change log, is it a manual process or by hand. Ideally I'd like my main email address to be the one in the Changelog, rather than the gmail one which is purely to see if it resolves the problems I am having sending in patchsets

J. Allen: With git commit, you can use the --author switch for example:

$ git commit -a --author "Yourname <email@somedomain.org>"

And then when you generate your patch set, it will have the address you wanted. I do this so that I don't end up with my local machine's address in my patches. [wine devel]

D. Riekenberg: Set "user.email" and "user.name" once with:

git repo-config

Importing A Wine tarball into Git

M. McCormack [Oct 06]: You can create your own git tree from Wine tarball as follows:

tar jxvf wine-0.9.23.tar.bz2 | sed s/^wine-0.9.23\\/// > list cd wine-0.9.23 git init-db git update-index --add `cat ../list` git commit -m "Import of wine-0.9.23"


This should result in the message (the SHA-1 ID should match!): Committing initial tree c8369ac44e507d96073ca57e9a0a1e77f5ec9511 This will give you a git tree with no history. Searching for that tree id in the Wine Git tree shows:

git rev-list --header HEAD | less
...
7affdd4c7cadc3aa90c3e1e053321f4712a6f07d
tree c8369ac44e507d96073ca57e9a0a1e77f5ec9511
parent a348e0936af6de2650b424d3e90ed81b5c10e9ca
author Alexandre Julliard <julliard@winehq.org> 1160750619 +0200
committer Alexandre Julliard <julliard@winehq.org> 1160750619 +0200
Release 0.9.23.

So we can make the SHA1 ID of the *tree* line up, thus we have the same tree [...] without needing the entire history. So the initial download would be about 10Mb for the wine source tarball, then a bunch of patches in git mailbox format for each update.

Updating the wine tarballl

Download my update script from http://mandoo.dyndns.org/update.sh then change into your Wine 0.9.23 Git directory and run the script. ie.

cd wine-0.9.23
sh update.sh

This should download the latest commits from WineHQ.org via my server. The output is something like:

[redacted]@black:~/wine-0.9.23$ sh update.sh
Last tree is 5e4b428f32db20582941331a37f1cdb9f462da77
Now querying for a matching commit...
Matching commit is 2cb378d498b7525eb34bd163fcc77d00fe595335
Now downloading patches...

...

Things to remember:

  • You shouldn't commit to this Git tree... clone it first and commit to the clone, or branch and switch back to the original branch for updates.
  • If you commit to the branch that updates come to, the update script won't work.
  • It requires an equivalent hacked up gitweb.cgi, which is only on the website pointed to by the script at the moment.
  • This is hacked together in a few hours. To get something more reliable and that might be acceptable to the Git project will take

somewhat longer. Anyway, I'd appreciate any testing anybody is willing to give the script, and any feedback.

Andrey tested it and reported: it works! The script took about 5 Mb of traffic to update from 0.9.23 to the current head (not too much but binary 0.9.22-0.9.23 delta is about 500 kb). Using "curl --compressed" when possible (and configuring your server to support compressed documents) should decrease traffic volume significantly.

Publishing your Git Tree

M. Lankhorst [wine devel Jun 2007]: Git is the repository system wine uses, see http://wiki.winehq.org/GitWine To set up a repo first you have to register a fork of wine.git, then set some settings and choose 'Push' rather then cloning a tree.

To update your git repository for it, create a file in wine-git like this:

Filename: .git/remotes/sound
--- (Begin of file) ---
URL: git+ssh://username@repo.or.cz/srv/git/wine/sound.git 
Push: refs/heads/master:refs/heads/master ---(End of file)---

Then you can do something like: git push -f sound HEAD:refs/heads/master

Of course replace username with your username, and sound with how you call your branch. To edit project settings, your username for it seems to be something like: wine/branchname (without .git at end) and project password you set yourself. Hope this is helpful for others too.

J. Allen: git is ideal for forking (and later merging) like this [Google Summer of Code].

Troubleshooting Git and Wine

This contains information found on the wine mailing lists and may become out of date. By following the links to the Wine mailing lists perhaps you can investigate similar problems that you have had. You are welcome to add information about using git and wine. Please follow the examples by adding a date alongside your comments.

Git and Proxy

A query was made in wine user June 08 about using git with proxy. Usurp: note is that it doesn't work with:

http_proxy=http://host:port git clone
http://source.winehq.org/git/wine.git wine

It only works with:

export http_proxy=http://host:port
git clone http://source.winehq.org/git/wine.git wine

Git and HTTP access

A developer wrote [May 8 2007 wine devel]: Found myself behind an http-proxy and can't seem to find the magic to use the http proxy to update my git archive. Is there a way to use an http proxy (squid) with wine's git?[...] I've setup an http_proxy according to the documentation I've found on the web. There's just not a lot out there that is specific to this conifguration.

T. Spear: Did you try changing the git:// to http://  ? That is supposed to work thru port 80 with or without squid. YMMV

H. Verbeet: need to set the http_proxy env. var correctly as well.

He reported success: Yep. needed to update the remote.origin.url and then setup the http_proxy env variable, and it all worked.


A developer queried [May 02 2007 wine devel]: I'm having an issue using git at work, where it will start downloading the packs, and then just stalls out at the same pack every time.. This has occurred since I first started working here.

A. Julliard: One of the packs is pretty large, most likely you didn't wait long enough.

Haven't killed it yet and been waiting for 2 hours.. I'm on a T-3 afaik. Last line that prints before it just sits is:

walk 4eea356e2d39f1a958afb4d8f5b54381e8972ecf

Just to dispel any idea that there is a size limit, I can download the entire dvd iso of Slackware 11 in about 20 minutes, with no problems, but that is from an http/ftp server.

A. Julliard: That's precisely the last object before the big pack. Note that the processing of the pack can take a long time too, not only the download. You may want to upgrade your git version, there have been improvements in that area. Also if possible, using the git protocol instead of http is much faster.

A. Julliard: This turns out to be a bug in libcurl. It's fixed in libcurl >= 7.16.

Troubleshooting Git and HTTP

A user reported [Bug9629 sept 07]: via http git starts working - but how to avoid this error?

git clone http://source.winehq.org/git/wine.git wine-git defaulting to local storage area
error: Couldn't get http://source.winehq.org/git/wine.git/refs/tags/wine-0.0.2^{} for tags/wine-0.0.2^{}

all subsequent steps fail or do nothing although around 180MB [was] downloaded...

A. Julliard: Probably your git is too old, you should upgrade. Bold text

Troubleshooting Git and Wine on Gentooo

After some detective work M. Bestefich noted [Apr 06]: Enabling "curl" and "webdav" USE flags on Gentoo makes git-http-fetch work. (Also causes my HTTP server to compile with WebDAV support and various other side effects, but hey, welcome to Gentoo and the world of multi-app use flags...) wine archive

N.Skrypuch: to only enable those use flags for cogito.

echo "dev-util/cogito curl webdav" >> /etc/portage/package.use


Updating a specific file

A programmer asked [Jul 06]: What's the right way to force a get of a particular file? With cvs, you can just remove the file and do 'cvs update foo.c', but I'm having trouble[...], and the otherwise helpful http://wiki.winehq.org/GitWine doesn't seem to mention this case.

P. Rozanski: i use cg-restore from the cogito suite (can be mostly used parallel with git). It's a quite big shell script which call[s] more than one git function

cg-diff with colors is nice too... or cg-log -s (shows log similar to web based shortlog git viewer)


A. Julliard: git checkout foo.c

However the programmer noted that this didn't always work for him and it was suspected that local changes were part of the problem. T. Rollo pointed to the official wiki: From the bottom of <http://wiki.winehq.org/GitWine>: If you have made changes in the working copy but need to revert it to what is in the repository (equivalent to svn revert):

git checkout HEAD file-name

M. McCormack suggested a 'roundabout way' that made use of the git index:

git diff-index -p HEAD > foo.diff
patch -p1 -R < foo.diff
vi foo.diff #remove bits you don't want patch -p1 < foo.diff

I find the above useful for getting rid of things like whitespace changes or debugging messages I've added when preparing to commit something to my tree. wine archive

F. Gouget explained further: [:git diff-index -p HEAD > foo.diff] will show a diff of both files that are in the index and files that are NOT in the index. If all you are interested in is what's in the index, then you can use the following command (discovered by Huw):

git diff-index --cached -p HEAD


Recovering a deleted or uncommitted file

M.Mccormack [Sept 06]: If the patch you "uncommitted" with "git reset" is your own, you can search for it with "git fsck-objects". That will give you a list of SHA1 commit IDs (and perhaps other objects). You can check what is in each commit with "git log SHA1ID". wine archive

If you've just "uncommitted" one of Alexandre's commits, first make sure that you have the master branch checked out:

bash-2.05b$ git branch
  • master
origin

Unless you've made more branches, "master" is your, and "origin" is Alexandre's. Then try:

git checkout master
git rebase origin

That should bring your "master" back in line with the "origin" branch. I did a presentation on Git at wineconf, you can see it here: http://mandoo.dyndns.org/git-presentation/git-wine.html

git clone

git clone git://source.winehq.org/git/wine.git wine-git defaulting to local storage area

[wine bug 9639 sept 07] J. Lang: If you are behind a firewall, -- You can clone using http instead, git clone http://localhost/git/wine.git wine-git

$ git clone http://source.winehq.org/git/wine.git wine-git defaulting to local storage area,

M. McCormack: Make sure to start the clone in an empty directory (ie. no existing .git). The clone might take quite a while, so be patient if it doesn't go as fast as you expect. [git version 1.0.4.] is a bit old how about upgrading to GIT 1.2.5.

The programmer reported: I let it run overnight and it seems to have worked. Took quite a while though. I was expecting a download time similar to that of the kernel. wine archive


Further Reading

Updating to the Latest Release

As a new wine is released I'm trying to get updated. Before I had used git for generating patches, I could do:

git fetch; git rebase origin

however, now this doesn't seem to pickup anything. How should I tell git to actually update to the files on the server?

S. Dossinger: That should still work. Does it give any error message? Most likely some of the patches in your tree conflict with some newly commited patches on the server.

Preserving your patch or Avoiding Git

A user wrote: I had wine-0.9.37 fetched, added few patches, compiled it, installed locally, all was fun and games, Now I want to bring my local tree to current level, but cant.

R. Shearman [Jun 2007]: [skipped fruitless attempts at braking GIT tree]

[redacted]:/media/hdc6/home/rasz/source/wine$ git fetch ; git rebase
origin dlls/user32/tests/menu.c: needs update

What this tells you is that you have modified dlls/user32/tests/menu.c file. And you either have to commit it, or discard the changes. If you have your modifications in the GIT tree - commit them! If you don't care about any changes in your tree, do 'git checkout -f'. 'git reset HEAD^' does something _completely_ different from what you want. It "undoes" the last commit without modifying the source. You should only use it to edit your own patches that you just committed.

Anyway in short if you just want step-by-step ..This will preserve *all* changes made in the tree. Of course if anything will conflict, you'll have to resolve conflicts yourself:

git commit -a -m junk
git fetch
git rebase origin
git reset HEAD^

The user asked: could someone please add a simple _"svn update" git replacement_ to the wiki?

Jan: Notice that you will loose all changes (contrary to svn update), even the ones you commited.

git fetch origin
git reset --hard origin

M. Meissner:

git commit -a # commit all local changes
<add note>
git reset --hard HEAD^ # just drop the last commit

g:it fetch

git rebase origin


Avoiding the need to use Git

The user explained [Jun 2007]: i dont want to know git, i just want to download latest source snapshot.

V. Margolen: You can get the latest link from http://winehq.org/?announce=latest And forget about GIT. Source control is for developers not users. Especially if you don't want to know it.[He then suggested using wget]

w get http://ibiblio.org/pub/linux/system/emulators/wine/[..add the wine release]


T. Stahlhut: Try it using just CVS; that is what I do, it works OK; it justs not the best if you wish to develop for WINE. This is what I think I use to check out the HEAD of the git. FYI: Git supports CVS access if you did not know it.

try cvs -z3 -d:pserver:cvs:cvs@cvs.winehq.org:/home/wine checkout wine

Links

Personal tools