xprop: refacturing

Thomas Dickey dickey at his.com
Sun Jan 30 21:48:07 UTC 2022


On Thu, Jan 27, 2022 at 08:00:45PM +0100, René wrote:
> Ta. It makes sense..
> You can find the fork here [1].

yes, but...

# ------------------------------------------------------------------------------
# Makefile.am                |   23 
# README.md                  |   19 
# clientwin.c                |  114 +
# clientwin.h                |    7 
# configure.ac               |    4 
# dsimple.c                  |  399 ++----
# dsimple.h                  |  115 -
# gadefox-xprop/INSTALL      |  370 ++++++
# gadefox-xprop/args.c       |  613 ++++++++++
# gadefox-xprop/args.h       |  144 ++
# gadefox-xprop/compile      |  347 +++++
# gadefox-xprop/config.guess | 1476 +++++++++++++++++++++++++
# gadefox-xprop/config.h.in  |   75 +
# gadefox-xprop/config.sub   | 1801 ++++++++++++++++++++++++++++++
# gadefox-xprop/depcomp      |  791 +++++++++++++
# gadefox-xprop/format.c     |  427 +++++++
# gadefox-xprop/format.h     |  113 +
# gadefox-xprop/install-sh   |  501 ++++++++
# gadefox-xprop/man/xprop.1  |  363 ++++++
# gadefox-xprop/misc.c       |  545 +++++++++
# gadefox-xprop/misc.h       |   92 +
# gadefox-xprop/missing      |  215 +++
# gadefox-xprop/print.c      |  624 ++++++++++
# gadefox-xprop/print.h      |   80 +
# gadefox-xprop/showprop.c   |  577 +++++++++
# gadefox-xprop/showprop.h   |   35 
# gadefox-xprop/strutil.c    |  129 ++
# gadefox-xprop/strutil.h    |   25 
# gadefox-xprop/thunk.c      |  480 ++++++++
# gadefox-xprop/thunk.h      |  129 ++
# gadefox-xprop/verbose.c    |  189 +++
# gadefox-xprop/verbose.h    |   84 +
# gadefox-xprop/xprop.h      |   71 +
# xprop.c                    | 2527 ++++++++++---------------------------------
# 34 files changed, 11156 insertions(+), 2348 deletions(-)
# ------------------------------------------------------------------------------

I'm guessing that your version diverged a while back.

There's no direct relationship between the two that git might notice.

The xorg version has additional changes, and just
the raw difference doesn't tell a complete story:

+ Some of the difference can be discounted because the xorg version
  uses autogen.sh, which eliminates the need for bundling certain
  files: compile, config.guess, config.sub, depcomp, missing.

+ Other differences include changes to the copyright notices
  to make them less verbose.

+ There also are code/functional differences.  Without reducing those
  to relatively small changes, it's not possible to determine which
  version is an improvement over some ~20-year-old code (or which may
  solve the same problem in a different way).

  It would help a lot to have on your side an archive whose history
  goes back to the beginning of your development effort.

If I had to merge the two,

+ I'd use gitlab to create a fork of the xorg xprop (the simplest way to
  prepare for pull-requests), and

+ in my fork, I'd create a branch with this repo, and incrementally move
  related changes from _that_ into the branch which I'd use for pull-requests.

+ At the same time, I'd go the other way:  merging changes from the xorg
  version, to reduce the amount of difference to address.

  As a start, I'd reduce the difference for the autogen.sh and copyright
  notices, which appear to be about 35% of the total.  After that, the
  slices really depend on which changes are needed as a foundation for
  the remainder.

> --dformat is new arg for changing default and display format,  so you don`t
> need to change it for each property (i`m using it for strings)
> 
> Rene
> 
> [1]
> https://github.com/gadefox/xprop
> 
> On 10:19, Wed, 26 Jan 2022 Thomas Dickey <dickey at his.com wrote:
> 
> > On Mon, Jan 24, 2022 at 01:56:55PM +0100, René wrote:
> > > I redeveloped `xprop.., so it fits my expectations:
> > > - the tool does not allocate 1MB every time
> > > - no limit for buffer
> > > - refacturing the code
> > > - colorized output
> > > --raw param for scripts
> > > - bug fixing
> > > - $@ tag for pro name
> > > $# tag for prop type
> > > $^^ tag for separator
> > > - no need to use `sed for paring the output e.g. I just use --dformat
> > (def.
> > > format)=$8s:$0 --raw for getting string prop. or --dformat=8s:$^:^$0+ for
> > > the list
> >
> > where is "--dformat" defined?  (which tool)
> >
> > > - double --args with =
> > > - src is split to more files
> > > - no exit fn call
> > > - memory releasing at the end
> > >
> > > please note it's not small patch so I don't know how to upload the files
> > to
> > > git. who is managing the src code let me know
> >
> > updates are done by forking the git repo, e.g.,
> >
> >         https://gitlab.freedesktop.org/xorg/app/xprop
> >
> > and submitting pull-requests.  Several small pull requests would probably
> > get more response than a large one.
> >
> > --
> > Thomas E. Dickey <dickey at invisible-island.net>
> > https://invisible-island.net
> > ftp://ftp.invisible-island.net
> >

-- 
Thomas E. Dickey <dickey at invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20220130/5b1ac1fb/attachment.sig>


More information about the xorg-devel mailing list