From owner-freebsd-git@freebsd.org Fri Dec 4 14:20:18 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C36BA41F88 for ; Fri, 4 Dec 2015 14:20:18 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1983F1F4A for ; Fri, 4 Dec 2015 14:20:18 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by iofh3 with SMTP id h3so117309904iof.3 for ; Fri, 04 Dec 2015 06:20:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=8fK0h9vBbup00S4+estO3YSIRSeAjcKf+Qey0xzysMc=; b=L0thi4FvaJh0QJeWhn2MmhZnzNEb3b0rsHxYCP5rKvO9iEgtWwjayQLUWN3vdRiZRb Nn1XKFp5OgIYf1FhpWXbzs6qlMKaLTXWacMxZa8RrDv4DnOTmNJ/fa5VelEW0TJoV4qO m74YrJFmQRvyaybBje19UuXA6QXNYjYz58bwwMAnkH5FTAYD6awrT4V3JOmGP2bIOYUX hMUcgNpX9GcJpaaXa+d2vNHbY+VtXFWKy4WtGY/QipLLzneUPT7cZni6f4QdLHCr2Uwp Z+9BGPu2Fs0hioBW/7Y++YXf10/HYoXhTi/DjSHkQZN3JKF3lHkyhik9k3fLWwYfXX1g ewJw== MIME-Version: 1.0 X-Received: by 10.107.41.146 with SMTP id p140mr14158266iop.80.1449238817481; Fri, 04 Dec 2015 06:20:17 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Fri, 4 Dec 2015 06:20:17 -0800 (PST) Date: Fri, 4 Dec 2015 06:20:17 -0800 X-Google-Sender-Auth: quLInp0NHOS_MXLhChXDn5kCIMg Message-ID: Subject: Put working git branch in shell prompt for bash and zsh? From: Craig Rodrigues To: freebsd-git@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 14:20:18 -0000 Hi, I am heavily using git for my projects these days. Typically I am working on multiple projects, with multiple checked out trees. I am also switching between branches a lot. Sometimes because I am working with so many checked out trees, I lose track of what branch I am working on. Can anyone point me to a "stupid shell trick" which would put the currently active branch in the shell prompt? I typically use bash and zsh shells, so having the trick for those shells would be useful. Thank! -- Craig From owner-freebsd-git@freebsd.org Fri Dec 4 15:10:34 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05D84A40DD5 for ; Fri, 4 Dec 2015 15:10:34 +0000 (UTC) (envelope-from m@hardcastle.com) Received: from smtprelay.hostedemail.com (smtprelay0221.hostedemail.com [216.40.44.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5C3510EA; Fri, 4 Dec 2015 15:10:33 +0000 (UTC) (envelope-from m@hardcastle.com) Received: from filter.hostedemail.com (unknown [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 17E822691A0; Fri, 4 Dec 2015 15:10:22 +0000 (UTC) X-Session-Marker: 6D4068617264636173746C652E636F6D X-Spam-Summary: 2, -10, 0, , d41d8cd98f00b204, , ::::, RULES_HIT:41:152:355:379:541:564:599:800:960:966:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2525:2553:2560:2563:2682:2685:2687:2859:2908:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4184:4385:4860:5007:6119:6261:7903:7974:9010:9025:9040:9707:10004:10400:10848:11026:11232:11253:11658:11914:12043:12050:12291:12296:12379:12438:12517:12519:12663:12683:13069:13071:13311:13357:14096:14097:21060:21080, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0, LFtime:4, LUA_SUMMARY:none X-HE-Tag: sleep04_779e4dee3fb5e X-Filterd-Recvd-Size: 2238 Received: from ericbrooks.matthardcastle.com (173-8-177-193-SFBA.hfc.comcastbusiness.net [173.8.177.193]) (Authenticated sender: m@hardcastle.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Fri, 4 Dec 2015 15:10:21 +0000 (UTC) Subject: Re: Put working git branch in shell prompt for bash and zsh? Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3111\)) Content-Type: text/plain; charset=utf-8 From: "M@ Hardcastle" In-Reply-To: Date: Fri, 4 Dec 2015 07:10:19 -0800 Cc: freebsd-git@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <650C2262-2258-46E1-8F9F-46153853989F@hardcastle.com> References: To: Craig Rodrigues X-Mailer: Apple Mail (2.3111) X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 15:10:34 -0000 Hi Craig, vcs_info does the trick in zsh. Here's a snippet from my zshrc that = shows the checked out branch with your in a git repo: autoload vcs_info setopt prompt_subst zstyle ':vcs_info:*' formats '|%b' zstyle ':vcs_info:*' enable git cvs svn precmd () { vcs_info } vcs_info_wrapper() { vcs_info if [ -n "$vcs_info_msg_0_" ]; then echo "${vcs_info_msg_0_}$del" fi } PS1=3D'%~$(vcs_info_wrapper) %{$fg[red]%}=EF=A3=BF%{$reset_color%} ' =E2=80=93 m@ > On Dec 4, 2015, at 6:20 AM, Craig Rodrigues = wrote: >=20 > Hi, >=20 > I am heavily using git for my projects these days. > Typically I am working on multiple projects, with > multiple checked out trees. I am also switching > between branches a lot. >=20 > Sometimes because I am working with so many > checked out trees, I lose track of what branch > I am working on. >=20 > Can anyone point me to a "stupid shell trick" > which would put the currently active branch in the > shell prompt? I typically use bash and zsh shells, > so having the trick for those shells would be useful. >=20 > Thank! >=20 > -- > Craig > _______________________________________________ > freebsd-git@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-git > To unsubscribe, send any mail to "freebsd-git-unsubscribe@freebsd.org" From owner-freebsd-git@freebsd.org Fri Dec 4 16:19:16 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CFC0A41E2C for ; Fri, 4 Dec 2015 16:19:16 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 6DBB21CEE for ; Fri, 4 Dec 2015 16:19:16 +0000 (UTC) (envelope-from bright@mu.org) Received: from Alfreds-MacBook-Pro-2.local (unknown [IPv6:2601:645:8004:7515:c1b:8b90:5c08:82e7]) by elvis.mu.org (Postfix) with ESMTPSA id D9A6D345A921 for ; Fri, 4 Dec 2015 08:19:15 -0800 (PST) Subject: Re: Put working git branch in shell prompt for bash and zsh? To: freebsd-git@freebsd.org References: From: Alfred Perlstein Message-ID: <5661BD03.2090204@mu.org> Date: Fri, 4 Dec 2015 08:19:15 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 16:19:16 -0000 On 12/4/15 6:20 AM, Craig Rodrigues wrote: > Hi, > > I am heavily using git for my projects these days. > Typically I am working on multiple projects, with > multiple checked out trees. I am also switching > between branches a lot. > > Sometimes because I am working with so many > checked out trees, I lose track of what branch > I am working on. > > Can anyone point me to a "stupid shell trick" > which would put the currently active branch in the > shell prompt? I typically use bash and zsh shells, > so having the trick for those shells would be useful. > > Thank! I believe you can use the output of `git rev-parse --abbrev-ref HEAD` If this doesn't work exactly, then just play around with git's "rev-parse" command, it should work. -Alfred From owner-freebsd-git@freebsd.org Fri Dec 4 16:54:05 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C8B0A41580 for ; Fri, 4 Dec 2015 16:54:05 +0000 (UTC) (envelope-from r@robakdesign.com) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B60D219C7 for ; Fri, 4 Dec 2015 16:54:03 +0000 (UTC) (envelope-from r@robakdesign.com) Received: by wmeo63 with SMTP id o63so12210942wme.2 for ; Fri, 04 Dec 2015 08:54:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=Y+Mog98F49oP6cbWgNgfn9dgQVkoFOPt3YS1zPGW7TA=; b=nNJlbPg2qSf+SdaKAj3gbP0ZF9u+PKwBHPVg1lS9YyttUbYLdvjZuZoK4GGVBSuSEv VlqQjJaisFZ3Pgi2s7s16RgjHUI4irl+Om69yMX+pVWVwPWwE2xDu/TOE6qmB8sf3zZP onevXzIiNPKFJx4NDKlYvV9+dEFjPo8m5Gi9WrHzvBFIV8tnF2jstEL0tzkGULtthXpA oLc6SwWy7Gg2cubauvELNKAThGwLHOab5tniNv1OVa61OyBPPaPRNa7DgbbQWNpam+/H U7flfWEwiWe/22BwQvnuxMp5njbvR7XGRsSpw54Y+uH/Rlz5z6Xo+T1hdmufJLy3iHIl MQ/w== X-Gm-Message-State: ALoCoQmjYW/P/weUWQgj6kn7Bl9AoAhoVppL6Ud/jhf9oXUzKDBnqey292EV0q/4I0a3U6nwI/yw X-Received: by 10.194.109.169 with SMTP id ht9mr17793946wjb.13.1449238932987; Fri, 04 Dec 2015 06:22:12 -0800 (PST) Received: from [10.0.0.3] (host31-48-191-113.range31-48.btcentralplus.com. [31.48.191.113]) by smtp.gmail.com with ESMTPSA id d66sm3708703wma.21.2015.12.04.06.22.11 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Dec 2015 06:22:12 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Subject: Re: Put working git branch in shell prompt for bash and zsh? From: Bartek Rutkowski In-Reply-To: Date: Fri, 4 Dec 2015 14:22:10 +0000 Cc: freebsd-git@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5794E27D-73D5-4419-9351-52D45A5C7BFF@FreeBSD.org> References: To: Craig Rodrigues X-Mailer: Apple Mail (2.3096.5) X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 16:54:05 -0000 > On 4 Dec 2015, at 14:20, Craig Rodrigues wrote: >=20 > Hi, >=20 > I am heavily using git for my projects these days. > Typically I am working on multiple projects, with > multiple checked out trees. I am also switching > between branches a lot. >=20 > Sometimes because I am working with so many > checked out trees, I lose track of what branch > I am working on. >=20 > Can anyone point me to a "stupid shell trick" > which would put the currently active branch in the > shell prompt? I typically use bash and zsh shells, > so having the trick for those shells would be useful. >=20 > Thank! >=20 Check out 'zprezto' ZSH config framework with 'sorin' theme activated, = you'll love it :) Kind regards, Bartek Rutkowski From owner-freebsd-git@freebsd.org Fri Dec 4 17:30:35 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B2CA41BE3 for ; Fri, 4 Dec 2015 17:30:35 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA0A1A45; Fri, 4 Dec 2015 17:30:35 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ioc74 with SMTP id 74so122872164ioc.2; Fri, 04 Dec 2015 09:30:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tHJhaniwPk/qWlnG/lFRNRexXnv/LOKTnGhsKcC/wDM=; b=0xMkW9tQWXRZdn2aP0/DSQppdAbc6OSdIVb6DF7tzEOxAe4dqsvxahqWy6AAjN+I5M moYWl3noY56oV4VtFfgWfQQz8iwdEgUVPasCOx5DbKGyO5Fpq91iy+1dSSn4vvHJh6rk QbzIPD5o4VEi2a138DSWdaj6fcB/7D2bPHZl4atfTXdtwN8fOCvNtwovJEvaVaKfcPnl HfVlEgxWqE9sxsRA4xkTDWPktsRY6Cs+6KCP6/tl8SiU+n+muypHVxwjZ++0nyANjbuq ZXALC/7izkz96J349jJmlLwK7uMaHT+4svvaRabyysDDe6CLpdK46qjjJCZtdH1mEvwS LAtA== MIME-Version: 1.0 X-Received: by 10.107.11.23 with SMTP id v23mr17047981ioi.184.1449250234193; Fri, 04 Dec 2015 09:30:34 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Fri, 4 Dec 2015 09:30:34 -0800 (PST) In-Reply-To: <5794E27D-73D5-4419-9351-52D45A5C7BFF@FreeBSD.org> References: <5794E27D-73D5-4419-9351-52D45A5C7BFF@FreeBSD.org> Date: Fri, 4 Dec 2015 09:30:34 -0800 X-Google-Sender-Auth: SeO4aw2-TqCa5UK9KRUYs2GBAO0 Message-ID: Subject: Re: Put working git branch in shell prompt for bash and zsh? From: Craig Rodrigues To: Bartek Rutkowski Cc: freebsd-git@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 17:30:35 -0000 On Fri, Dec 4, 2015 at 6:22 AM, Bartek Rutkowski wrote: > Check out 'zprezto' ZSH config framework with 'sorin' theme activated, > you'll love it :) > Wow! I love it! Here is what I did: (1) Followed instructions for setting up zprezto at: https://github.com/sorin-ionescu/prezto (2) In $HOME/.zshrc put this line near the top so that zprezto is properly initialzed: source ~/.zprezto/init.zsh After that, when I changed directories into a git checkout, it puts the branch in the prompt like this: https://goo.gl/WfLMdx I didn't like the default prompt, because it was too "busy". So, I did some additional customizations: (3) In $HOME/.zpreztorc , put this line: zstyle ':prezto:module:prompt' theme 'minimal' That's it! Now I can do this: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ~/checkouts =C2=BB cd $HOME/checkouts ~/checkouts =C2=BB pwd /home/rodrigc/checkouts ~/checkouts =C2=BB cd m2crypto checkouts/m2crypto - [setuptools] =C2=BB git branch python3_c * setuptools checkouts/m2crypto - [setuptools] =C2=BB git checkout master Switched to branch 'master' Your branch is up-to-date with 'origin/master'. checkouts/m2crypto - [master] =C2=BB =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D There are a lot of blogs out there for zprezto, so obviously there is more customization that I can do. However, I was able to quickly get the behavior I wanted without too much work. Thanks!! -- Craig From owner-freebsd-git@freebsd.org Fri Dec 4 18:23:41 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D90ABA41D61 for ; Fri, 4 Dec 2015 18:23:41 +0000 (UTC) (envelope-from alfred@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id B34F710AB for ; Fri, 4 Dec 2015 18:23:41 +0000 (UTC) (envelope-from alfred@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id A0C20A41D58; Fri, 4 Dec 2015 18:23:41 +0000 (UTC) Delivered-To: git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FD40A41D57 for ; Fri, 4 Dec 2015 18:23:41 +0000 (UTC) (envelope-from alfred@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 89C35109E for ; Fri, 4 Dec 2015 18:23:38 +0000 (UTC) (envelope-from alfred@freebsd.org) Received: from [IPv6:2600:1010:b043:7f41:88a:57aa:66:ee6f] (unknown [IPv6:2600:1010:b043:7f41:88a:57aa:66:ee6f]) by elvis.mu.org (Postfix) with ESMTPSA id E7971345A921 for ; Fri, 4 Dec 2015 10:23:32 -0800 (PST) From: Alfred Perlstein Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: Is gitsvn working? Message-Id: <9DECE1C2-064C-4EEC-B170-7AD86A8205EB@freebsd.org> Date: Fri, 4 Dec 2015 10:23:32 -0800 To: git@freebsd.org X-Mailer: iPhone Mail (13B143) X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 18:23:41 -0000 Hey folks a few weeks ago I was submitting a few ports via gitsvn. Around th= at time there was an upgrade to 1.9 that seemed to break gitsvn.=20 Does gitsvn work again? Is there a branch to pull from? Or a start point to r= estart from? Thank you.=20 -Alfred=20 Sent from my iPhone= From owner-freebsd-git@freebsd.org Fri Dec 4 18:49:07 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BA04A41798; Fri, 4 Dec 2015 18:49:07 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BBF91929; Fri, 4 Dec 2015 18:49:07 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by lfaz4 with SMTP id z4so118186415lfa.0; Fri, 04 Dec 2015 10:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=hOyBzldRV7NL74intIrXGZUQbD3Y32MwA7sgO9RCt84=; b=fLgEjrevQbgjHYvQ+5c7DRSNZdStHg7lOV5x2FRcp6FQMYXIREBpWdKDE68O2mY6ZF pJLXztdpW1iqV/v+ku5O/hXprZsj7e7odPHB8nf+9RSlcP0pKwJnRiJR62PLOZm2bmEj kiNSarvMSAVyj1oXQZzp8yn3AISQWEo8pZR9szXNjYPBFTfc5KumgZUohfx08gIjlJN/ FsagsMDKUVrLPuKhMv4SBwril3A3OeO9LWoVF5ee+DfEyXPz42jwyiRO1j2VhhSXOQ8f 3NqC+bA5qbDSEMQWQ/lA+I8iqeXLNISDdEWwVdhKj3YAP4d4Y0xB4bE/SBYu5Iyc0AfT yG+g== MIME-Version: 1.0 X-Received: by 10.25.26.210 with SMTP id a201mr7602663lfa.58.1449254945124; Fri, 04 Dec 2015 10:49:05 -0800 (PST) Sender: uspoerlein@gmail.com Received: by 10.25.144.140 with HTTP; Fri, 4 Dec 2015 10:49:05 -0800 (PST) In-Reply-To: References: <563EAAB8.5020702@freebsd.org> Date: Fri, 4 Dec 2015 19:49:05 +0100 X-Google-Sender-Auth: n82W7NaGcwFOWwa-R5nvv5l5Qps Message-ID: Subject: Re: FYI: SVN to GIT converter currently broken, github is falling behind From: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= To: freebsd-git@freebsd.org Cc: freebsd-current@freebsd.org, git-admin@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 18:49:07 -0000 2015-11-08 12:06 GMT+01:00 Ulrich Sp=C3=B6rlein : > 2015-11-08 11:32 GMT+01:00 Ulrich Sp=C3=B6rlein : >> 2015-11-08 2:51 GMT+01:00 Alfred Perlstein : >>>> >>> Uli, >>> >>> One of the biggest concerns I've heard from folks using FreeBSD's git m= irror >>> is that the hashes can change. >>> >>> I have a question about this. Is it possible to keep track of what th= e >>> "official" git mirror (on github) is doing and keep that as a log. The= n >>> that log can be used to replay commits when there is a divergence probl= em. >>> >>> What I'm basically saying is that let's take this small example: >>> >>> importer is working fine @rev 10000 >>> imports 10000 >>> imports 10001 >>> imports 10002 >>> something happens to importer to give indeterminate shas. >>> imports 10003 - sha is "unstable" sha3 >>> imports 10004 - sha is "unstable" sha4 >>> imports 10005 - sha is "unstable" sha5 >>> imports 10006 - sha is "unstable" sha6 >>> importer is fixed >>> >>> >>> At this point normally we'd rewind the importer to 10002 and then force >>> update the affected branches. >>> >>> My question is... can the imports of 10003, 10004, 10005 and 10006 be p= ut >>> into the importer such that any "mirror site" that re-does the import u= sing >>> the most up to date importer will get the same shas. >>> >>> That would allow to proceed with 10007, etc without force pushing. >>> >>> This should be possible based on querying "git" for the meta data assoc= iated >>> with sha3..sha6 and then forcing those commits to have the same meta da= ta. >>> >>> This would eliminate the concern about shas in the mirror changing that= I've >>> heard. >> >> The goal of the conversion is that everyone can re-do the conversion >> in their basement and come up with the same history and checksums. >> This was not the case when I first started, as there was some >> non-deterministic hash structure being used in svn2git. This was fixed >> in the code and then all converter runs produced the very same >> results. >> >> The scenario that we have right now, is that one of the merge commits >> done about two weeks ago is being handled different by svn2git w/ svn >> v1.8 vs. svn v1.9 and I haven't investigated yet how the API's >> behavior changed to cause this. I'm afraid I also swapped out all my >> knowledge about svn2git internals and will have to redo this all from >> scratch :/ >> >> Your suggestion could only work, if we hard-code this svn revision >> special handling into svn2git, either in the code or by providing more >> mappings and rules to the process. svn2git should run hermetic and not >> poke at github's commits to see how things were handled in the past. >> It has to be self-sufficient and must not depend on github. >> >> This would also only work, if the "breakage" window was very small, >> but it is already about two weeks long and will surely increase till I >> find the proper fix. >> >> So, to take a stand here: this sort of kludge is unlikely to ever >> happen. Git commit hashes *might* change in the future. I really don't >> see how this is a big deal anyway. It happened once and I'm trying to >> have it never happen again. But why are people afraid of this >> happening? Every "official" git commit is tagged with a SVN revision >> and the contents of those revisions are obviously correct (just not >> the ancestry and the commit objects, possibly). So it would be easy to >> write a script that replays VendorA's git history and swaps out the >> new official commits for the old official commits. There would be no >> merge conflicts. >> >> I can see how this would be annoying if you have 100 developers and >> dozens of branches that are far from mainline FreeBSD. But I'm sure >> these companies that depend on git will come forward and donate some >> of their developer manpower to help me with keeping the converter >> stable/deterministic. Right? Right? :) :) >> >> Cheers, >> Uli > > Quick update: doc is so far unaffected by svn 1.9, but for ports, the > drift happened as of Jul 18, so you'd need to special case a lot of > commits. > > Here's the same commit, and the difference between 1.8 and 1.9: > > % git cat-file commit 803795d > tree 7fc83aba022834da5c218114b09ad4640735bcc0 > parent c96fb0418e545a569b5975b4d878a30a948c29d5 > author olgeni 1437203525 +0000 > committer olgeni 1437203525 +0000 > > Upgrade to version 0.4.1. > % git cat-file commit 61ca43b > tree 7fc83aba022834da5c218114b09ad4640735bcc0 > parent c96fb0418e545a569b5975b4d878a30a948c29d5 > author olgeni 1437203529 +0000 > committer olgeni 1437203529 +0000 > > Upgrade to version 0.4.1. > > > In case you don't see it, there's a 4s difference in the timestamps > for authoring and committing. Here's the original: > > % svn log -vc392405 svn://svn.freebsd.org/ports > ------------------------------------------------------------------------ > r392405 | olgeni | 2015-07-18 09:12:05 +0200 (Sat, 18 Jul 2015) | 2 lines > Changed paths: > M /head/www/elixir-maru/Makefile > M /head/www/elixir-maru/distinfo > > Upgrade to version 0.4.1. > > ------------------------------------------------------------------------ > > So yeah, svn 1.9 returned a timestamp that was off by 4s. WTF? > > For base it's actually even more complicated than I had thought so > far. But let's take this one step at time ... An update, which you won't like to hear: SVN v1.9 is totally innocent, the API changed a little and has been patched, this is not the source of the difference between the currently published repo and a clean run. The difference stems from the fact that the svnsync'ed copy on git.freebsd.org was poisoned and is *NOT* in sync with our main repo. People tell me this is due to a shortcoming of svnsync that can race and thus produce different metadata for a commit, depending on when it is run. This is a clusterfuck. Both freebsd-base and freebsd-ports are no longer reproducible by third-parties. It is only a matter of time when freebsd-doc is affected. clusteradm@ sadly has remained rather silent on this issue and unless we can move the mirroring to rsync or syncthing or whatever I don't see how the project can continue to provide a so-called git "mirror" Sad, Uli From owner-freebsd-git@freebsd.org Fri Dec 4 19:53:41 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D390A41733; Fri, 4 Dec 2015 19:53:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 50E3410F8; Fri, 4 Dec 2015 19:53:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 3F0721C56; Fri, 4 Dec 2015 19:53:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id AD65118BAE; Fri, 4 Dec 2015 19:53:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id zr_4PRs3dMgs; Fri, 4 Dec 2015 19:53:37 +0000 (UTC) Subject: Re: FYI: SVN to GIT converter currently broken, github is falling behind DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EC16018BA5 To: =?UTF-8?Q?Ulrich_Sp=c3=b6rlein?= , freebsd-git@freebsd.org References: <563EAAB8.5020702@freebsd.org> Cc: freebsd-current@freebsd.org, git-admin@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5661EF43.9040406@FreeBSD.org> Date: Fri, 4 Dec 2015 11:53:39 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KIw4nppIcKxsRKMVRwiWAsIG3FSmtXmw6" X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 19:53:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KIw4nppIcKxsRKMVRwiWAsIG3FSmtXmw6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/4/2015 10:49 AM, Ulrich Sp=C3=B6rlein wrote: > 2015-11-08 12:06 GMT+01:00 Ulrich Sp=C3=B6rlein : >> 2015-11-08 11:32 GMT+01:00 Ulrich Sp=C3=B6rlein : >>> 2015-11-08 2:51 GMT+01:00 Alfred Perlstein : >>>>> >>>> Uli, >>>> >>>> One of the biggest concerns I've heard from folks using FreeBSD's gi= t mirror >>>> is that the hashes can change. >>>> >>>> I have a question about this. Is it possible to keep track of what= the >>>> "official" git mirror (on github) is doing and keep that as a log. = Then >>>> that log can be used to replay commits when there is a divergence pr= oblem. >>>> >>>> What I'm basically saying is that let's take this small example: >>>> >>>> importer is working fine @rev 10000 >>>> imports 10000 >>>> imports 10001 >>>> imports 10002 >>>> something happens to importer to give indeterminate shas. >>>> imports 10003 - sha is "unstable" sha3 >>>> imports 10004 - sha is "unstable" sha4 >>>> imports 10005 - sha is "unstable" sha5 >>>> imports 10006 - sha is "unstable" sha6 >>>> importer is fixed >>>> >>>> >>>> At this point normally we'd rewind the importer to 10002 and then fo= rce >>>> update the affected branches. >>>> >>>> My question is... can the imports of 10003, 10004, 10005 and 10006 b= e put >>>> into the importer such that any "mirror site" that re-does the impor= t using >>>> the most up to date importer will get the same shas. >>>> >>>> That would allow to proceed with 10007, etc without force pushing. >>>> >>>> This should be possible based on querying "git" for the meta data as= sociated >>>> with sha3..sha6 and then forcing those commits to have the same meta= data. >>>> >>>> This would eliminate the concern about shas in the mirror changing t= hat I've >>>> heard. >>> >>> The goal of the conversion is that everyone can re-do the conversion >>> in their basement and come up with the same history and checksums. >>> This was not the case when I first started, as there was some >>> non-deterministic hash structure being used in svn2git. This was fixe= d >>> in the code and then all converter runs produced the very same >>> results. >>> >>> The scenario that we have right now, is that one of the merge commits= >>> done about two weeks ago is being handled different by svn2git w/ svn= >>> v1.8 vs. svn v1.9 and I haven't investigated yet how the API's >>> behavior changed to cause this. I'm afraid I also swapped out all my >>> knowledge about svn2git internals and will have to redo this all from= >>> scratch :/ >>> >>> Your suggestion could only work, if we hard-code this svn revision >>> special handling into svn2git, either in the code or by providing mor= e >>> mappings and rules to the process. svn2git should run hermetic and no= t >>> poke at github's commits to see how things were handled in the past. >>> It has to be self-sufficient and must not depend on github. >>> >>> This would also only work, if the "breakage" window was very small, >>> but it is already about two weeks long and will surely increase till = I >>> find the proper fix. >>> >>> So, to take a stand here: this sort of kludge is unlikely to ever >>> happen. Git commit hashes *might* change in the future. I really don'= t >>> see how this is a big deal anyway. It happened once and I'm trying t= o >>> have it never happen again. But why are people afraid of this >>> happening? Every "official" git commit is tagged with a SVN revision >>> and the contents of those revisions are obviously correct (just not >>> the ancestry and the commit objects, possibly). So it would be easy t= o >>> write a script that replays VendorA's git history and swaps out the >>> new official commits for the old official commits. There would be no >>> merge conflicts. >>> >>> I can see how this would be annoying if you have 100 developers and >>> dozens of branches that are far from mainline FreeBSD. But I'm sure >>> these companies that depend on git will come forward and donate some >>> of their developer manpower to help me with keeping the converter >>> stable/deterministic. Right? Right? :) :) >>> >>> Cheers, >>> Uli >> >> Quick update: doc is so far unaffected by svn 1.9, but for ports, the >> drift happened as of Jul 18, so you'd need to special case a lot of >> commits. >> >> Here's the same commit, and the difference between 1.8 and 1.9: >> >> % git cat-file commit 803795d >> tree 7fc83aba022834da5c218114b09ad4640735bcc0 >> parent c96fb0418e545a569b5975b4d878a30a948c29d5 >> author olgeni 1437203525 +0000 >> committer olgeni 1437203525 +0000 >> >> Upgrade to version 0.4.1. >> % git cat-file commit 61ca43b >> tree 7fc83aba022834da5c218114b09ad4640735bcc0 >> parent c96fb0418e545a569b5975b4d878a30a948c29d5 >> author olgeni 1437203529 +0000 >> committer olgeni 1437203529 +0000 >> >> Upgrade to version 0.4.1. >> >> >> In case you don't see it, there's a 4s difference in the timestamps >> for authoring and committing. Here's the original: >> >> % svn log -vc392405 svn://svn.freebsd.org/ports >> ----------------------------------------------------------------------= -- >> r392405 | olgeni | 2015-07-18 09:12:05 +0200 (Sat, 18 Jul 2015) | 2 li= nes >> Changed paths: >> M /head/www/elixir-maru/Makefile >> M /head/www/elixir-maru/distinfo >> >> Upgrade to version 0.4.1. >> >> ----------------------------------------------------------------------= -- >> >> So yeah, svn 1.9 returned a timestamp that was off by 4s. WTF? >> >> For base it's actually even more complicated than I had thought so >> far. But let's take this one step at time ... >=20 > An update, which you won't like to hear: >=20 > SVN v1.9 is totally innocent, the API changed a little and has been > patched, this is not the source of the difference between the > currently published repo and a clean run. The difference stems from > the fact that the svnsync'ed copy on git.freebsd.org was poisoned and > is *NOT* in sync with our main repo. People tell me this is due to a > shortcoming of svnsync that can race and thus produce different > metadata for a commit, depending on when it is run. >=20 > This is a clusterfuck. >=20 > Both freebsd-base and freebsd-ports are no longer reproducible by > third-parties. It is only a matter of time when freebsd-doc is > affected. >=20 > clusteradm@ sadly has remained rather silent on this issue and unless > we can move the mirroring to rsync or syncthing or whatever I don't > see how the project can continue to provide a so-called git "mirror" >=20 Running svnsync in 2 places and then calling them mirrors seems odd. It's only needed once. (svnsync hurts global warming too). Then just rsync or use the git mirroring features. --=20 Regards, Bryan Drewery --KIw4nppIcKxsRKMVRwiWAsIG3FSmtXmw6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWYe9DAAoJEDXXcbtuRpfPMpIIAM0eaiH62z729Usg40skt+Ys jrQqnWegG/AGi5ULgMBFlh7LivlmCPobnwQokX83aZEsBhUvPKtfQp7b9Y14QWO1 cful3FRd4VfK4ti2uI0FMHnKmvLyb2iEATSnUCdAf+J+zB4kK14kz2gGDOUrec2+ A83MGgk4bJFRi1wFeqtzO6ZfBjecQPyikXICxX+rNtYd8pMfuuepr2MyneISUzyv Whc40hYYdyw1AIGv1mtMJhn4VQkKwjiyhzjLmHUsm+RSDlAOoV0UY6EQeVnbXL/L msRpLxhB4qq5EghEjqbUuL8C5wkwt9JO/BrW0/hSQXuBHKRKiab2pPVxXCZ48Kg= =rPTF -----END PGP SIGNATURE----- --KIw4nppIcKxsRKMVRwiWAsIG3FSmtXmw6--