Re: [PATCH WIP] git-stash: add new 'drop' subcommand

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Schindelin
Date: Wednesday, February 6, 2008 - 4:53 pm

Hi,

On Wed, 6 Feb 2008, Brandon Casey wrote:


Just to repeat my opinion: "drop" is not useful.  I think 'git stash pop 
"$1"' = 'git stash apply "$1" && git stash drop "$1"' would be a sane 
interface.

And this means that a multiple drop would become uninteresting.

As for your reflog delete with multiple arguments... Right.  This needs a 
change in the callback data cmd_reflog_expire_cb, recno needs to become a 
pointer to an int, instead of an int.  Then, cmd_delete() has to allocate 
argc + 1 int values, setting the last to -1.  It has to shift the recno 
pointer in the loop to the respective next element of this allocated 
array.  The values need to be sorted after the loop in ascending order.  
Then, in a loop from the last to the second entry, the _difference_ 
array[i] - array[i-1] has to be stored in array[i].  Also, recno has to be 
reset to the first element in the array.  Then, expire_reflog_ent() has to 
be changed to check "recno && *recno >= 0", and if "--*(cb->cmd->recno) == 
0", it not only has to prune, but before that increment cb->cmd->recno, so 
it points to the next element of the array.

Also, I think that "reflog delete" should probably just realise when it 
deleted the last element, and update the ref with the new last element (or 
delete it if none is left).

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] git-stash: alias 'list' to 'ls' and 'clear' to ..., Johannes Schindelin, (Tue Feb 5, 7:03 am)
[PATCH WIP] git-stash: add new 'drop' subcommand, Brandon Casey, (Wed Feb 6, 9:19 am)
Re: [PATCH WIP] git-stash: add new 'drop' subcommand, Paolo Bonzini, (Wed Feb 6, 10:11 am)
Re: [PATCH WIP] git-stash: add new 'drop' subcommand, Junio C Hamano, (Wed Feb 6, 12:44 pm)
Re: [PATCH WIP] git-stash: add new 'drop' subcommand, Johannes Schindelin, (Wed Feb 6, 4:53 pm)