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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, 6 Feb 2008, Brandon Casey wrote:

> This allows a single stash entry to be deleted. It takes an optional 
> argument which is a stash reflog entry. If no arguments are supplied, it 
> drops the most recent stash entry.

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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux