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

Re: [PATCH] Allow branch names that end with ".lock"

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 8, 2009, 01:01 UTC
Message-ID
<20090508010110.GW30527@spearce.org>
In-Reply-To
<7veiv0bee2.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> 
> > Junio C Hamano <gitster@pobox.com> wrote:
> >> A project policy for naming branches could be to use a dot as a word
> >> separator (instead of '-' which is often done by existing projects), and
> >> "fix.vm.lock" could be a very valid name for a branch to address a VM
> >> locking issues.
> >
> > I think we sent the same patch... except...
> >
> >>  git-gui/lib/index.tcl                    |    2 +-
> >
> > Don't do that.  I'll patch git-gui and send you a pull request.
> 
> Why not?  I never commit my "how about this" weatherbaloon patches
> directly ;-)

I know. I was saying, "don't patch git-gui in the same commit as git.git". I would have spun that as two different commits.

> If you found that ours match identically except for that one line, that is
> a very good indication.  I didn't check.
Here's `git diff yours mine`, we were really close:
diff --git a/Documentation/technical/api-lockfile.txt b/Documentation/technical/api-lockfile.txt
index 31e1141..982984f 100644
--- a/Documentation/technical/api-lockfile.txt
+++ b/Documentation/technical/api-lockfile.txt
@@ -4,7 +4,7 @@ lockfile API
 The lockfile API serves two purposes:
 
 * Mutual exclusion.  When we write out a new index file, first
-  we create a new "lock" file `$GIT_DIR/index..lck`, write the new
+  we create a new file `$GIT_DIR/index..lck`, write the new
   contents into it, and rename it to the final destination
   `$GIT_DIR/index`.  We try to create the `$GIT_DIR/index..lck`
   file with O_EXCL so that we can notice and fail when somebody

ACK, I like your version better than mine.

diff --git a/refs.c b/refs.c
index 03aded9..b4ca305 100644
--- a/refs.c
+++ b/refs.c
@@ -742,8 +742,6 @@ int check_ref_format(const char *ref)
 				return CHECK_REF_FORMAT_ERROR;
 			if (level < 2)
 				return CHECK_REF_FORMAT_ONELEVEL;
-			if (has_extension(ref, "..lck"))
-				return CHECK_REF_FORMAT_ERROR;
 			return ret;
 		}
 	}

NAK, I like how I removed this block.  It can't happen anymore,
the no ".." in name earlier should have caught the condition.
-- 
Shawn.
Previous: Junio C HamanoNext: Junio C Hamano
Message 17 of 18 in “Add support for boolean config values "yes", "no"”
  1. 1/2 Add support for boolean config values "yes", "no"Shawn O. Pearce, May 7, 2009
  2. 2/2 Make Repository.isValidRefName compatible with Git 1.6.3Shawn O. Pearce, May 7, 2009
  3. Robin RosenbergMay 7, 2009
  4. Linus TorvaldsMay 7, 2009
  5. Junio C HamanoMay 8, 2009
  6. Shawn O. PearceMay 8, 2009
  7. Alex RiesenMay 8, 2009
  8. Johannes SchindelinMay 8, 2009
  9. Junio C HamanoMay 8, 2009
  10. Johannes SchindelinMay 8, 2009
  11. Alex RiesenMay 8, 2009
  12. Shawn O. PearceMay 8, 2009
  13. Brandon CaseyMay 7, 2009
  14. 1/2 Add support for boolean config values "on", "off"Shawn O. Pearce, May 7, 2009
  15. Shawn O. PearceMay 8, 2009
  16. Junio C HamanoMay 8, 2009
  17. Shawn O. PearceMay 8, 2009
  18. Junio C HamanoMay 8, 2009

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.