From: David Brown <git@davidb.org>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Junio C Hamano <gitster@pobox.com>, dhruva <dhruva@ymail.com>,
GIT SCM <git@vger.kernel.org>, Simon Hausmann <simon@lst.de>
Subject: Re: [PATCH] Optional shrinking of RCS keywords in git-p4
Date: Mon, 15 Sep 2008 21:12:01 -0700 [thread overview]
Message-ID: <20080916041201.GA25033@linode.davidb.org> (raw)
In-Reply-To: <alpine.LNX.1.00.0809151354040.19665@iabervon.org>
On Mon, Sep 15, 2008 at 03:22:33PM -0400, Daniel Barkalow wrote:
>Actually, the problem seems to be that git-p4 tries to create the modified
>file by applying the git-generated diff to the p4-provided file, and this
>fails if the context for the git-generated diff contains a keyword, since
>the p4-provided file has it expanded and git has it collapsed.
It is very likely that I've never made a change within context-lines
of a RCS header. The files we have with these headers tend to also
comment blocks at the top that don't change after the file is created.
>I think the right solution is for git-p4 to check that p4 thinks the file
>is the correct file and then simply replace it rather than trying to
>generate the right result by patching. To be a bit more careful, git-p4
>could check that the contents it's replacing actually would exactly match
>the git contents if the keywords were callapsed (if the p4 setting is to
>use keywords in this file).
Part of the problem is that p4 isn't very good at knowing whether
files have changed or not. 'p4 sync' will update the file _if_ if
thinks your version is out of date, but it does nothing if someone has
locally modified the file, hence the need for the 'p4 sync -f'.
A simple way to be paranoid would be something (shell-ish) like:
p4 print filename | collapse-keywords | git hash-object --stdin
and make sure that is the version we think the file should have
started with. I think we're really just making sure we didn't miss a
P4 change that someone else made underneath, and we're about to back
out.
Even this isn't robust from p4's point of view. The p4 model is to do
a 'p4 edit' on the file, and then the later 'p4 submit' will give an
error if someone else has updated the file. This would require using
p4's conflict resolution, and I'm guessing someone using git-p4 would
rather abort the submit and rebase.
David
next prev parent reply other threads:[~2008-09-16 4:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-15 6:26 [PATCH] Optional shrinking of RCS keywords in git-p4 dhruva
2008-09-15 6:35 ` David Brown
2008-09-15 7:43 ` Junio C Hamano
2008-09-15 11:02 ` Tor Arvid Lund
2008-09-15 19:22 ` Daniel Barkalow
2008-09-16 4:12 ` David Brown [this message]
2008-09-16 12:58 ` Jing Xue
2008-09-16 17:12 ` Daniel Barkalow
2008-09-16 17:32 ` Daniel Barkalow
-- strict thread matches above, loose matches on Subject: below --
2008-09-19 2:56 dhruva
2008-09-16 13:33 dhruva
2008-09-16 4:53 dhruva
2008-09-16 17:26 ` Daniel Barkalow
2008-09-16 2:51 dhruva
2008-09-15 11:46 dhruva
2008-09-15 15:27 ` Tor Arvid Lund
2008-09-15 7:21 dhruva
2008-09-15 6:31 dhruva
2008-09-15 5:58 Dhruva Krishnamurthy
2008-09-15 6:09 ` David Brown
2008-09-15 6:17 ` Junio C Hamano
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=20080916041201.GA25033@linode.davidb.org \
--to=git@davidb.org \
--cc=barkalow@iabervon.org \
--cc=dhruva@ymail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=simon@lst.de \
/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).