Re: [PATCH 22/23] lock_any_ref_for_update(): inline function

2014-12-10 Thread Michael Haggerty
On 12/09/2014 12:34 AM, Stefan Beller wrote:
 On Fri, Dec 05, 2014 at 12:08:34AM +0100, Michael Haggerty wrote:
 From: Ronnie Sahlberg sahlb...@google.com

 Inline the function at its one remaining caller (which is within
 refs.c) and remove it.

 
 
 Signed-off-by: Michael Haggerty mhag...@alum.mit.edu
 
 It's originally from Ronnie, but his sign off is missing?
 
 If that sign off is found again, 
 Reviewed-by: Stefan Beller sbel...@google.com

Sorry for the confusion.

This patch ultimately descends from a patch by Ronnie that completely
deleted lock_any_ref_for_update() because (in the context that he wrote
it) there were no remaining callers of that function.

In the context of this patch, there *is* a remaining caller. So this
patch is different--it deletes the obvious stuff as in Ronnie's patch,
but it also inlines the function at its last caller. And the commit
message is completely different.

Given those differences and the fact that the only overlap with Ronnie's
original patch is the *deletion* of content, I thought it most
appropriate to change the authorship of the patch. So I removed Ronnie's
Signed-off-by line but I forgot to remove his authorship.

If anybody thinks it would be more appropriate to leave Ronnie as author
of the new patch or leave his Signed-off-by line, I am totally OK with
doing so. I'm just trying to figure out what's right.

Otherwise, I will change the authorship of the patch to myself in the
upcoming reroll and include only my own Signed-off-by line.

Michael

-- 
Michael Haggerty
mhag...@alum.mit.edu

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/23] lock_any_ref_for_update(): inline function

2014-12-08 Thread Stefan Beller
On Fri, Dec 05, 2014 at 12:08:34AM +0100, Michael Haggerty wrote:
 From: Ronnie Sahlberg sahlb...@google.com
 
 Inline the function at its one remaining caller (which is within
 refs.c) and remove it.
 


 Signed-off-by: Michael Haggerty mhag...@alum.mit.edu

It's originally from Ronnie, but his sign off is missing?

If that sign off is found again, 
Reviewed-by: Stefan Beller sbel...@google.com

 ---
  refs.c | 9 +
  refs.h | 9 +
  2 files changed, 2 insertions(+), 16 deletions(-)
 
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 22/23] lock_any_ref_for_update(): inline function

2014-12-04 Thread Michael Haggerty
From: Ronnie Sahlberg sahlb...@google.com

Inline the function at its one remaining caller (which is within
refs.c) and remove it.

Signed-off-by: Michael Haggerty mhag...@alum.mit.edu
---
 refs.c | 9 +
 refs.h | 9 +
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/refs.c b/refs.c
index c6ee775..f3564cf 100644
--- a/refs.c
+++ b/refs.c
@@ -2346,13 +2346,6 @@ static struct ref_lock *lock_ref_sha1_basic(const char 
*refname,
return NULL;
 }
 
-struct ref_lock *lock_any_ref_for_update(const char *refname,
-const unsigned char *old_sha1,
-int flags, int *type_p)
-{
-   return lock_ref_sha1_basic(refname, old_sha1, NULL, flags, type_p);
-}
-
 /*
  * Write an entry to the packed-refs file for the specified refname.
  * If peeled is non-NULL, write it as the entry's peeled value.
@@ -4007,7 +4000,7 @@ extern int reflog_expire(const char *refname, const 
unsigned char *sha1,
 * we take the lock for the ref itself to prevent it from
 * getting updated.
 */
-   lock = lock_any_ref_for_update(refname, sha1, 0, NULL);
+   lock = lock_ref_sha1_basic(refname, sha1, NULL, 0, NULL);
if (!lock)
return error(cannot lock ref '%s', refname);
if (!reflog_exists(refname)) {
diff --git a/refs.h b/refs.h
index 82611b5..174863d 100644
--- a/refs.h
+++ b/refs.h
@@ -181,8 +181,7 @@ extern int is_branch(const char *refname);
 extern int peel_ref(const char *refname, unsigned char *sha1);
 
 /*
- * Flags controlling lock_any_ref_for_update(), ref_transaction_update(),
- * ref_transaction_create(), etc.
+ * Flags controlling ref_transaction_update(), ref_transaction_create(), etc.
  * REF_NODEREF: act on the ref directly, instead of dereferencing
  *  symbolic references.
  * REF_DELETING: tolerate broken refs
@@ -191,12 +190,6 @@ extern int peel_ref(const char *refname, unsigned char 
*sha1);
  */
 #define REF_NODEREF0x01
 #define REF_DELETING   0x02
-/*
- * This function sets errno to something meaningful on failure.
- */
-extern struct ref_lock *lock_any_ref_for_update(const char *refname,
-   const unsigned char *old_sha1,
-   int flags, int *type_p);
 
 /*
  * Setup reflog before using. Set errno to something meaningful on failure.
-- 
2.1.3

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html