git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add merge detection to git-cvsimport

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Aug 16, 2005, 21:36 UTC
Message-ID
<46a038f9050816143646fa4137@mail.gmail.com>
In-Reply-To
<20050816110725.GL11882MdfPADPa@garage.linux.student.kuleuven.ac.be>
On 8/16/05, Sven Verdoolaege <skimo@kotnet.org> wrote:
Show 6 quoted lines
> On Tue, Aug 16, 2005 at 10:35:27PM +1200, Martin Langhoff wrote:
> > +
> > +sub get_headref($$) {
> 
> If you want to check whether a ref is valid, then
> it is better to use git-rev-parse...

We are reading/writing directly to .git/refs/heads/ a lot in this script. Not changing that for the time being.

Show 8 quoted lines
> > +    if (open(C,"$git_dir/refs/heads/$name")) {
> > +     chomp($sha = <C>);
> > +     close(C);
> > +     length($sha) == 40
> > +         or die "Cannot get head id for $name ($sha): $!\n";
> 
> ... but if you're just going to die, then why not simply
> let git-commit-tree do the test ?
Because we get the head names from cvsps output, and we want to have a
specific error when cvsps has given us a bogus branch name.
git-commit-tree could fail for a number of reasons, this one is the
most likely one to be from a bug in cvsps or the cvsimport logic.
 
> > +                             if ($mparent eq 'HEAD') { $mparent = 'origin'};
> 
> Please don't hardcode 'origin' here.
Duh! Patch submitted. Juniooooo! 
martin
Previous: Sven VerdoolaegeNext: Matthias Urlichs
Message 3 of 4 in “Add merge detection to git-cvsimport”
  1. Add merge detection to git-cvsimportMartin Langhoff, Aug 16, 2005
  2. Sven VerdoolaegeAug 16, 2005
  3. Martin LanghoffAug 16, 2005
  4. Matthias UrlichsAug 17, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.