From: Pierre Habouzit <madcoder@debian.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>,
Denis Bueno <dbueno@gmail.com>
Subject: Re: Consolidate SHA1 object file close
Date: Thu, 12 Jun 2008 01:03:55 +0200 [thread overview]
Message-ID: <20080611230355.GE16439@artemis.madism.org> (raw)
In-Reply-To: <20080611222534.GC16439@artemis.madism.org>
[-- Attachment #1.1: Type: text/plain, Size: 2258 bytes --]
On Wed, Jun 11, 2008 at 10:25:34PM +0000, Pierre Habouzit wrote:
> On Wed, Jun 11, 2008 at 05:34:53PM +0000, Linus Torvalds wrote:
> >
> >
> > > > > Quite often, when people commit, they have corrupt repositories. The
> > > > > symptom is a `cannot read <sha1>` error message (or many at times).
> >
> > Btw, do you have exact error messages?
>
> Well, like said I don't have had the problem myself, and it's hard to
> reproduce, people have it like once a week average, for people that
> perform around 50 to 100 commits a week.
I should say that the problem happens more often when people use the script I
inlined in the end (this scripts does what git pull --rebase nowadays
does, with a dirty workdir, roughly, I'm not its author, the goal isn't
to discuss its lack of beauty or whatever, just to point out some
possible things that leads to the NFS issue).
Next time something breaks, I'll be able to give you a log.
-------------------------------------
#!/bin/bash
OPTIONS_SPEC=
SUBDIRECTORY_OK=t
. git-sh-setup
require_work_tree
case $# in
0)
branch=origin/$(git symbolic-ref HEAD|sed -e 's!refs/heads/!!')
;;
1)
branch="$1"
;;
*)
echo 1>&2 "$(basename $0) [<branch>]"
exit 1
;;
esac
if git rev-parse --verify HEAD > /dev/null &&
git update-index --refresh &&
git diff-files --quiet &&
git diff-index --cached --quiet HEAD --
then
NEED_TEMPO=
else
NEED_TEMPO=t
fi
git fetch
test -z "$NEED_TEMPO" || git commit -a -s -m'tempo'
git rebase "$branch"
if test -n "$NEED_TEMPO"; then
if test -d "$(dirname "$(git rev-parse --git-dir)")/.dotest"; then
echo ""
echo "run 'git reset HEAD~1' when rebase is finished"
else
git reset HEAD~1
fi
fi
-------------------------------------
Also note that now people use an enhanced version of that script (the
one in attachment). It still breaks, but less often. I'm not sure it's
valuable information at all, but one never knows.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #1.2: git-up --]
[-- Type: text/plain, Size: 2367 bytes --]
#!/bin/sh
OPTIONS_SPEC="\
$(basename $0) [options] [<remote> [<branch>]]
--
k,gitk visualize unmerged differences
r,rebase perform a rebase
m,merge perform a merge
"
SUBDIRECTORY_OK=t
. git-sh-setup
require_work_tree
lbranch=$(git symbolic-ref HEAD | sed -e s~refs/heads/~~)
remote=$(git config --get "branch.$lbranch.remote" || echo origin)
branch=$(git config --get "branch.$lbranch.merge" || echo "refs/heads/$lbranch")
case "$(git config --bool --get madcoder.up-gitk)" in
true) gitk=gitk;;
*) gitk=:
esac
case "$(git config --bool --get "branch.$lbranch.rebase")" in
true) action=rebase;;
*) action=;;
esac
while test $# != 0; do
case "$1" in
-k|--gitk)
shift; gitk=gitk;;
--no-gitk)
shift; gitk=:;;
-r|--rebase)
shift; action=rebase;;
--no-rebase)
shift; rebase=${rebase#rebase};;
-m|--merge)
shift; action=merge;;
--no-merge)
shift; rebase=${rebase#merge};;
--)
shift; break;;
*)
usage;;
esac
done
case $# in
0) ;;
1) remote="$1";;
2) remote="$1"; branch="$2";;
*) usage;;
esac
git fetch "${remote}"
if test `git rev-list .."${remote}/${branch#refs/heads/}" -- | wc -l` = 0; then
echo "Current branch $lbranch is up to date."
exit 0
fi
$gitk .."${remote}/${branch#refs/heads/}" --
if test -z "$action"; then
echo -n "(r)ebase/(m)erge/(q)uit ? "
read ans
case "$ans" in
r*) action=rebase;;
m*) action=merge;;
*) exit 0;;
esac
fi
unclean=
git rev-parse --verify HEAD > /dev/null && \
git update-index --refresh && \
git diff-files --quiet && \
git diff-index --cached --quiet HEAD -- || unclean=t
case "$action" in
rebase)
test -z "$unclean" || git stash save "git-up stash"
git rebase "${remote}/${branch#refs/heads/}"
;;
merge)
test -z "$unclean" || git stash save "git-up stash"
git merge "${remote}/${branch#refs/heads/}"
;;
*)
echo 1>&2 "no action specified"
exit 1
;;
esac
if test -n "$unclean"; then
if test -d "$(git rev-parse --git-dir)/../.dotest"; then
echo ""
echo "run 'git stash apply' when rebase is finished"
else
git stash apply
fi
fi
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-06-11 23:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-11 1:47 Consolidate SHA1 object file close Linus Torvalds
2008-06-11 7:42 ` Andreas Ericsson
2008-06-11 7:43 ` Pierre Habouzit
2008-06-11 15:17 ` Linus Torvalds
2008-06-11 15:40 ` Pierre Habouzit
2008-06-11 17:25 ` Linus Torvalds
2008-06-11 17:46 ` Linus Torvalds
[not found] ` <alpine.LFD.1.10.0806111030580.3101@woody.linux-foundation.org>
2008-06-11 22:25 ` Pierre Habouzit
2008-06-11 23:03 ` Pierre Habouzit [this message]
2008-06-12 15:33 ` Linus Torvalds
2008-06-12 16:00 ` Pierre Habouzit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080611230355.GE16439@artemis.madism.org \
--to=madcoder@debian.org \
--cc=dbueno@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).