Re: [PATCH v2 2/2] Make old sha1 optional with git update-ref -d

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v2 2/2] Make old sha1 optional with git update-ref -d

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:40

Karl Hasselström [off-list ref] writes:
Giving the old sha1 is already optional when changing a ref, and it's
quite handy when running update-ref manually. So make it optional for
deleting a ref too.

Signed-off-by: Karl Hasselström <redacted>
"Handy" is not a very good reason when talking about plumbing command like
update-ref that takes an extra parameter for safety of the last step in
read, operate, verify-and-update sequence.

Although it is not a reason _bad enough_ to make your patch a bad idea,
perhaps you should rethink the problem at the same time?  Whatever you are
trying to do cannot be done without manually invoking update-ref directly
by the end user, perhaps that needs to be addressed?

Re: [PATCH v2 2/2] Make old sha1 optional with git update-ref -d

From: Karl Hasselström <hidden>
Date: 2016-06-15 22:44:40

On 2008-06-02 22:51:33 -0700, Junio C Hamano wrote:
Karl Hasselström [off-list ref] writes:
quoted
Giving the old sha1 is already optional when changing a ref, and
it's quite handy when running update-ref manually. So make it
optional for deleting a ref too.
"Handy" is not a very good reason when talking about plumbing
command like update-ref that takes an extra parameter for safety of
the last step in read, operate, verify-and-update sequence.

Although it is not a reason _bad enough_ to make your patch a bad
idea, perhaps you should rethink the problem at the same time?
Whatever you are trying to do cannot be done without manually
invoking update-ref directly by the end user, perhaps that needs to
be addressed?
I need this from time to time when experimenting with StGit -- or,
more precisely, when cleaning up afterwards in case it didn't go so
well. Packed refs means I can't safely just edit/delete files under
.git/refs anymore, so I use update-ref instead. And having to use the
safety belt every time is just plain tedious. I'd say this is a
perfect example of when using the plumbing by hand is really what you
want.

(In this kind of situation, branch -D often doesn't work since my ref
isn't under refs/heads, and besides I really don't want any of it's
smarts right then -- I want to delete a ref, nothing more.)

Better suggestions welcome, of course.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

Re: [PATCH v2 2/2] Make old sha1 optional with git update-ref -d

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:40

Karl Hasselström [off-list ref] writes:
I need this from time to time when experimenting with StGit -- or,
more precisely, when cleaning up afterwards in case it didn't go so
well. Packed refs means I can't safely just edit/delete files under
.git/refs anymore, so I use update-ref instead. And having to use the
safety belt every time is just plain tedious. I'd say this is a
perfect example of when using the plumbing by hand is really what you
want.
Oh, I should have guessed, and I am relieved by your answer.

I was worried that in some workflow people may have to use "update-ref -d"
all the time because our Porcelain allows them to create some ref without
giving a clean way to remove it (e.g. "branch" and "tag" allow creation
and deletion with -d/-D, so they are Ok, but I was worried there might be
something else I overlooked).

Manually cleaning up what an experimental version of Porcelain left behind
does not fall into category of "normal user has to do this all the time",
so I do not have to worry.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help