Quelques rappels de style.
1. Je vois beaucoup d'entrées qui ressemblent à ça :
* foo.hh: Blah blah.
Other blah blah.
Par soucis d'uniformité, évitez les espaces supplémentaires après la
tabulation. Ça devrait ressembler à ça :
* foo.hh: Blah blah.
Other blah blah.
De même, n'utilisez qu'une seule espace après « * » ; ceci
* foo.hh: Blah blah.
* bar.cc: Other blah blah.
est à proscrire.
2. Ce n'est pas la peine de documenter les entrées que svn-wrapper
génère par pur zèle :
* .: Blah.
La présence de ce « . » n'est probablement due qu'à un changement de
propriété Subversion sur le répertoire à partir duquel vous avez lancé
svn. Or c'est typiquement le genre de choses qu'on ne documente pas
dans un ChangeLog (rappel : ChangeLog décrit les changements vis-à-vis
de la *distribution*, et pas du dépôt).
=> Il faut supprimer de telles lignes lorsque vous faites un commit.
De façon génèrale, svn-rapper n'est qu'un *outil* : les règles (celles
du Guide et des GNU Coding Standards) priment. Faites des entrèes
utiles, pas du remplissage.
3. Ne pas utiliser de caractère joker (wildcard) tels que « * » :
* foo/bar/*: Fix ctors.
Ça rend l'usage de grep difficile. Il faut détailler (je sais, c'est du
travail) :
* foo/bar/baz.cc,
* foo/bar/quux.cc:
* foo/bar/ix.cc:
Fix ctors.
4. Les fichiers doivent toujours être prefixés d'une étoile (vous pouvez
éventuellement les grouper sur une ligne si vous voulez). Ceci n'est
donc pas correct :
* inim/2010/rag/rag.cc, inim/2010/rag/center_weight.hh,
inim/2010/rag/dijkstra.hh, inim/2010/rag/p_vertices_with_accu.hh,
inim/2010/rag/rag.hh, inim/2010/rag/Makefile: New, INIM1 project
to detect lines from a picture with a Region Adjacency Graph.
Il aurait fallu écrire :
* inim/2010/rag/rag.cc, inim/2010/rag/center_weight.hh,
* inim/2010/rag/dijkstra.hh, inim/2010/rag/p_vertices_with_accu.hh,
* inim/2010/rag/rag.hh, inim/2010/rag/Makefile: New, INIM1 project
to detect lines from a picture with a Region Adjacency Graph.
Voire (mais c'est juste une question de goût) :
* inim/2010/rag/rag.cc,
* inim/2010/rag/center_weight.hh,
* inim/2010/rag/dijkstra.hh,
* inim/2010/rag/p_vertices_with_accu.hh,
* inim/2010/rag/rag.hh,
* inim/2010/rag/Makefile:
New, INIM1 project to detect lines from a picture with a Region
Adjacency Graph.
5. Les entrées s'écrivent à l'impératif (et non au prétérit). Une
entrée comme :
* foo.cc: Fixed 'float' bug on edges.
devrait s'écrire :
* foo.cc: Fix 'float' bug on edges.
6. Attention à tenir dans 80 colonnes!
7. Ce n'est pas une mauvaise idée de sauter des lignes dans un ChangeLog
pour marquer les différentes parties d'un patch, mais il ne faut pas en
abuser. S'il y en a trop, c'est probablement que vous êtes en train de
commettre trop de choses en même temps, qui mériteraient des patches
séparés. Si vous êtes utilisateur de Git, l'outil est là pour vous
aider.
Il faut éviter de faire des patches fourre-tout où vous corrigez
plusieurs problèmes d'un seul coup. Ça rend difficile la
lecture/relecture de vos contributions et la recherche d'infos.
Merci d'avance de respecter ces indications !
P.S. : Une bonne partie de ces règles figurent dans le guide, mais pas
toutes. Si une bonne âme trouve le temps de reformater ça et d'ajouter
ce qui manque au Guide du LRDE, je lui en serai reconnaissant.
Serait-il possible de créer un dépôt Git vide pour `argp' ? Je voudrais
le peupler par la suite.
Ça me permettra de tester la conversion de svn:external vers des
sous-modules de Git.
>>> "VO" == Vincent Ordy <ordy(a)lrde.epita.fr> writes:
VO> trunk/ChangeLog | 8 ++++++++
VO> trunk/src/git-lrde | 1 +
C'est curieux, trunk/ n'a rien à faire là.
J'imagine que tu as du faire un drôle d'import svn.
La commande serait
soit: git svn clone -s https://svn.lrde.epita.fr/svn/lrde-tools
(pour importer toutes les branches)
soit: git svn clone https://svn.lrde.epita.fr/svn/lrde-tools/trunk &&
mv trunk lrde-tools
(pour n'importer qu'une branche)
Tu as peux-être tapé la première sans le -s.
--
Alexandre Duret-Lutz
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Dalila Benboudjema <dalila(a)lrde.epita.fr>
Add images for Dalila and create IGR directories .
* igr,
* igr/images,
* igr/images/s7.ppm,
* igr/out,
* igr/code: Add IGR directories.
* scribo/10_00000002.pbm_text2cell.ppm,
* scribo/8_00000002.pbm_lbl-grouped-boxes.pgm,
* scribo/2_00000002.pbm_horizontal-erosion.pbm,
* scribo/11_00000002.pbm_out.ppm,
* scribo/6_00000002.pbm_lbl-small-comps-removed.pgm,
* scribo/5_00000002.pbm_table.ppm,
* scribo/demat.hh: .
* scribo/00000002.pbm,
* scribo/demat_v2.hh,
* scribo/facture2-neg.pbm,
* scribo/+out.txt,
* scribo/1_00000002.pbm_vertical-erosion.pbm,
* scribo/9_00000002.pbm_cells-labels.ppm,
* scribo/00000002-neg.pbm,
* scribo/3_00000002.pbm_vertical-and-horizontal-erosion.ppm,
* scribo/4_00000002.pbm_after-alignment.ppm,
* scribo/7_00000002.pbm_character-bboxes.ppm,
* scribo/demat31Oct2008.hh,
* scribo/facture-neg.pbm,
* scribo/Makefile,
* dalila/images,
* dalila/dematOld.hh,
* dalila/plop.cc: Add scribo stuff.
dalila/dematOld.hh | 553 +++++++++
dalila/plop.cc | 19
scribo/+out.txt | 1882 +++++++++++++++++++++++++++++++++
scribo/9_00000002.pbm_cells-labels.ppm | 6
scribo/Makefile | 5
scribo/demat.hh | 9
scribo/demat31Oct2008.hh | 559 +++++++++
scribo/demat_v2.hh | 134 ++
8 files changed, 3167 insertions(+)
Index: igr/images/s7.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: igr/images/s7.ppm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/10_00000002.pbm_text2cell.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/10_00000002.pbm_text2cell.ppm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/8_00000002.pbm_lbl-grouped-boxes.pgm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/8_00000002.pbm_lbl-grouped-boxes.pgm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/2_00000002.pbm_horizontal-erosion.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/2_00000002.pbm_horizontal-erosion.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/11_00000002.pbm_out.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/11_00000002.pbm_out.ppm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/6_00000002.pbm_lbl-small-comps-removed.pgm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/6_00000002.pbm_lbl-small-comps-removed.pgm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/5_00000002.pbm_table.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/5_00000002.pbm_table.ppm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/demat.hh
--- scribo/demat.hh (revision 3156)
+++ scribo/demat.hh (working copy)
@@ -370,6 +370,15 @@
util::array<int> cols = align_lines(in.ncols(), geom::min_col(in),
geom::max_col(in), tblboxes.first,
1);
+# ifndef NOUT
+ image2d<rgb8> out2(in.domain());
+ level::fill(out2, literal::black);
+ for_all_components(i, tblboxes.first)
+ draw::box(out2, tblboxes.first[i], literal::red);
+ for_all_components(i, tblboxes.second)
+ draw::box(out2, tblboxes.second[i], literal::red);
+ io::ppm::save(out2, output_file("after-alignment.ppm"));
+# endif
connect_lines(rows, tblboxes.first, 0, in.nrows());
connect_lines(cols, tblboxes.second, 1, in.ncols());
Index: scribo/00000002.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/00000002.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/demat_v2.hh
--- scribo/demat_v2.hh (revision 0)
+++ scribo/demat_v2.hh (revision 0)
@@ -0,0 +1,134 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef DEMAT_HH_
+# define DEMAT_HH_
+
+# include <mln/core/image/image2d.hh>
+
+# include <mln/core/image/image_if.hh>
+# include <mln/core/image/sub_image.hh>
+# include <mln/core/alias/neighb2d.hh>
+# include <mln/core/var.hh>
+# include <mln/core/site_set/p_vaccess.hh>
+
+# include <mln/binarization/threshold.hh>
+# include <mln/morpho/hit_or_miss.hh>
+# include <mln/level/fill.hh>
+# include <mln/border/fill.hh>
+# include <mln/io/pbm/load.hh>
+# include <mln/io/pgm/load.hh>
+# include <mln/io/pbm/save.hh>
+# include <mln/io/pgm/save.hh>
+# include <mln/debug/println.hh>
+# include <mln/morpho/opening.hh>
+# include <mln/trait/value_.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/value/int_u16.hh>
+# include <mln/level/paste.hh>
+# include <mln/labeling/blobs.hh>
+# include <mln/level/fill.hh>
+# include <mln/pw/all.hh>
+# include <mln/convert/to_fun.hh>
+# include <mln/geom/bbox.hh>
+
+# include <mln/labeling/compute.hh>
+# include <mln/accu/bbox.hh>
+
+namespace scribo
+{
+
+ namespace internal
+ {
+
+ void filter_image(mln::image2d<bool>& ima,
+ const mln::image2d<bool>& filter,
+ unsigned bbox_larger)
+ {
+ using namespace mln;
+ using value::int_u16;
+
+ typedef image2d<int_u16> I;
+ typedef mln_accu_with_(accu::meta::bbox, mln_psite_(I)) A;
+ typedef util::array<A::result> boxes_t;
+
+ int_u16 nlabels;
+ I lbl = labeling::blobs(filter, c4(), nlabels);
+
+ boxes_t boxes = labeling::compute(accu::meta::bbox(), lbl, nlabels);
+
+ for (unsigned i = 1; i <= nlabels; ++i)
+ level::paste(pw::cst(false)
+ | boxes[i].to_larger(bbox_larger),
+ ima);
+ }
+
+ void remove_tables(mln::image2d<bool>& in, unsigned h, unsigned w, unsigned n)
+ {
+ using namespace mln;
+
+ // Lignes verticales
+ win::rectangle2d vwin(h, w);
+ image2d<bool> vfilter = morpho::opening(in, vwin);
+ io::pbm::save(vfilter, "./table-vfilter.pbm");
+ filter_image(in, vfilter, n);
+
+
+ // Lignes horizontales
+ win::rectangle2d hwin(w, h);
+ image2d<bool> hfilter = morpho::opening(in, hwin);
+ io::pbm::save(hfilter, "./table-hfilter.pbm");
+ filter_image(in, hfilter, n);
+ }
+
+ } // end of namespace scribo::internal
+
+
+
+ // Facade
+ void demat(char *argv[])
+ {
+ using namespace mln;
+ using value::int_u8;
+
+ //Useful debug variables
+ unsigned h = atoi(argv[2]);
+ unsigned w = atoi(argv[3]);
+ unsigned n = atoi(argv[4]);
+
+ //Load image
+ image2d<bool> in;
+ io::pbm::load(in, argv[1]);
+
+ internal::remove_tables(in, h, w, n);
+
+ io::pbm::save(in, "./table-filtered.pbm");
+ }
+
+} // end of namespace scribo
+
+# endif // ! DEMAT_HH
Index: scribo/facture2-neg.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/facture2-neg.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/+out.txt
--- scribo/+out.txt (revision 0)
+++ scribo/+out.txt (revision 0)
@@ -0,0 +1,1882 @@
Index: scribo/1_00000002.pbm_vertical-erosion.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: scribo/1_00000002.pbm_vertical-erosion.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: scribo/9_00000002.pbm_cells-labels.ppm
--- scribo/9_00000002.pbm_cells-labels.ppm (revision 0)
+++ scribo/9_00000002.pbm_cells-labels.ppm (revision 0)
@@ -0,0 +1,6 @@
+P6
+# Generated by Milena 1.0 http://olena.lrde.epita.fr
+# EPITA Research and Development Laboratory (LRDE)
+1180 1680
+255
https://svn.lrde.epita.fr/svn/nolimips/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Update bison++.
* build-aux/bison++.in: Catch up with TC's bison++.in.
bison++.in | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 69 insertions(+), 10 deletions(-)
Index: build-aux/bison++.in
--- build-aux/bison++.in (revision 219)
+++ build-aux/bison++.in (working copy)
@@ -19,10 +19,15 @@
shift
output=$1
output_base=$(basename "$output")
+output_base_noext=$(echo "$output_base" | sed -e 's/\.[^.]*//')
output_dir=$(dirname "$output")
-output_dir_abs=$(cd "$output_dir" && pwd)
shift
+
options="$@"
+if $BISON --xml --version >/dev/null 2>&1; then
+ options="$options --xml"
+fi
+
# Alexandre Duret-Lutz also notes that in VPATH-builds $(srcdir) can
# be an absolute path depending on how ./configure is called ...
@@ -34,7 +39,7 @@
# paths with Bison, chdir there.
# A tmp dir.
-tmp=$output_base.dir
+tmp=$output_base_noext.dir
rm -rf $tmp
mkdir $tmp
@@ -47,23 +52,77 @@
status=$?
set -e
-if test $status = 0; then
- for file in *
+
+# fix_bison_output FILE
+# ---------------------
+# Fixes in place.
+fix_bison_output ()
+{
+ # Fix doxygen tags.
+ perl -pi -e "s|\Q\\file $base\E\b|\\\\file parse/$base|g;" "$1"
+
+}
+
+# Go back to where we were and use relative paths instead of using
+# absolute file names. The messages look nicer.
+cd ..
+case $status in
+ 0)
+ for file in $tmp/*
do
- case $file in
+ base=$(basename $file)
+ base_noext=$(echo "$base" | sed -e 's/\.[^.]*//')
+ out=$output_dir/$base
+ case $base in
$input_base)
# Leave it here.
;;
+
+ *.xml)
+ # Computing the HTML is slow. Do it when the XML changed.
+ fix_bison_output "$file"
+ if ! test -r "$out" || ! cmp -s "$file" "$out"; then
+ xml2html="xsltproc $($BISON --print-datadir)/xslt/xml2xhtml.xsl"
+ if $xml2html "$file" >$tmp/$base_noext.html; then
+ $move_if_change "$tmp/$base_noext.html" \
+ "$output_dir/$base_noext.html"
+ else
+ echo >&2 "$0: cannot convert XML report to HTML"
+ rm $tmp/$base_noext.html
+ fi
+ fi
+ $move_if_change "$file" "$out"
+ ;;
+
+ *.hh)
+ fix_bison_output "$file"
+ # To save cycles, if the file differs only on sync lines,
+ # update it (to be right), but keep the original timestamps.
+ if test -r "$out" &&
+ diff -I '^#line' -I '/\* Line .* of .* \*/' -q "$file" "$out"; then
+ touch -r "$out" "$file"
+ cp "$out" "$out.bak"
+ echo >&2 "$0: kept the stamps of $file"
+ fi
+ $move_if_change "$file" "$out"
+ ;;
+
*)
- # Fix doxygen tags.
- perl -pi -e "s|\Q\\file $file\E\b|\\\\file parse/$file|g;" "$file"
- $move_if_change "$file" "$output_dir_abs/$file"
+ fix_bison_output "$file"
+ $move_if_change "$file" "$out"
;;
esac
done
-fi
+ ;;
+
+ *) # We really want to keep the *.output files.
+ for file in $(ls $tmp/*.output $tmp/*.xml $tmp/*.html 2>/dev/null)
+ do
+ $move_if_change "$file" "$output_dir/$(basename $file)"
+ done
+ ;;
+esac
# Get rid of the tmp dir.
-cd ..
rm -rf $tmp
exit $status